├── requirements.txt
├── gradio
├── images
│ └── demo1.jpg
└── app.py
├── python
├── test_image
│ └── id_image.jpg
└── check_id_liveness.py
└── README.md
/requirements.txt:
--------------------------------------------------------------------------------
1 | gradio
2 | requests
--------------------------------------------------------------------------------
/gradio/images/demo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Windows/HEAD/gradio/images/demo1.jpg
--------------------------------------------------------------------------------
/python/test_image/id_image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Windows/HEAD/python/test_image/id_image.jpg
--------------------------------------------------------------------------------
/python/check_id_liveness.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | # URL of the API endpoint
4 | url = 'http://127.0.0.1:8093/api/check_id_liveness'
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 |
--------------------------------------------------------------------------------
/gradio/app.py:
--------------------------------------------------------------------------------
1 | import gradio as gr
2 | import os
3 | import requests
4 | import json
5 |
6 | def check_id_liveness(frame):
7 | url = "http://127.0.0.1:8093/api/check_id_liveness"
8 | files = {'image': open(frame, 'rb')}
9 | try:
10 | r = requests.post(url=url, files=files)
11 | r.raise_for_status()
12 | return json.dumps(r.json(), indent=2)
13 | except requests.exceptions.RequestException as e:
14 | return str(e)
15 |
16 | # APP Interface
17 | with gr.Blocks() as MiniAIdemo:
18 | gr.Markdown(
19 | """
20 |
21 |
22 |
23 |
ID Document Liveness Detection Web Online Demo
24 |
25 |
26 |
27 |
28 |
34 |
35 | """
36 | )
37 | with gr.Tabs():
38 | with gr.TabItem("ID Document Liveness Detection"):
39 | with gr.Row():
40 | with gr.Column():
41 | im_idlive_input = gr.Image(type='filepath', height=300)
42 | gr.Examples(
43 | [
44 | os.path.join(os.path.dirname(__file__), "images/demo1.jpg"),
45 | ],
46 | inputs=im_idlive_input
47 | )
48 | btn_f_idlive = gr.Button("Analysis Document", variant='primary')
49 | with gr.Column():
50 | txt_idlive_output = gr.Textbox(label="API Response (JSON)")
51 | btn_f_idlive.click(check_id_liveness, inputs=im_idlive_input, outputs=txt_idlive_output)
52 |
53 | if __name__ == "__main__":
54 | MiniAIdemo.launch(server_port=8083, server_name="0.0.0.0")
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
ID Document Liveness Detection Windows SDK
3 |

