Skip to content

Latest commit

 

History

History
103 lines (80 loc) · 6.53 KB

File metadata and controls

103 lines (80 loc) · 6.53 KB

This application is a reference implementation for developers to show how to use the Java API and could be used to easily check the accuracy. The Java API is a wrapper around the C++ API defined at https://www.doubango.org/SDKs/kyc-documents-verif/docs/cpp-api.html. A C++ twin sample application is at cpp/verify.

The application accepts path to a JPEG/PNG/BMP/... file as input.

If you don't want to build this sample and is looking for a quick way to check the accuracy, then try our online webapp demo at https://www.doubango.org/webapps/kyc-documents-verif.

This sample is open source and doesn't require registration or license key.

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.

If you're planning to use OpenVINO, then you'll need Intel C++ Compiler Redistributable (choose newest). Please note that OpenVINO is packaged in the SDK as plugin and loaded (dlopen) at runtime. The engine will fail to load the plugin if Intel C++ Compiler Redistributable is missing on your machine but the program will work as expected with Tensorflow as fallback. We highly recommend using OpenVINO to speedup the inference time and reduce memory usage.

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.

Pre-built binaries

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

Building

This sample contains a single Java source file.

You have to navigate to the current folder (KYC-Documents-Verif-SDK/samples/java/verify) before trying the next commands:

cd KYC-Documents-Verif-SDK/samples/java/verify

Here is how to build the file using javac:

javac @sources.txt -d .

Usage

Verify is a command line application with the following usage:

Verify \
      --image <path-to-image-to-process> \
      --assets <path-to-assets-folder> \
      [--tokenfile <path-to-license-token-file>] \
      [--tokendata <base64-license-token-data>]

Options surrounded with [] are optional.

Examples

You'll need to build the sample as explained above.

You have to navigate to the current folder (KYC-Documents-Verif-SDK/samples/java/verify) before trying the next commands:

cd KYC-Documents-Verif-SDK/samples/java/verify
  • On Linux x86_64, you may use the next command:
LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH \
java Verify --image "../../../assets/images/United States - California Driving License (2017).jpg" --assets ../../../assets

Before trying to run the program you'll need to download libtensorflow.so as explained here

  • On Windows x86_64, you may use the next command:
setlocal
set PATH=%PATH%;../../../binaries/windows/x86_64
java Verify --image "../../../assets/images/United States - California Driving License (2017).jpg" --assets ../../../assets
endlocal

To make your life easier, run run.bat to test on Windows. You can edit the file using Notepad to change the parameters.

The test image looks like this:

Test image