> For the complete documentation index, see [llms.txt](https://docs.kby-ai.com/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kby-ai.com/help/demo-projects/server-windows-linux/idcardrecognition-docker.md).

# IDCardRecognition - Docker

This stands for ID card scanner, ID document reader, ID card reader, ID document recognition, passport scanner, ID scanner, MRZ parser, barcode reader, barcode scan, MRZ scan on Linux server.

## Overview

The demo project demonstrates the server-based recognition capabilities for `ID cards`, `passports`, and `driver's licenses`.

This stands for `ID card scanner server`, `ID document reader server`, `ID card reader server`, `ID document recognition server`, `passport scanner server`, `ID scanner server`, `MRZ parser server`, `barcode reader server`, `barcode scan server`, `MRZ scan server` in `python` language on `Linux` server

## SDK

{% content-ref url="/pages/WR4b2DFcMk2RMAS4VMne" %}
[ID Card Recognition SDK - Server](/help/product/id-card-recognition-sdk/id-card-recognition-sdk-server.md)
{% endcontent-ref %}

## Github

{% embed url="<https://github.com/kby-ai/IDCardRecognition-Docker>" %}

## dockerhub

{% embed url="<https://hub.docker.com/r/kbyai/idcard-recognition>" %}

## Test Online

{% embed url="<https://web.kby-ai.com/>" %}

<figure><img src="https://2589216230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WwtQK0VFwKRGmIjGA3I%2Fuploads%2FhaDNKHMXUDT6pj2NX47y%2Fimage.png?alt=media&amp;token=f5cdb3e8-31f9-4441-9874-d291c39c8a50" alt=""><figcaption></figcaption></figure>

## Postman

To test the `API`, you can use `Postman`. Here are the `endpoints` for testing:

* Test with an image file: Send a `POST` request to <http://18.221.33.238:8082/idcard_recognition>
* Test with a `base64-encoded` image: Send a `POST` request to [ http://18.221.33.238:8082/idcard\_recognition\_base64](< http://18.221.33.238:8082/idcard_recognition_base64>)
* You can download the `Postman` collection to easily access and use these `endpoints`. [click here](https://github.com/kby-ai/IDCardRecognition-Docker/tree/main/postman/kby-ai-idcard.postman_collection.json)

<figure><img src="https://2589216230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WwtQK0VFwKRGmIjGA3I%2Fuploads%2FW4xVAvILhlTCAITnnyrK%2Fimage.png?alt=media&amp;token=65a2e91e-6c1b-416a-9b16-2a55b19dd7a7" alt=""><figcaption></figcaption></figure>

## How to Run

### 1. System Requirements

**`CPU`:** 2 cores or more (Recommended: 2 cores)&#x20;

**`RAM`:** 4 GB or more (Recommended: 8 GB)&#x20;

**`HDD`:** 4 GB or more (Recommended: 8 GB)&#x20;

**`OS`:** Ubuntu 20.04 or later&#x20;

### 2. Setup and Test

* Clone the project:

```bash
git clone https://github.com/kby-ai/IDCardRecognition-Docker.git
```

* Download the model from `Google Drive` and unzip it: [click here](https://drive.google.com/file/d/19vA7ZOlo19BcW8v4iCoCGahUEbgKCo48/view?usp=sharing)

```bash
cd IDCardRecognition-Docker

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=1fmTUG7a9IoMA8QiXR9A0xf3Cr6D5UkdC' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1fmTUG7a9IoMA8QiXR9A0xf3Cr6D5UkdC" -O data.zip && rm -rf /tmp/cookies.txt

unzip data.zip
```

* Build the `Docker` image:

```bash
sudo docker build --pull --rm -f Dockerfile -t kby-ai-idcard:latest .
```

* Run the `Docker` container:

```bash
sudo docker run -v ./license.txt:/root/kby-ai-idcard/license.txt -p 8082:8080 kby-ai-idcard
```

* Send us the `machine code` and replace the `license.txt` file you received. Then, run the `Docker` container again.

<figure><img src="https://2589216230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WwtQK0VFwKRGmIjGA3I%2Fuploads%2F9UHDdskmAmkPWGaBW9MZ%2Fimage.png?alt=media&amp;token=583ff3ff-779f-4ecc-bddf-a3b863cb571e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2589216230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WwtQK0VFwKRGmIjGA3I%2Fuploads%2FqWbM0GTKjcmGeepXhbOo%2Fimage.png?alt=media&amp;token=3e9cb5af-cea6-4179-abd3-90df5b6863ee" alt=""><figcaption></figcaption></figure>

* To test the `API`, you can use `Postman`. Here are the `endpoints` for testing:\
  \
  Test with an image file: Send a `POST` request to <http://{xx.xx.xx.xx}:8082/idcard_recognition>\
  \
  Test with a `base64-encoded` image: Send a `POST` request to <http://{xx.xx.xx.xx}:8082/idcard_recognition_base64>\
  \
  You can download the `Postman` collection to easily access and use these `endpoints`. [click here](https://github.com/kby-ai/IDCardRecognition-Docker/tree/main/postman/kby-ai-idcard.postman_collection.json)<br>

### 3. Execute the Gradio demo

* Setup `Gradio` \
  Ensure that you have the necessary dependencies installed.\
  \
  `Gradio` requires `Python 3.6` or above.\
  \
  You can install `Gradio` using `pip` by running the following command:

```bash
pip install gradio
```

* Run the demo by using the following command:

```bash
cd gradio
python demo.py
```

* You can test within the following `URL`:\
  \
  <http://127.0.0.1:9000>
