Skip to content

Latest commit

 

History

History
142 lines (116 loc) · 7.79 KB

README.md

File metadata and controls

142 lines (116 loc) · 7.79 KB

This application is used as reference code for developers to show how to use the C++ API to generate a runtime key. Once a runtime key is generated it must be activated to produce a token.

Dependencies

The SDK is developed in C++11 and you'll need glibc 2.27+ on Linux and Microsoft Visual C++ 2015 Redistributable(x64) - 14.0.24123 (any later version is ok) on Windows. You most likely already have these dependencies on you machine as almost every program require it.

Debugging missing dependencies

To check if all dependencies are present:

GPGPU acceleration

  • On x86-64, GPGPU acceleration is disabled by default. Check here for more information on how to enable it.
  • On NVIDIA Jetson (AArch64), GPGPU acceleration is always enabled. Check here for more information.

Pre-built binaries

If you don't want to build this sample by yourself then, use the pre-built versions:

Building

This sample contains a single C++ source file and is easy to build. The documentation about the C++ API is at https://www.doubango.org/SDKs/anpr/docs/cpp-api.html.

Windows

You'll need Visual Studio to build the code. The VS project is at runtimeKey.vcxproj. Open it.

  1. You will need to change the "Command Arguments" like the below image. Default value: --assets $(ProjectDir)..\..\..\assets
  2. You will need to change the "Environment" variable like the below image. Default value: PATH=$(VCRedistPaths)%PATH%;$(ProjectDir)..\..\..\binaries\windows\x86_64

VC++ config

You're now ready to build and run the sample.

Generic GCC

Next command is a generic GCC command:

cd ultimateALPR-SDK/samples/c++/runtimeKey

g++ runtimeKey.cxx -O3 -I../../../c++ -L../../../binaries/<yourOS>/<yourArch> -lultimate_alpr-sdk -o runtimeKey
  • You've to change yourOS and yourArch with the correct values. For example, on Linux x86_64 they would be equal to linux and x86_64 respectively.
  • If you're cross compiling then, you'll have to change g++ with the correct triplet. For example, on Linux host for Android ARM64 target the triplet would be equal to aarch64-linux-android-g++.

Raspberry Pi (Raspbian OS)

To build the sample for Raspberry Pi you can either do it on the device itself or cross compile it on Windows, Linux or OSX machines. For more information on how to install the toolchain for cross compilation please check here.

cd ultimateALPR-SDK/samples/c++/runtimeKey

arm-linux-gnueabihf-g++ runtimeKey.cxx -O3 -I../../../c++ -L../../../binaries/raspbian/armv7l -lultimate_alpr-sdk -o runtimeKey
  • On Windows: replace arm-linux-gnueabihf-g++ with arm-linux-gnueabihf-g++.exe
  • If you're building on the device itself: replace arm-linux-gnueabihf-g++ with g++ to use the default GCC

Testing

After building the application you can test it on your local machine.

Usage

runtimeKey is a command line application with the following usage:

runtimeKey \
      [--json <json-output:bool>] \
      [--assets <path-to-assets-folder>]

Options surrounded with [] are optional.

  • --json Whether to output the runtime license key as JSON string intead of raw string. Default: true.
  • --assets Path to the assets folder containing the configuration files and models. Default value is the current folder.
  • --type Defines how the license is attached to the machine/host. Possible values are aws-instance, aws-byol, azure-instance or azure-byol. Default: null. More info here.

Examples

  • For example, on Raspberry Pi you may call the runtimeKey application using the following command:
LD_LIBRARY_PATH=../../../binaries/raspbian/armv7l:$LD_LIBRARY_PATH ./runtimeKey \
    --json true \
    --assets ../../../assets
  • On NVIDIA Jetson you may use the next command:
LD_LIBRARY_PATH=../../../binaries/jetson/aarch64:$LD_LIBRARY_PATH ./runtimeKey \
    --json true \
    --assets ../../../assets
  • On Linux x86_64 you may use the next command:
LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH ./runtimeKey \
    --json true \
    --assets ../../../assets
  • On Linux aarch64 you may use the next command:
LD_LIBRARY_PATH=../../../binaries/linux/aarch64:$LD_LIBRARY_PATH ./runtimeKey \
    --json true \
    --assets ../../../assets
  • On Windows x86_64, you may use the next command:
runtimeKey.exe ^
    --json true ^
    --assets ../../../assets

Please note that if you're cross compiling the application then you've to make sure to copy the application and both the assets and binaries folders to the target device.

Amazon Web Services (AWS) and Microsoft Azure

Please read this if you're planning to run the SDK on Amazon AWS or Microsoft Azure.