├── MiRequest_IDSDK ├── 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 /MiRequest_IDSDK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/MiRequest_IDSDK -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

ID Document Recognition Docker

3 | MiniAiLive Logo 5 |
6 | 7 | ## Welcome to the [MiniAiLive](https://www.miniai.live/)! 8 | Welcome to the ID Document Recognition Docker! This Docker provides powerful tools for recognizing and extracting information from ID documents. The Docker 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. 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 Docker 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 Docker Image:** 37 | 38 | Download the Server Docker Image from the following link: 39 | 40 | [Download the On-premise Server Installer](https://drive.google.com/file/d/118nH7fPD7wm9y_eeFCafoqW2GqNkHUoV/view?usp=sharing) 41 | 42 | 2. **Install the On-premise Docker Server:** 43 | 44 | Run the Docker Image 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 docker load -i MiniAiLive-IDSDK-DockerImg.tar 48 | ``` 49 |
50 | MiniAiLive Installer 51 |
52 | 53 | You can refer our Documentation here. https://docs.miniai.live 54 | 55 | 3. **Request License and Update:** 56 | 57 | You can generate the License Request file by using this command: 58 | ```sh 59 | $ sudo chmod 777 ./MiRequest_IDSDK 60 | $ sudo ./MiRequest_IDSDK request /home/ubuntu/Download/trial_key.miq 61 | ``` 62 |
63 | MiniAiLive Installer 64 |
65 | 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. 66 | 67 | ```sh 68 | $ sudo docker run -d --privileged -v /home/ubuntu/Downloads/trial_key.mis:/var/idsdk.license -p {your_port}:8082 mini-idsdk-server 69 | ``` 70 |
71 | MiniAiLive Installer 72 |
73 | 74 | 4. **Verify Installation:** 75 | 76 | After installation, verify that the On-premise Server is correctly installed by using this command: 77 | ```sh 78 | $ netstat -tnpl 79 | ``` 80 | If you can see opened your port correctly, the server has been installed successfully. Refer the below image. 81 |
82 | MiniAiLive Installer 83 |
84 | 85 | ## IDSDK API Details 86 | 87 | ### Endpoint 88 | 89 | - `POST http://127.0.0.1:8082/api/check_id` ID Document Recognition API 90 | - `POST http://127.0.0.1:8082/api/check_id_base64` ID Document Recognition API 91 | 92 | - `POST http://127.0.0.1:8082/api/check_credit` Bank & Credit Card Reader API 93 | - `POST http://127.0.0.1:8082/api/check_credit_base64` Bank & Credit Card Reader API 94 | 95 | - `POST http://127.0.0.1:8082/api/check_mrz` MRZ & Barcode Recognition API 96 | - `POST http://127.0.0.1:8082/api/check_mrz_base64` MRZ & Barcode Recognition API 97 | 98 | ### Request 99 | 100 | - **URL:** `http://127.0.0.1:8082/api/check_id` 101 | - **Method:** `POST` 102 | - **Form Data:** 103 | - `image`: The image file (PNG, JPG, etc.) to be analyzed. This should be provided as a file upload. 104 | Screenshot 2024-07-16 at 5 12 01 AM 105 | 106 | - **URL:** `http://127.0.0.1:8082/api/check_id_base64` 107 | - **Method:** `POST` 108 | - **Raw Data:** 109 | - `JSON Format`: 110 | { 111 | "image": "--base64 image data here--" 112 | } 113 | Screenshot 2024-07-16 at 5 11 34 AM 114 | 115 | ### Response 116 | 117 | The API returns a JSON object with the recognized details from the ID document. Here is an example response: 118 |
119 | 120 |
121 | 122 | ## Gradio Demo 123 | 124 | 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. 125 | 126 | ### How to Run the Gradio Demo 127 | 128 | 1. **Install Gradio:** 129 | 130 | First, you need to install Gradio. You can do this using pip: 131 | 132 | ```sh 133 | git clone https://github.com/MiniAiLive/ID-DocumentRecognition-Docker.git 134 | pip install -r requirement.txt 135 | cd gradio 136 | ``` 137 | 2. **Run Gradio Demo:** 138 | ```sh 139 | python app.py 140 | ``` 141 | ## Python Test API Example 142 | 143 | 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 144 | 145 | ### Prerequisites 146 | 147 | - Python 3.6+ 148 | - `requests` library (you can install it using `pip install requests`) 149 | 150 | ### Example Script 151 | 152 | This example demonstrates how to send an image file to the API endpoint and process the response. 153 | 154 | ```python 155 | import requests 156 | 157 | # URL of the web API endpoint 158 | url = 'http://127.0.0.1:8082/api/check_id' 159 | 160 | # Path to the image file you want to send 161 | image_path = './test_image.jpg' 162 | 163 | # Read the image file and send it as form data 164 | files = {'image': open(image_path, 'rb')} 165 | 166 | try: 167 | # Send POST request 168 | response = requests.post(url, files=files) 169 | 170 | # Check if the request was successful 171 | if response.status_code == 200: 172 | print('Request was successful!') 173 | # Parse the JSON response 174 | response_data = response.json() 175 | print('Response Data:', response_data) 176 | else: 177 | print('Request failed with status code:', response.status_code) 178 | print('Response content:', response.text) 179 | 180 | except requests.exceptions.RequestException as e: 181 | print('An error occurred:', e) 182 | ``` 183 | 184 | 185 | ## Request license 186 | 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). 187 | 188 | 189 | ## Face & IDSDK Online Demo, Resources 190 |
191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 |
203 |
204 | 205 | ## Our Products 206 | 207 | ### Face Recognition SDK 208 | | No | Project | Features | 209 | |----|---------|-----------| 210 | | 1 | [FaceRecognition-SDK-Docker](https://github.com/MiniAiLive/FaceRecognition-SDK-Docker) | 1:1 & 1:N Face Matching SDK | 211 | | 2 | [FaceRecognition-SDK-Windows](https://github.com/MiniAiLive/FaceRecognition-SDK-Windows) | 1:1 & 1:N Face Matching SDK | 212 | | 3 | [FaceRecognition-SDK-Linux](https://github.com/MiniAiLive/FaceRecognition-SDK-Linux) | 1:1 & 1:N Face Matching SDK | 213 | | 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 | 214 | | 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 | 215 | | 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 | 216 | | 7 | [FaceMatching-SDK-Android](https://github.com/MiniAiLive/FaceMatching-SDK-Android) | 1:1 Face Matching SDK | 217 | | 8 | [FaceAttributes-SDK-Android](https://github.com/MiniAiLive/FaceAttributes-SDK-Android) | Face Attributes, Age & Gender Estimation SDK | 218 | 219 | ### Face Liveness Detection SDK 220 | | No | Project | Features | 221 | |----|---------|-----------| 222 | | 1 | [FaceLivenessDetection-SDK-Docker](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Docker) | 2D & 3D Face Passive Liveness Detection SDK | 223 | | 2 | [FaceLivenessDetection-SDK-Windows](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Windows) | 2D & 3D Face Passive Liveness Detection SDK | 224 | | 3 | [FaceLivenessDetection-SDK-Linux](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Linux) | 2D & 3D Face Passive Liveness Detection SDK | 225 | | 4 | [FaceLivenessDetection-SDK-Android](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Android) | 2D & 3D Face Passive Liveness Detection SDK | 226 | | 5 | [FaceLivenessDetection-SDK-iOS](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-iOS) | 2D & 3D Face Passive Liveness Detection SDK | 227 | 228 | ### ID Document Recognition SDK 229 | | No | Project | Features | 230 | |----|---------|-----------| 231 | | 1 | [ID-DocumentRecognition-SDK-Docker](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK | 232 | | 2 | [ID-DocumentRecognition-SDK-Windows](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Windows) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK | 233 | | 3 | [ID-DocumentRecognition-SDK-Linux](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK | 234 | | 4 | [ID-DocumentRecognition-SDK-Android](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Android) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK | 235 | 236 | ### ID Document Liveness Detection SDK 237 | | No | Project | Features | 238 | |----|---------|-----------| 239 | | 1 | [ID-DocumentLivenessDetection-SDK-Docker](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Docker) | ID Document Liveness Detection SDK | 240 | | 2 | [ID-DocumentLivenessDetection-SDK-Windows](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Windows) | ID Document Liveness Detection SDK | 241 | | 3 | [ID-DocumentLivenessDetection-SDK-Linux](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Linux) | ID Document Liveness Detection SDK | 242 | 243 | ### Web & Desktop Demo 244 | | No | Project | Features | 245 | |----|---------|-----------| 246 | | 1 | [FaceRecognition-IDRecognition-Playground-Next.JS](https://github.com/MiniAiLive/FaceRecognition-IDRecognition-Playground-Next.JS) | FaceSDK & IDSDK Playground | 247 | | 2 | [FaceCapture-LivenessDetection-Next.JS](https://github.com/MiniAiLive/FaceCapture-LivenessDetection-Next.JS) | Face Capture, Face LivenessDetection, Face Attributes | 248 | | 3 | [FaceMatching-Windows-App](https://github.com/MiniAiLive/FaceMatching-Windows-App) | 1:1 Face Matching Windows Demo Application | 249 | 250 | ## About MiniAiLive 251 | [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. 252 | 253 | ## Contact US 254 | For any inquiries or questions, please contact us on [WhatsApp](https://wa.me/+19162702374). 255 | 256 |