5 |
6 |
7 | ## Welcome to the [MiniAiLive](https://www.miniai.live/)!
8 | Welcome to the ID Document Liveness Detection SDK! MiniAiLive's Complete Document Liveness Detection Solution for Digital Onboarding here!
9 | With 70% of fraud in digital onboarding and KYC happening with document fraud—or document presentation attacks—identity verification is a critical line of defense against the financial and reputational damage of document fraud. That’s where document liveness detection software comes in. It detects when an identity document is not genuine but instead a document presentation attack.
10 | With our product suite, you can address the three most common presentation attacks universally across all the common types of identity documents anywhere in the world without needing to train on document templates.
11 | Try it out today!
12 |
13 | > **Note**
14 | > - Our SDK is fully on-premise, processing all happens on hosting server and no data leaves server.
15 |
16 | ## Table of Contents
17 |
18 | - [Installation Guide](#installation-guide)
19 | - [API Details](#api-details)
20 | - [Gradio Demo](#gradio-demo)
21 | - [Python Test API Example](#python-test-api-example)
22 |
23 | ## ID-LivenessSDK Installation Guide
24 |
25 | ### Prerequisites
26 |
27 | - Python 3.6+
28 | - Windows
29 | - CPU: 2 cores or more
30 | - RAM: 8 GB or more
31 |
32 | ### Installation Steps
33 |
34 | 1. **Download the ID Document Liveness Detection Windows Server Installer:**
35 |
36 | Download the Server installer for your operating system from the following link:
37 |
38 | [Download the On-premise Server Installer](https://drive.google.com/file/d/1V782NK-n2KM-LQn-hmE0p1bW1zG2BzmK/view?usp=sharing)
39 |
40 | 2. **Install the On-premise Server:**
41 |
42 | Run the installer and follow the on-screen instructions to complete the installation.
43 |
44 |

45 |
46 |
47 | 3. **Request License and Update:**
48 |
49 | Run MIRequest.exe file to generate a license request file. You can find it here.
50 |
51 | > CC:\Users\Dev-1\AppData\Local\MiniAiLive\MiniAiLive-IDLiveness-WinServer
52 |
53 | Open it, generate a license request file, 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.
54 |
60 |
61 | 4. **Verify Installation:**
62 |
63 | After installation, verify that the On-premise Server is correctly installed by checking the task manager:
64 |
65 |

66 |
67 |
68 | ## ID-LivenessSDK API Details
69 |
70 | ### Endpoint
71 |
72 | - `POST http://127.0.0.1:8093/api/check_id_liveness` ID Document Liveness Detection API
73 | - `POST http://127.0.0.1:8093/api/check_id_liveness_base64` ID Document Liveness Detection API
74 |
75 | ### Request
76 |
77 | - **URL:** `http://127.0.0.1:8093/api/check_id_liveness`
78 | - **Method:** `POST`
79 | - **Form Data:**
80 | - `image`: The image file (PNG, JPG, etc.) to be analyzed. This should be provided as a file upload.
81 |
82 |
83 | - **URL:** `http://127.0.0.1:8093/api/check_id_liveness_base64`
84 | - **Method:** `POST`
85 | - **Raw Data:**
86 | - `JSON Format`:
87 | {
88 | "image": "--base64 image data here--"
89 | }
90 |
91 |
92 | ### Response
93 |
94 | The API returns a JSON object with the ID document liveness detection details. Here is an example response:
95 |
96 |

97 |
98 |
99 | ## Gradio Demo
100 |
101 | We have included a Gradio demo to showcase the capabilities of our ID Document Liveness Detection SDK. Gradio is a Python library that allows you to quickly create user interfaces for machine learning models.
102 |
103 | ### How to Run the Gradio Demo
104 |
105 | 1. **Install Gradio:**
106 |
107 | First, you need to install Gradio. You can do this using pip:
108 |
109 | ```sh
110 | git clone https://github.com/MiniAiLive/ID-DocumentLivenessDetection-Windows-SDK.git
111 | pip install -r requirement.txt
112 | cd gradio
113 | ```
114 | 2. **Run Gradio Demo:**
115 | ```sh
116 | python app.py
117 | ```
118 | ## Python Test API Example
119 |
120 | To help you get started with using the API, here is a comprehensive example of how to interact with the ID Document Liveness Detection API using Python. You can use API with another language you want to use like C++, C#, Ruby, Java, Javascript, and more
121 |
122 | ### Prerequisites
123 |
124 | - Python 3.6+
125 | - `requests` library (you can install it using `pip install requests`)
126 |
127 | ### Example Script
128 |
129 | This example demonstrates how to send an image file to the API endpoint and process the response.
130 |
131 | ```python
132 | import requests
133 |
134 | # URL of the web API endpoint
135 | url = 'http://127.0.0.1:8093/api/check_id_liveness'
136 |
137 | # Path to the image file you want to send
138 | image_path = './test_image.jpg'
139 |
140 | # Read the image file and send it as form data
141 | files = {'image': open(image_path, 'rb')}
142 |
143 | try:
144 | # Send POST request
145 | response = requests.post(url, files=files)
146 |
147 | # Check if the request was successful
148 | if response.status_code == 200:
149 | print('Request was successful!')
150 | # Parse the JSON response
151 | response_data = response.json()
152 | print('Response Data:', response_data)
153 | else:
154 | print('Request failed with status code:', response.status_code)
155 | print('Response content:', response.text)
156 |
157 | except requests.exceptions.RequestException as e:
158 | print('An error occurred:', e)
159 | ```
160 |
161 | ## Request license
162 | 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).
163 |
164 |
165 | ## Face & IDSDK Online Demo, Resources
166 |
180 |
181 | ## Our Products
182 |
183 | ### Face Recognition SDK
184 | | No | Project | Features |
185 | |----|---------|-----------|
186 | | 1 | [FaceRecognition-SDK-Docker](https://github.com/MiniAiLive/FaceRecognition-SDK-Docker) | 1:1 & 1:N Face Matching SDK |
187 | | 2 | [FaceRecognition-SDK-Windows](https://github.com/MiniAiLive/FaceRecognition-SDK-Windows) | 1:1 & 1:N Face Matching SDK |
188 | | 3 | [FaceRecognition-SDK-Linux](https://github.com/MiniAiLive/FaceRecognition-SDK-Linux) | 1:1 & 1:N Face Matching SDK |
189 | | 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 |
190 | | 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 |
191 | | 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 |
192 | | 7 | [FaceMatching-SDK-Android](https://github.com/MiniAiLive/FaceMatching-SDK-Android) | 1:1 Face Matching SDK |
193 | | 8 | [FaceAttributes-SDK-Android](https://github.com/MiniAiLive/FaceAttributes-SDK-Android) | Face Attributes, Age & Gender Estimation SDK |
194 |
195 | ### Face Liveness Detection SDK
196 | | No | Project | Features |
197 | |----|---------|-----------|
198 | | 1 | [FaceLivenessDetection-SDK-Docker](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Docker) | 2D & 3D Face Passive Liveness Detection SDK |
199 | | 2 | [FaceLivenessDetection-SDK-Windows](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Windows) | 2D & 3D Face Passive Liveness Detection SDK |
200 | | 3 | [FaceLivenessDetection-SDK-Linux](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Linux) | 2D & 3D Face Passive Liveness Detection SDK |
201 | | 4 | [FaceLivenessDetection-SDK-Android](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-Android) | 2D & 3D Face Passive Liveness Detection SDK |
202 | | 5 | [FaceLivenessDetection-SDK-iOS](https://github.com/MiniAiLive/FaceLivenessDetection-SDK-iOS) | 2D & 3D Face Passive Liveness Detection SDK |
203 |
204 | ### ID Document Recognition SDK
205 | | No | Project | Features |
206 | |----|---------|-----------|
207 | | 1 | [ID-DocumentRecognition-SDK-Docker](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Docker) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
208 | | 2 | [ID-DocumentRecognition-SDK-Windows](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Windows) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
209 | | 3 | [ID-DocumentRecognition-SDK-Linux](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Linux) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
210 | | 4 | [ID-DocumentRecognition-SDK-Android](https://github.com/MiniAiLive/ID-DocumentRecognition-SDK-Android) | ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK |
211 |
212 | ### ID Document Liveness Detection SDK
213 | | No | Project | Features |
214 | |----|---------|-----------|
215 | | 1 | [ID-DocumentLivenessDetection-SDK-Docker](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Docker) | ID Document Liveness Detection SDK |
216 | | 2 | [ID-DocumentLivenessDetection-SDK-Windows](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Windows) | ID Document Liveness Detection SDK |
217 | | 3 | [ID-DocumentLivenessDetection-SDK-Linux](https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Linux) | ID Document Liveness Detection SDK |
218 |
219 | ### Web & Desktop Demo
220 | | No | Project | Features |
221 | |----|---------|-----------|
222 | | 1 | [FaceRecognition-IDRecognition-Playground-Next.JS](https://github.com/MiniAiLive/FaceRecognition-IDRecognition-Playground-Next.JS) | FaceSDK & IDSDK Playground |
223 | | 2 | [FaceCapture-LivenessDetection-Next.JS](https://github.com/MiniAiLive/FaceCapture-LivenessDetection-Next.JS) | Face Capture, Face LivenessDetection, Face Attributes |
224 | | 3 | [FaceMatching-Windows-App](https://github.com/MiniAiLive/FaceMatching-Windows-App) | 1:1 Face Matching Windows Demo Application |
225 |
226 | ## About MiniAiLive
227 | [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.
228 |
229 | ## Contact US
230 | For any inquiries or questions, please contact us on [WhatsApp](https://wa.me/+19162702374).
231 |
232 |
233 |
234 |
235 |
236 |
--------------------------------------------------------------------------------