Skip to content

MiniAiLive/ID-DocumentLivenessDetection-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ID Document Liveness Detection Docker

MiniAiLive Logo

Welcome to the MiniAiLive!

Welcome to the ID Document Liveness Detection Docker! MiniAiLive's Complete Document Liveness Detection Solution for Digital Onboarding here! 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. 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. Try it out today!

Note

  • Our SDK is fully on-premise, processing all happens on hosting server and no data leaves server.

Table of Contents

ID-LivenessSDK Docker Installation Guide

Prerequisites

  • Linux OS (Ubuntu recommended)
  • Python 3.6+
  • CPU: 2 cores or more
  • RAM: 8 GB or more
  • Docker installed (Install Docker)

Installation Steps

Step 1: Clone the Repository

git clone https://github.com/MiniAiLive/ID-DocumentLivenessDetection-SDK-Docker.git
cd ID-DocumentLivenessDetection-SDK-Docker

Step 2: Download the Docker Image from Google Drive

The Docker image is hosted on Google Drive. Use one of the following methods to download it.

File details:

  • Google Drive File ID: 1LOOg0otEIMZc7-08ePUxWmYfMwt-YamO
  • Expected filename: MiniAiLive-IDLiveSDK-DockerImg.tar

Method A — Browser Download (simplest):

  1. Click this link: Download On-premise Server Installer
  2. Click the Download button (top-right)
  3. If prompted "Google Drive can't scan this file for viruses", click Download anyway
  4. The file will be saved to your ~/Downloads folder

Method B — Command-line with gdown (recommended for servers):

Use the gdown Python tool — it handles Google Drive's large-file confirmation automatically.

# Install gdown
pip install gdown

# Download the file using the Google Drive file ID
gdown https://drive.google.com/uc?id=1LOOg0otEIMZc7-08ePUxWmYfMwt-YamO

# The file will be saved as MiniAiLive-IDLiveSDK-DockerImg.tar in the current directory

Method C — Command-line with wget (if gdown is unavailable):

# Requires Google Drive's confirmation cookie for large files
wget --load-cookies /tmp/cookies.txt \
  "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1LOOg0otEIMZc7-08ePUxWmYfMwt-YamO' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1LOOg0otEIMZc7-08ePUxWmYfMwt-YamO" \
  -O MiniAiLive-IDLiveSDK-DockerImg.tar && rm -rf /tmp/cookies.txt

Step 3: Load the Docker Image

Navigate to your download folder and load the Docker image:

cd ~/Downloads
sudo docker load -i MiniAiLive-IDLiveSDK-DockerImg.tar
Docker Load

You can refer to our documentation at https://docs.miniai.live

Step 4: Request a License

Generate a License Request file using the MiRequest_IDLiveSDK binary (located in the cloned repo):

cd ~/ID-DocumentLivenessDetection-SDK-Docker
sudo chmod 777 ./MiRequest_IDLiveSDK
sudo ./MiRequest_IDLiveSDK request /home/ubuntu/Downloads/trial_key.miq
License Request

This creates a license request file (trial_key.miq). Send it to us via email or WhatsApp. We will send you the license file (.mis) based on your unique request.

Step 5: Run the Server

Install chrony (time synchronization) and start the server with your license file:

sudo apt update
sudo apt install chrony -y
sudo chmod 777 ./run_idliveness_docker
sudo ./run_idliveness_docker /home/ubuntu/Downloads/trial_key.mis 8093 mini-idlivesdk-server
Run Server

Step 6: Verify Installation

Check that the server is running and listening on the expected port:

sudo netstat -tnpl

You should see port 8093 listed. If so, the server has been installed and started successfully.

Verify Port

ID-LivenessSDK API Details

Endpoint

  • POST http://127.0.0.1:8093/api/check_id_liveness — ID Document Liveness Detection (file upload)
  • POST http://127.0.0.1:8093/api/check_id_liveness_base64 — ID Document Liveness Detection (base64)

Request

  • URL: http://127.0.0.1:8093/api/check_id_liveness
  • Method: POST
  • Form Data:
    • image: The image file (PNG, JPG, etc.) to be analyzed. Provided as a file upload.
API file upload
  • URL: http://127.0.0.1:8093/api/check_id_liveness_base64
  • Method: POST
  • Raw Data (JSON):
    {
       "image": "--base64 image data here--"
    }
