DoubangoTelecom / ultimateMRZ-SDK

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

Error in Doubango initializer when deployed in AWS Virtual Machine with Ubuntu 20.04 #81

Closed diegoictel closed 1 year ago

diegoictel commented 1 year ago

Hi,

I deployed Doubango in AWS Virtual Machine with Ubuntu 20.04, but when executed it's failing with the following error: "The type initializer for 'org.doubango.ultimateMrz.Sdk.ultimateMrzSdkPINVOKE' threw an exception."

After some debugging I found that the error is throwing at this line of code ultimateMrzSdkPINVOKE.UltMrzSdkEngine_init__SWIG_0(jsonConfig): shot

jsonConfig has the following value:

{ "debug_level": "info", "debug_write_input_image_enabled": false, "debug_internal_data_path": ".", "num_threads": -1, "gpgpu_enabled": true, "gpgpu_workload_balancing_enabled": false, "backpropagation_enabled": true, "ielcd_enabled": true, "segmenter_accuracy": "high", "interpolation": "bilinear", "min_num_lines": 2, "roi": [ 0.0, 0.0, 0.0, 0.0 ], "min_score": 0.0, "assets_folder": "./Assets/MRZ", "license_token_data": "" }

I have deployed the same project with Doubango in another server with Windows and IIS and it's working perfectly, but when deployed in AWS with Ubuntu is throwing an exception.

Any help would be appreciated.

Best,

DoubangoTelecom commented 1 year ago

Hi, There is no official support for C# on Linux even if it's known to work fine. Check the dev-group archive, it contains threads on how to fix the issue.

DoubangoTelecom commented 1 year ago

C# SWIG wrappers are not included in Linux library. We'll add them in the next commit.

DoubangoTelecom commented 1 year ago

Using v2.10 if you run objdump -T libultimate_mrz-sdk.so | grep "UltMrzSdkEngine_init__SWIG_0" you'll get no result because there was no C# wrappers in the Linux lib. Using v2.11 you'll get: 0000000000055cc0 g DF .text 00000000000000b7 Base CSharp_UltMrzSdkEngine_init__SWIG_0. Please note that Windows and Linux libraries have different names: Windows=ultimateMRZ-SDK.dll while Linux=libultimate_mrz-sdk. The C# wrappers are generated for Windows and you'll have to change all the DLLImport to match the linux name: https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/cdcc4160272ace5ebed412e05e3971e7f090fd1a/csharp/ultimateMrzSdkPINVOKE.cs#L231