DoubangoTelecom / ultimateMRZ-SDK

Machine-readable zone/travel document (MRZ / MRTD) detector and recognizer using deep learning
https://www.doubango.org/webapps/mrz/
Other
175 stars 49 forks source link

Running Samples under Linux (Ubuntu 18.04) #28

Closed pascal-gujer closed 4 years ago

pascal-gujer commented 4 years ago

Hey Guys Your project really sounds promising! Unfortunately running the sample on ma Ubuntu 18.04 spits out some weird Error Message:

./recognizer --image /home/user/Pictures/Webcam/test.jpg                                              
*[ULTMRZ_SDK INFO]: Initialization...
*[COMPV INFO]: [UltMrzSdkEngine] Call: init
*[COMPV INFO]: [UltMrzSdkEngine] jsonConfig: {"debug_level": "info","debug_write_input_image_enabled": false,"debug_internal_data_path": ".","num_threads": -1,"gpgpu_enabled": true,"gpgpu_workload_balancing_enabled": false,"segmenter_accuracy": "high","interpolation": "bilinear","min_num_lines": 2,"roi": [0, 0, 0, 0],"min_score": 0.0}
*[COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateMRZ/SDK_dev/lib/source/ultimate_mrz_sdk_public_engine.cxx' in function 'init' starting at line #79: Not optimized -> Code not built for mobile devices but for clouds. Are you sure this is what you want?
*[COMPV INFO]: [UltMrzSdkEngine] **** Copyright (C) 2011-2020 Doubango Telecom <https://www.doubango.org> ****
ultimateMRZ-SDK <https://github.com/DoubangoTelecom/ultimateMRZ-SDK> version 2.3.4

*[COMPV INFO]: [CompVBase] Initializing [base] modules (v 1.0.0, nt -1)...
*[COMPV INFO]: [CompVBase] sizeof(compv_scalar_t)= #8
*[COMPV INFO]: [CompVBase] sizeof(float)= #4
*[COMPV INFO]: Initializing window registery
*[COMPV INFO]: [ImageDecoder] Initializing image decoder...
*[COMPV INFO]: [CompVCpu] Hardware: 'GenuineIntel', Serial: '', Model: '78', ModelName: 'Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz'
*[COMPV INFO]: [CompVBase] CPU features: (intel);[x86];[x64];mmx;sse;sse2;sse3;ssse3;sse41;sse42;avx;avx2;fma3;erms;bmi1;bmi2;popcnt;cmov;aes;rdrand;
*[COMPV INFO]: [CompVBase] CPU cores: #4
*[COMPV INFO]: [CompVBase] CPU cache1: line size: #64B, size :#32KB
*[COMPV INFO]: [CompVBase] CPU Phys RAM size: #15885GB
*[COMPV INFO]: [CompVBase] CPU endianness: LITTLE
*[COMPV INFO]: [CompVBase] Binary type: X86_64
*[COMPV INFO]: [CompVBase] Intrinsic enabled
*[COMPV INFO]: [CompVBase] Assembler enabled
*[COMPV INFO]: [CompVBase] Code built with option /arch:SSE
*[COMPV INFO]: [CompVBase] Code built with option /arch:SSE2
*[COMPV INFO]: [CompVBase] Math Fast Trig.: true
*[COMPV INFO]: [CompVBase] Math Fixed Point: true
*[COMPV INFO]: [CompVMathExp] Init
*[COMPV INFO]: [CompVBase] Default alignment: #64
*[COMPV INFO]: [CompVBase] Best alignment: #64
*[COMPV INFO]: [CompVBase] Heap limit: #813334KB (#794MB)
*[COMPV INFO]: [CompVParallel] Initializing [parallel] module...
*[COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/compv_mem.cxx' in function 'CompVMemZero_C' starting at line #501: Not optimized -> No SIMD implementation found
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=0,set=useless, threadId:0x7ff94dcea700, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=1,set=useless, threadId:0x7ff94c7a8700, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=2,set=useless, threadId:0x7ff94bfa7700, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVThreadDispatcher] Thread dispatcher created with #4 threads/#4 cores
*[COMPV INFO]: [CompVParallel] [Parallel] module initialized
*[COMPV INFO]: [CompVBase] [Base] modules initialized
*[COMPV INFO]: [CompVCore] Initializing [core] module (v 1.0.0)...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 1 and name = 'FAST (Features from Accelerated Segment Test)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 8 and name = 'ORB (Oriented FAST and Rotated BRIEF)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 27 and name = 'Sobel edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 28 and name = 'Scharr edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 29 and name = 'Prewitt edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 20 and name = 'Canny edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 30 and name = 'Hough standard (STD)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 31 and name = 'Kernel-based Hough transform (KHT)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 41 and name = 'Standard Histogram of oriented gradients (S-HOG)'...
*[COMPV INFO]: [CompVMatcher] Registering matcher factory with id = 0 and name = 'Brute force matcher'...
*[COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 1 and name = 'PLSL (Parallel Light Speed Labeling)'...
*[COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 19 and name = 'LMSER (Linear Time Maximally Stable Extremal Regions)'...
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=3,set=useless, threadId:0x7ff94b7a6700, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVGL] Initializing [gl] module (v 1.0.0)...
*[COMPV INFO]: [CompVGL] GL module initialized
*[COMPV INFO]: [CompVGpu] Initializing [gpu] module (v 1.0.0)...
*[COMPV INFO]: [CompVCamera] Initializing [camera] module (v 1.0.0)...
*[COMPV INFO]: [CompVDrawing] Initializing [drawing] module (v 1.0.0)...
*[COMPV INFO]: [CompVDrawing] /!\ No jpeg decoder found
*[COMPV INFO]: [CompVDrawing] Drawing module initialized
*[COMPV INFO]: [CompVGpu] GPU enabled: true
*[COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateBase/lib/source/ultimate_base_engine.cxx' in function 'init' starting at line #39: Not optimized for GPU -> GPGPU computing not enabled or deactivated
*[COMPV INFO]: [UltBaseOpenCL] Trying to load [libOpenCL.so]
*[COMPV INFO]: [UltBaseOpenCL] Failed to load [libOpenCL.so]
*[COMPV INFO]: [UltMrzSdkEnginePrivate] **** Copyright (C) 2011-2020 Doubango Telecom <https://www.doubango.org> ****
You're using an unlicensed version of ultimateMRZ-SDK <https://github.com/DoubangoTelecom/ultimateMRZ-SDK>
without the rights to include the SDK in any form of commercial product.
*[COMPV INFO]: [CompVCpu] Enabling asm code
*[COMPV INFO]: [CompVCpu] Enabling intrinsic code
*[COMPV INFO]: [UltLstmNetwork] Old local: C, new local: C
*[COMPV INFO]: [UltLstmNetwork] Create LSTM engine for thread 0
*[COMPV INFO]: [UltLstmNetwork] Create LSTM engine for thread 2
*[COMPV INFO]: [UltLstmNetwork] Create LSTM engine for thread 1
Error opening data file C:/Projects/GitHub/ultimate/ultimateLstm/models/light/mrz.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'mrz'
Tesseract couldn't load any languages!
Error opening data file C:/Projects/GitHub/ultimate/ultimateLstm/models/light/mrz.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'mrz'
Tesseract couldn't load any languages!
***[COMPV ERROR]: function: "UltLstmNetworkThreadData()" 
file: "/home/ultimate/ultimateLstm/lib/source/ultimate_lstm_network.cxx" 
line: "70" 
message: Operation Failed (COMPV_ERROR_CODE_E_THIRD_PARTY_LIB) -> Failed to initialize Tesseract
****[COMPV FATAL]: function: "UltLstmNetworkThreadData()" 
file: "/home/ultimate/ultimateLstm/lib/source/ultimate_lstm_network.cxx" 
line: "70" 
message: Assertion failed!
***[COMPV ERROR]: function: "UltLstmNetworkThreadData()" 
file: "/home/ultimate/ultimateLstm/lib/source/ultimate_lstm_network.cxx" 
line: "70" 
message: Operation Failed (COMPV_ERROR_CODE_E_THIRD_PARTY_LIB) ->printenv TESSDATA_PREFIX
/usr/share/tesseract-ocr/4.00/tessdata/
 Failed to initialize Tesseract
[1]    20194 abort (core dumped)  ./recognizer --image /home/user/Pictures/Webcam/test.jpg

It's very strange that there pops up a Windows Path in the Error message.. Any chances the last linux build isn't so linux? :)

btw my vars should be correct:

printenv TESSDATA_PREFIX
/usr/share/tesseract-ocr/4.00/tessdata/

I'd highly appreciate some help, as - if your accuracy is really what you claim - I'll be your next customer :)

Thanks and cheers!

DoubangoTelecom commented 4 years ago

When the --assets option is missing we try the current folder to search for the configuration files. If all fails we use the hard-coded paths. This is why you're seeing windows paths. It's always I good idea to read documentation when you're trying to use a project.

try ./recognizer --image /home/user/Pictures/Webcam/test.jpg --assets <<path to the assets folder>> as explained at https://github.com/DoubangoTelecom/ultimateMRZ-SDK/tree/master/samples/java/recognizer#usage or check examples at https://github.com/DoubangoTelecom/ultimateMRZ-SDK/tree/master/samples/java/recognizer#testing-examples

DoubangoTelecom commented 4 years ago

Oops!! The previous message was for Java sample. For C++ the links are https://github.com/DoubangoTelecom/ultimateMRZ-SDK/tree/master/samples/c%2B%2B/recognizer#testing-usage and https://github.com/DoubangoTelecom/ultimateMRZ-SDK/tree/master/samples/c%2B%2B/recognizer#examples