├── README.md
├── gradio
├── app.py
└── images
│ ├── band_credit_card
│ ├── demo1.jpg
│ ├── demo2.png
│ └── demo3.png
│ ├── id
│ ├── demo1.jpg
│ ├── demo2.png
│ └── demo3.png
│ └── mrz_barcode
│ ├── demo1.png
│ └── demo2.png
├── python
├── check_credit.py
├── check_id.py
├── check_mrz.py
└── test_image
│ ├── bank_card_image.png
│ ├── id_image.jpg
│ └── mrz_image.png
└── requirements.txt
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
ID Document Recognition Linux SDK
3 |

5 |
6 |
7 | ## Welcome to the [MiniAiLive](https://www.miniai.live/)!
8 | Welcome to the ID Document Recognition SDK! This SDK provides powerful tools for recognizing and extracting information from ID documents. The SDK is available for both Windows and Linux platforms and includes an API for integration.
9 |
10 | Reduce drop-off and boost conversions with ID scanning and verification solutions. Quickly and securely capture, extract, and verify data from diverse ID cards, passports, driver’s licenses, and other documents with our proven, AI-first approach. Designed to fit seamlessly together, our technology can be integrated as a fully-bundled identity document verification solution or as separate modules via developer-friendly mobile or server SDK. Try it out today!
11 |
12 | > **Note**
13 | >
14 | > - Our SDK is fully on-premise, processing all happens on hosting server and no data leaves server.
15 | > - 10,000+ document templates covering IDs issued in 200+ countries and territories.
16 | > - Support of 100+ languages and special characters via sophisticated neural networks.
17 |
18 | ## Table of Contents
19 |
20 | - [Installation Guide](#installation-guide)
21 | - [API Details](#api-details)
22 | - [Gradio Demo](#gradio-demo)
23 | - [Python Test API Example](#python-test-api-example)
24 |
25 | ## IDSDK Installation Guide
26 |
27 | ### Prerequisites
28 |
29 | - Python 3.6+
30 | - Linux
31 | - CPU: 2 cores or more
32 | - RAM: 8 GB or more
33 |
34 | ### Installation Steps
35 |
36 | 1. **Download the ID Document Recognition Linux Server Installer:**
37 |
38 | Download the Server installer for your operating system from the following link:
39 |
40 | [Download the On-premise Server Installer](https://drive.google.com/file/d/1NnZ-Ows3eI8O0TPTbJZcuIYUmVwXr-vV/view?usp=sharing)
41 |
42 | 2. **Install the On-premise Server:**
43 |
44 | Run the installer and follow the on-screen instructions to complete the installation. Go to the Download folder and run this command.
45 | ```sh
46 | $ cd Download
47 | $ sudo dpkg -i --force-overwrite MiniAiLive-IDSDK-LinuxServer.deb
48 | ```
49 |
50 |

51 |
52 | You can refer our Documentation here. https://docs.miniai.live
53 |
54 | 3. **Request License and Update:**
55 |
56 | You can generate the License Request file by using this command:
57 | ```sh
58 | $ cd /opt/miniai/dr-webapi
59 | $ sudo ./MiRequest request /home/ubuntu/Download/trial_key.miq
60 | ```
61 |
62 |

63 |
64 | Then you can see the license request file on your directory, and send it to us via email or WhatsApp. We will send the license based on your Unique Request file, then you can upload the license file to allow to use. Refer the below images.
65 |
66 | ```sh
67 | $ sudo ./MiRequest update /home/ubuntu/Download/trial_30.mis
68 | ```
69 |
70 |

71 |
72 |
73 | 4. **Verify Installation:**
74 |
75 | After installation, verify that the On-premise Server is correctly installed by using this command:
76 | ```sh
77 | $ systemctl list-units --state running
78 | ```
79 | If you can see 'Mini-drsvc.service', 'Mini-idsvc.service', the server has been installed successfully. Refer the below image.
80 |
81 |

82 |
83 |
84 | ## IDSDK API Details
85 |
86 | ### Endpoint
87 |
88 | - `POST http://127.0.0.1:8082/api/check_id` ID Document Recognition API
89 | - `POST http://127.0.0.1:8082/api/check_id_base64` ID Document Recognition API
90 |
91 | - `POST http://127.0.0.1:8082/api/check_credit` Bank & Credit Card Reader API
92 | - `POST http://127.0.0.1:8082/api/check_credit_base64` Bank & Credit Card Reader API
93 |
94 | - `POST http://127.0.0.1:8082/api/check_mrz` MRZ & Barcode Recognition API
95 | - `POST http://127.0.0.1:8082/api/check_mrz_base64` MRZ & Barcode Recognition API
96 |
97 | ### Request
98 |
99 | - **URL:** `http://127.0.0.1:8082/api/check_id`
100 | - **Method:** `POST`
101 | - **Form Data:**
102 | - `image`: The image file (PNG, JPG, etc.) to be analyzed. This should be provided as a file upload.
103 |
104 |
105 | - **URL:** `http://127.0.0.1:8082/api/check_id_base64`
106 | - **Method:** `POST`
107 | - **Raw Data:**
108 | - `JSON Format`:
109 | {
110 | "image": "--base64 image data here--"
111 | }
112 |
113 |
114 | ### Response
115 |
116 | The API returns a JSON object with the recognized details from the ID document. Here is an example response:
117 |
118 |

119 |
120 |
121 | ## Gradio Demo
122 |
123 | We have included a Gradio demo to showcase the capabilities of our ID Document Recognition SDK. Gradio is a Python library that allows you to quickly create user interfaces for machine learning models.
124 |
125 | ### How to Run the Gradio Demo
126 |
127 | 1. **Install Gradio:**
128 |
129 | First, you need to install Gradio. You can do this using pip:
130 |
131 | ```sh
132 | git clone https://github.com/MiniAiLive/ID-DocumentRecognition-Linux-SDK.git
133 | pip install -r requirement.txt
134 | cd gradio
135 | ```
136 | 2. **Run Gradio Demo:**
137 | ```sh
138 | python app.py
139 | ```
140 | ## Python Test API Example
141 |
142 | To help you get started with using the API, here is a comprehensive example of how to interact with the ID Document Recognition API using Python. You can use API with another language you want to use like C++, C#, Ruby, Java, Javascript, and more
143 |
144 | ### Prerequisites
145 |
146 | - Python 3.6+
147 | - `requests` library (you can install it using `pip install requests`)
148 |
149 | ### Example Script
150 |
151 | This example demonstrates how to send an image file to the API endpoint and process the response.
152 |
153 | ```python
154 | import requests
155 |
156 | # URL of the web API endpoint
157 | url = 'http://127.0.0.1:8082/api/check_id'
158 |
159 | # Path to the image file you want to send
160 | image_path = './test_image.jpg'
161 |
162 | # Read the image file and send it as form data
163 | files = {'image': open(image_path, 'rb')}
164 |
165 | try:
166 | # Send POST request
167 | response = requests.post(url, files=files)
168 |
169 | # Check if the request was successful
170 | if response.status_code == 200:
171 | print('Request was successful!')
172 | # Parse the JSON response
173 | response_data = response.json()
174 | print('Response Data:', response_data)
175 | else:
176 | print('Request failed with status code:', response.status_code)
177 | print('Response content:', response.text)
178 |
179 | except requests.exceptions.RequestException as e:
180 | print('An error occurred:', e)
181 | ```
182 |
183 |
184 | ## Request license
185 | Feel free to [Contact US](https://www.miniai.live/contact/) to get a trial License. We are 24/7 online on [WhatsApp](https://wa.me/+19162702374).
186 |
187 |
188 | ## Face & IDSDK Online Demo, Resources
189 |
203 |
204 | ## Our Products
205 |
206 | ### Face Recognition SDK
207 | | No | Project | Features |
208 | |----|---------|-----------|
209 | | 1 | [FaceRecognition-SDK-Docker](https://github.com/MiniAiLive/FaceRecognition-SDK-Docker) | 1:1 & 1:N Face Matching SDK |
210 | | 2 | [FaceRecognition-SDK-Windows](https://github.com/MiniAiLive/FaceRecognition-SDK-Windows) | 1:1 & 1:N Face Matching SDK |
211 | | 3 | [FaceRecognition-SDK-Linux](https://github.com/MiniAiLive/FaceRecognition-SDK-Linux) | 1:1 & 1:N Face Matching SDK |
212 | | 4 | [FaceRecognition-LivenessDetection-SDK-Android](https://github.com/MiniAiLive/FaceRecognition-LivenessDetection-SDK-Android) | 1:1 & 1:N Face Matching, 2D & 3D Face Passive Liveness Detection SDK |
213 | | 5 | [FaceRecognition-LivenessDetection-SDK-iOS](https://github.com/MiniAiLive/FaceRecognition-LivenessDetection-SDK-iOS) | 1:1 & 1:N Face Matching, 2D & 3D Face Passive Liveness Detection SDK |
214 | | 6 | [FaceRecognition-LivenessDetection-SDK-CPP](https://github.com/MiniAiLive/FaceRecognition-LivenessDetection-SDK-CPP) | 1:1 & 1:N Face Matching, 2D & 3D Face Passive Liveness Detection SDK |
215 | | 7 | [FaceMatching-SDK-Android](https://github.com/MiniAiLive/FaceMatching-SDK-Android) | 1:1 Face Matching SDK |
216 | | 8 | [FaceAttributes-SDK-Android](https://github.com/MiniAiLive/FaceAttributes-SDK-Android) | Face Attributes, Age & Gender Estimation SDK |
217 |
218 | ### Face Liveness Detection SDK
219 | | No | Project | Features |
220 | |----|---------|-----------|
221 | | 1 | [FaceLivenessDetection-SDK-Docker](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Docker) | 2D & 3D Face Passive Liveness Detection SDK |
222 | | 2 | [FaceLivenessDetection-SDK-Windows](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Windows) | 2D & 3D Face Passive Liveness Detection SDK |
223 | | 3 | [FaceLivenessDetection-SDK-Linux](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Linux) | 2D & 3D Face Passive Liveness Detection SDK |
224 | | 4 | [FaceLivenessDetection-SDK-Android](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Android) | 2D & 3D Face Passive Liveness Detection SDK |
225 | | 5 | [FaceLivenessDetection-SDK-iOS](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-iOS) | 2D & 3D Face Passive Liveness Detection SDK |
226 |
227 | ### ID Document Recognition SDK
228 | | No | Project | Features |
229 | |----|---------|-----------|
230 | | 1 | [ID-DocumentRecognition-SDK-Docker](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
231 | | 2 | [ID-DocumentRecognition-SDK-Windows](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Windows) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
232 | | 3 | [ID-DocumentRecognition-SDK-Linux](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
233 | | 4 | [ID-DocumentRecognition-SDK-Android](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Android) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
234 |
235 | ### ID Document Liveness Detection SDK
236 | | No | Project | Features |
237 | |----|---------|-----------|
238 | | 1 | [ID-DocumentLivenessDetection-SDK-Docker](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Docker) | ID Document Liveness Detection SDK |
239 | | 2 | [ID-DocumentLivenessDetection-SDK-Windows](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Windows) | ID Document Liveness Detection SDK |
240 | | 3 | [ID-DocumentLivenessDetection-SDK-Linux](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Linux) | ID Document Liveness Detection SDK |
241 |
242 | ### Web & Desktop Demo
243 | | No | Project | Features |
244 | |----|---------|-----------|
245 | | 1 | [FaceRecognition-IDRecognition-Playground-Next.JS](https://github.com/MiniAiLive/FaceRecognition-IDRecognition-Playground-Next.JS) | FaceSDK & IDSDK Playground |
246 | | 2 | [FaceCapture-LivenessDetection-Next.JS](https://github.com/MiniAiLive/FaceCapture-LivenessDetection-Next.JS) | Face Capture, Face LivenessDetection, Face Attributes |
247 | | 3 | [FaceMatching-Windows-App](https://github.com/MiniAiLive/FaceMatching-Windows-App) | 1:1 Face Matching Windows Demo Application |
248 |
249 | ## About MiniAiLive
250 | [MiniAiLive](https://www.miniai.live/) is a leading AI solutions company specializing in computer vision and machine learning technologies. We provide cutting-edge solutions for various industries, leveraging the power of AI to drive innovation and efficiency.
251 |
252 | ## Contact US
253 | For any inquiries or questions, please contact us on [WhatsApp](https://wa.me/+19162702374).
254 |
255 |
256 |
257 |
258 |
259 |
--------------------------------------------------------------------------------
/gradio/app.py:
--------------------------------------------------------------------------------
1 | import gradio as gr
2 | import os
3 | import requests
4 |
5 | def id_check(frame):
6 | url = "http://127.0.0.1:8082/api/check_id"
7 | files = {'image': open(frame, 'rb')}
8 | r = requests.post(url=url, files=files)
9 |
10 | html = None
11 | images = None
12 | mrz = None
13 |
14 | table_value = ""
15 |
16 | if r.json().get('MRZ') is not None:
17 | mrz = r.json().get('MRZ')
18 |
19 | for key, value in r.json().items():
20 | if key == 'Status' or key == 'Images' or key == 'MRZ' or key == 'Position':
21 | continue
22 |
23 | mrz_value = ''
24 | if mrz is not None and mrz.get(key) is not None:
25 | mrz_value = mrz[key]
26 | del mrz[key]
27 |
28 | row_value = (""
29 | "{key} | "
30 | "{value} | "
31 | "{mrz_value} | "
32 | "
".format(key=key, value=value, mrz_value=mrz_value))
33 | table_value = table_value + row_value
34 |
35 |
36 | if mrz is not None:
37 | for key, value in mrz.items():
38 | if key == 'MRZ':
39 | value = value.replace('<', '<')
40 | value = value.replace(',', '')
41 |
42 | row_value = ("
"
43 | "{key} | "
44 | "{value} | "
45 | "{mrz_value} | "
46 | "
".format(key=key, value='', mrz_value=value))
47 | table_value = table_value + row_value
48 |
49 |
50 | html = (""
51 | ""
52 | "Field | "
53 | "Value | "
54 | "MRZ | "
55 | "
"
56 | "{table_value}"
57 | "
".format(table_value=table_value))
58 |
59 | table_value = ""
60 | for key, value in r.json().items():
61 | if key == 'Images':
62 | for image_key, image_value in value.items():
63 | row_value = (""
64 | "{key} | "
65 | "![]() | "
66 | "
".format(key=image_key, base64_image=image_value))
67 | table_value = table_value + row_value
68 |
69 | images = (""
70 | ""
71 | "Field | "
72 | "Image | "
73 | "
"
74 | "{table_value}"
75 | "
".format(table_value=table_value))
76 |
77 | return [html, images]
78 |
79 | def bank_credit_check(frame):
80 | url = 'http://127.0.0.1:8082/api/check_credit'
81 | files = {'image': open(frame, 'rb')}
82 | r = requests.post(url=url, files=files)
83 |
84 | html = None
85 | table_value = ""
86 |
87 | for key, value in r.json().items():
88 | if key == 'Status' or key == 'Images':
89 | continue
90 |
91 | row_value = (""
92 | "{key} | "
93 | "{value} | "
94 | "
".format(key=key, value=value))
95 | table_value = table_value + row_value
96 |
97 | html = (""
98 | ""
99 | "Field | "
100 | "Value | "
101 | "
"
102 | "{table_value}"
103 | "
".format(table_value=table_value))
104 |
105 | return html
106 |
107 | def mrz_barcode_check(frame):
108 | url = 'http://127.0.0.1:8082/api/check_mrz'
109 | files = {'image': open(frame, 'rb')}
110 | r = requests.post(url=url, files=files)
111 |
112 | html = None
113 | mrz = None
114 |
115 | table_value = ""
116 |
117 | if r.json().get('MRZ') is not None:
118 | mrz = r.json().get('MRZ')
119 |
120 | # Iterate through the MRZ data and print each key and item
121 | for key, value in mrz.items():
122 | if key == 'MRZ Code':
123 | value = value.replace('<', '<')
124 | value = value.replace(',', '')
125 | row_value = ("
"
126 | "{key} | "
127 | "{value} | "
128 | "
".format(key=key, value=value))
129 | table_value = table_value + row_value
130 |
131 | html = (""
132 | ""
133 | "Field | "
134 | "Value | "
135 | "
"
136 | "{table_value}"
137 | "
".format(table_value=table_value))
138 |
139 | return html
140 |
141 | # APP Interface
142 | with gr.Blocks() as MiniAIdemo:
143 | gr.Markdown(
144 | """
145 |
146 |
147 |
148 |
IDSDK Web Online Demo
149 |
150 |
151 |
152 |
153 |
159 |
160 | """
161 | )
162 | with gr.Tabs():
163 | with gr.TabItem("ID Card Recognition"):
164 | with gr.Row():
165 | with gr.Column(scale=3):
166 | im_id_input = gr.Image(type='filepath', height=300)
167 | gr.Examples(
168 | [
169 | os.path.join(os.path.dirname(__file__), "images/id/demo1.jpg"),
170 | os.path.join(os.path.dirname(__file__), "images/id/demo2.png"),
171 | os.path.join(os.path.dirname(__file__), "images/id/demo3.png"),
172 | ],
173 | inputs=im_id_input
174 | )
175 | btn_f_id = gr.Button("Analysis Document", variant='primary')
176 | with gr.Column(scale=5):
177 | txt_id_output = gr.HTML()
178 | with gr.Column(scale=2):
179 | im_id_output = gr.HTML()
180 | btn_f_id.click(id_check, inputs=im_id_input, outputs=[txt_id_output, im_id_output])
181 | with gr.TabItem("Bank & Credit Card Recognition"):
182 | with gr.Row():
183 | with gr.Column(scale=3):
184 | im_card_input = gr.Image(type='filepath', height=300)
185 | gr.Examples(
186 | [
187 | os.path.join(os.path.dirname(__file__), "images/band_credit_card/demo1.jpg"),
188 | os.path.join(os.path.dirname(__file__), "images/band_credit_card/demo2.png"),
189 | os.path.join(os.path.dirname(__file__), "images/band_credit_card/demo3.png"),
190 | ],
191 | inputs=im_card_input
192 | )
193 | btn_f_card = gr.Button("Analysis Document", variant='primary')
194 | with gr.Column(scale=5):
195 | txt_card_output = gr.HTML()
196 | btn_f_card.click(bank_credit_check, inputs=im_card_input, outputs=txt_card_output)
197 | with gr.TabItem("MRZ & Barcode Recognition"):
198 | with gr.Row():
199 | with gr.Column(scale=3):
200 | im_mrz_input = gr.Image(type='filepath', height=300)
201 | gr.Examples(
202 | [
203 | os.path.join(os.path.dirname(__file__), "images/mrz_barcode/demo1.png"),
204 | os.path.join(os.path.dirname(__file__), "images/mrz_barcode/demo2.png"),
205 | ],
206 | inputs=im_mrz_input
207 | )
208 | btn_f_mrz = gr.Button("Analysis Document", variant='primary')
209 | with gr.Column(scale=5):
210 | txt_mrz_output = gr.HTML()
211 | btn_f_mrz.click(mrz_barcode_check, inputs=im_mrz_input, outputs=txt_mrz_output)
212 |
213 | if __name__ == "__main__":
214 | MiniAIdemo.launch(server_port=8083, server_name="0.0.0.0")
--------------------------------------------------------------------------------
/gradio/images/band_credit_card/demo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/band_credit_card/demo1.jpg
--------------------------------------------------------------------------------
/gradio/images/band_credit_card/demo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/band_credit_card/demo2.png
--------------------------------------------------------------------------------
/gradio/images/band_credit_card/demo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/band_credit_card/demo3.png
--------------------------------------------------------------------------------
/gradio/images/id/demo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/id/demo1.jpg
--------------------------------------------------------------------------------
/gradio/images/id/demo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/id/demo2.png
--------------------------------------------------------------------------------
/gradio/images/id/demo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/id/demo3.png
--------------------------------------------------------------------------------
/gradio/images/mrz_barcode/demo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/mrz_barcode/demo1.png
--------------------------------------------------------------------------------
/gradio/images/mrz_barcode/demo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/gradio/images/mrz_barcode/demo2.png
--------------------------------------------------------------------------------
/python/check_credit.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | # URL of the API endpoint
4 | url = 'http://127.0.0.1:8082/api/check_credit'
5 |
6 | # Path to the image file you want to send
7 | image_path = './test_image/bank_card_image.png'
8 |
9 | # Read the image file and encode it as a base64 string
10 | files = {'image': open(image_path, 'rb')}
11 |
12 | try:
13 | # Send POST request
14 | response = requests.post(url, files=files)
15 |
16 | # Check if the request was successful
17 | if response.status_code == 200:
18 | print('Request was successful!')
19 | # Parse the JSON response
20 | response_data = response.content
21 | print('Response Data :', response_data)
22 | else:
23 | print('Request failed with status code:', response.status_code)
24 | print('Response content:', response.text)
25 |
26 | except requests.exceptions.RequestException as e:
27 | print('An error occurred:', e)
28 |
--------------------------------------------------------------------------------
/python/check_id.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | # URL of the API endpoint
4 | url = 'http://127.0.0.1:8082/api/check_id'
5 |
6 | # Path to the image file you want to send
7 | image_path = './test_image/id_image.jpg'
8 |
9 | # Read the image file and encode it as a base64 string
10 | files = {'image': open(image_path, 'rb')}
11 |
12 | try:
13 | # Send POST request
14 | response = requests.post(url, files=files)
15 |
16 | # Check if the request was successful
17 | if response.status_code == 200:
18 | print('Request was successful!')
19 | # Parse the JSON response
20 | response_data = response.content
21 | print('Response Data :', response_data)
22 | else:
23 | print('Request failed with status code:', response.status_code)
24 | print('Response content:', response.text)
25 |
26 | except requests.exceptions.RequestException as e:
27 | print('An error occurred:', e)
28 |
--------------------------------------------------------------------------------
/python/check_mrz.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | # URL of the API endpoint
4 | url = 'http://127.0.0.1:8082/api/check_mrz'
5 |
6 | # Path to the image file you want to send
7 | image_path = './test_image/mrz_image.png'
8 |
9 | # Read the image file and encode it as a base64 string
10 | files = {'image': open(image_path, 'rb')}
11 |
12 | try:
13 | # Send POST request
14 | response = requests.post(url, files=files)
15 |
16 | # Check if the request was successful
17 | if response.status_code == 200:
18 | print('Request was successful!')
19 | # Parse the JSON response
20 | response_data = response.content
21 | print('Response Data :', response_data)
22 | else:
23 | print('Request failed with status code:', response.status_code)
24 | print('Response content:', response.text)
25 |
26 | except requests.exceptions.RequestException as e:
27 | print('An error occurred:', e)
28 |
--------------------------------------------------------------------------------
/python/test_image/bank_card_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/python/test_image/bank_card_image.png
--------------------------------------------------------------------------------
/python/test_image/id_image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/python/test_image/id_image.jpg
--------------------------------------------------------------------------------
/python/test_image/mrz_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux/21f9048070dff2668fcd02d2de540cc90a38d2c8/python/test_image/mrz_image.png
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | gradio
2 | requests
--------------------------------------------------------------------------------