API base64

Response

The API returns a JSON object with the ID document liveness detection details. Example:

Gradio Demo

We include a Gradio demo to showcase the ID Document Liveness Detection SDK.

How to Run the Gradio Demo

  1. Install Python dependencies (from the cloned repo root):

    pip install -r requirements.txt
  2. Run the Gradio app:

    cd gradio
    python app.py
  3. Open your browser to http://127.0.0.1:8083 and upload an ID document image to test.

Python Test API Example

Here is a Python script to interact with the API. You can adapt it to other languages (C++, C#, Ruby, Java, JavaScript, etc.).

Prerequisites

  • Python 3.6+
  • requests library (pip install requests)

Example Script

import requests

# URL of the API endpoint
url = 'http://127.0.0.1:8093/api/check_id_liveness'

# Path to the image file you want to send
image_path = './test_image/id_image.jpg'

# Read the image file and send it as form data
files = {'image': open(image_path, 'rb')}

try:
    # Send POST request
    response = requests.post(url, files=files)

    # Check if the request was successful
    if response.status_code == 200:
        print('Request was successful!')
        # Parse the JSON response
        response_data = response.content
        print('Response Data:', response_data)
    else:
        print('Request failed with status code:', response.status_code)
        print('Response content:', response.text)

except requests.exceptions.RequestException as e:
    print('An error occurred:', e)

Run it from the python/ directory:

cd python
python check_id_liveness.py

Request license

Feel free to Contact US to get a trial License. We are 24/7 online on WhatsApp.

Face & IDSDK Online Demo, Resources

Our Products

Face Recognition SDK

No Project Features
1 FaceRecognition-SDK-Docker 1:1 & 1:N Face Matching SDK
2 FaceRecognition-SDK-Windows 1:1 & 1:N Face Matching SDK
3 FaceRecognition-SDK-Linux 1:1 & 1:N Face Matching SDK
4 FaceRecognition-LivenessDetection-SDK-Android 1:1 & 1:N Face Matching, 2D & 3D Face Passive Liveness Detection SDK
5 FaceRecognition-LivenessDetection-SDK-iOS 1:1 & 1:N Face Matching, 2D & 3D Face Passive Liveness Detection SDK
6 FaceRecognition-LivenessDetection-SDK-CPP 1:1 & 1:N Face Matching, 2D & 3D Face Passive Liveness Detection SDK
7 FaceMatching-SDK-Android 1:1 Face Matching SDK
8 FaceAttributes-SDK-Android Face Attributes, Age & Gender Estimation SDK

Face Liveness Detection SDK

No Project Features
1 FaceLivenessDetection-SDK-Docker 2D & 3D Face Passive Liveness Detection SDK
2 FaceLivenessDetection-SDK-Windows 2D & 3D Face Passive Liveness Detection SDK
3 FaceLivenessDetection-SDK-Linux 2D & 3D Face Passive Liveness Detection SDK
4 FaceLivenessDetection-SDK-Android 2D & 3D Face Passive Liveness Detection SDK
5 FaceLivenessDetection-SDK-iOS 2D & 3D Face Passive Liveness Detection SDK

ID Document Recognition SDK

No Project Features
1 ID-DocumentRecognition-SDK-Docker ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK
2 ID-DocumentRecognition-SDK-Windows ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK
3 ID-DocumentRecognition-SDK-Linux ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK
4 ID-DocumentRecognition-SDK-Android ID Document, Passport, Driver License, Credit Card, MRZ Recognition SDK

ID Document Liveness Detection SDK

No Project Features
1 ID-DocumentLivenessDetection-SDK-Docker ID Document Liveness Detection SDK
2 ID-DocumentLivenessDetection-SDK-Windows ID Document Liveness Detection SDK
3 ID-DocumentLivenessDetection-SDK-Linux ID Document Liveness Detection SDK

Web & Desktop Demo

No Project Features
1 FaceRecognition-IDRecognition-Playground-Next.JS FaceSDK & IDSDK Playground
2 FaceCapture-LivenessDetection-Next.JS Face Capture, Face LivenessDetection, Face Attributes
3 FaceMatching-Windows-App 1:1 Face Matching Windows Demo Application

About MiniAiLive

MiniAiLive 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.

Contact US

For any inquiries or questions, please contact us on WhatsApp.

www.miniai.livewww.miniai.live