257 | www.miniai.live  258 | www.miniai.live  259 |

260 | -------------------------------------------------------------------------------- /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 | "" 53 | "" 54 | "" 55 | "" 56 | "{table_value}" 57 | "
FieldValueMRZ
".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 | "" 72 | "" 73 | "" 74 | "{table_value}" 75 | "
FieldImage
".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 | "" 100 | "" 101 | "" 102 | "{table_value}" 103 | "
FieldValue
".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 | "" 134 | "" 135 | "" 136 | "{table_value}" 137 | "
FieldValue
".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-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/gradio/images/band_credit_card/demo1.jpg -------------------------------------------------------------------------------- /gradio/images/band_credit_card/demo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/gradio/images/band_credit_card/demo2.png -------------------------------------------------------------------------------- /gradio/images/band_credit_card/demo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/gradio/images/band_credit_card/demo3.png -------------------------------------------------------------------------------- /gradio/images/id/demo1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/gradio/images/id/demo1.jpg -------------------------------------------------------------------------------- /gradio/images/id/demo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/gradio/images/id/demo2.png -------------------------------------------------------------------------------- /gradio/images/id/demo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/gradio/images/id/demo3.png -------------------------------------------------------------------------------- /gradio/images/mrz_barcode/demo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/gradio/images/mrz_barcode/demo1.png -------------------------------------------------------------------------------- /gradio/images/mrz_barcode/demo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/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-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/python/test_image/bank_card_image.png -------------------------------------------------------------------------------- /python/test_image/id_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/python/test_image/id_image.jpg -------------------------------------------------------------------------------- /python/test_image/mrz_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker/06f6e77f1d61f0e347d713427ce291dbcdfbf4f5/python/test_image/mrz_image.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | gradio 2 | requests --------------------------------------------------------------------------------