> For the complete documentation index, see [llms.txt](https://docs.recognito.vision/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.recognito.vision/id-document-liveness-detection-sdk/integration-guide/linux/sample-application.md).

# Sample Application

## Docker

Pull the Docker image and run the container:

{% code overflow="wrap" %}

```sh
sudo docker pull recognito/id-live:latest
sudo docker run -it -e LICENSE_KEY="xxxxxxxxxxxxx" -p 9001:9000 -p 7861:7860 recognito/id-live:latest [OPTION --gradio(-g), --flask(-f)]
```

{% endcode %}

or

{% code overflow="wrap" %}

```sh
sudo docker pull recognito/id-live:latest
sudo docker run -it -v ./license.txt:/app/license.txt -p 9001:9000 -p 7861:7860 recognito/id-live:latest [OPTION --gradio(-g), --flask(-f)]
```

{% endcode %}

## Installation

### - Download

Download [**ID\_Live.zip**](https://www.dropbox.com/scl/fi/4hdy8fszmmh7kbu3ludqx/ID_Live.zip?rlkey=dza69bk6g1ptqestca9d2bdtt\&st=qr2feb0k\&dl=0)

The Demo directory contains the following directories and files:

<table data-header-hidden><thead><tr><th width="206"></th><th></th></tr></thead><tbody><tr><td><strong>dependency\</strong></td><td>Dependency files</td></tr><tr><td><strong>engine\</strong></td><td>SDK engine files</td></tr><tr><td><strong>examples\</strong></td><td>Sample images</td></tr><tr><td><strong>flask\</strong></td><td>Flask server side demo code</td></tr><tr><td><strong>gradio\</strong></td><td>Gradio demo code</td></tr><tr><td>Dockerfile</td><td>Dockerfile for building a Docker image</td></tr><tr><td>install.sh</td><td>Script for install environment</td></tr><tr><td>readme.txt</td><td>Installation Guide</td></tr><tr><td>requirements.txt</td><td>Python requirements file</td></tr><tr><td>run.sh</td><td>Script for run demo</td></tr></tbody></table>

### - Install dependencies

Run the `install.sh` script to install dependencies:

```sh
./install.sh
```

### - Setting Up SDK License Key

* **Offline Licensing:** Copy the `license.txt` license file to the demo directory.

***

## Test

### - Run Demo

Run the demo script with the desired option:

{% code overflow="wrap" %}

```sh
./run.sh [OPTION --gradio(-g), --flask(-f), --help(-h)]
```

{% endcode %}

<figure><img src="/files/5MgUmsEL9HwOJ5VTyu4T" alt=""><figcaption></figcaption></figure>

### - Test Flask Server APIs

To test the Flask Server API, you can use [Postman](https://www.postman.com/downloads/). Here are the endpoints for testing:

#### &#x20; <mark style="background-color:blue;">POST</mark> /process\_image

&#x20; Check Liveness from image file

&#x20;   **Parameters**

&#x20;        **image:** image file for the ID document

&#x20;   **Response**&#x20;

&#x20;        **result:** Liveness check result

#### &#x20; <mark style="background-color:blue;">POST</mark> /process\_image\_base64

&#x20; Check Liveness from base64 image

&#x20;   **Parameters**

&#x20;        **base64:** base64 image for the ID document image

&#x20;   **Response**&#x20;

&#x20;        **result:** Liveness check result

<figure><img src="/files/QRGefX6XDWmwGDfkEG61" alt=""><figcaption><p>Postman usage guide for Flask Demo</p></figcaption></figure>

### - Test Gradio

Go to <http://127.0.0.1:7860/> on a web browser.

<figure><img src="/files/YqJ1BBHuTXpC8wHQWdsW" alt=""><figcaption><p>Gradio Demo</p></figcaption></figure>
