# Face Liveness

{% embed url="<https://drive.google.com/file/d/1lL0Hl49D7yQsN4VIaZ2CwI_g9M4u-ajr/view?usp=sharing>" %}

### Steps to Install and Run the Liveness Docker

#### Step 1:

Pull AccuraLiveness Docker image using the command `docker pull accurascan/faceliveness:<latest  tag>`

{% hint style="info" %}
Visit <https://hub.docker.com/r/accurascan/faceliveness> to check the latest version available
{% endhint %}

{% code title="Example:" fullWidth="false" %}

```
docker pull accurascan/faceliveness:36.0.0
```

{% endcode %}

#### Step 2:

Run the docker by using the command: `sudo docker run -dp port-you-want-accuraliveness-to-run-on:443 -- restart=always accurascan/faceliveness:<latest tag>`

{% code title="Example" overflow="wrap" %}

```
docker run -dp 8448:443 --restart=always accurascan/faceliveness:36.0.0
```

{% endcode %}

#### Step 3:

{% hint style="info" %}
To generate your Accura Scan license contact <sales@accurascan.com>
{% endhint %}

Upload your license accessing "<mark style="color:blue;">https\://\<yourdomain:port></mark>" using a browser, Example is shown in the image below.

<figure><img src="https://2173810795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9ct3oWZAE255BxwYNdp5%2Fuploads%2Fb9y7TOtWkhlMUNugb69l%2FlivenessIPImage.png?alt=media&#x26;token=3af3cb72-e400-4b00-b4d8-c020d94c491b" alt=""><figcaption></figcaption></figure>

#### Step 4:

Use <mark style="color:blue;">[https://your-domain-or-ip.com:port/upload.php](https://docs.accurascan.com/language/docker/https:/your-domain-or-ip.com:port/upload.php)</mark> (POST request) to access the API, an example post request as shown below.

<mark style="color:green;">`POST`</mark> `https://yourdomain:port/upload.php`

#### Request Body

> You can either pass image file or an image base64.

| Name                                    | Type           | Description                   |
| --------------------------------------- | -------------- | ----------------------------- |
| image<mark style="color:red;">\*</mark> | file           | Upload your image file        |
| imagebase64                             | text or string | paste your image base 64 here |

{% tabs %}
{% tab title="200: OK An example response is shown in the image below" %}

{% endtab %}
{% endtabs %}

<figure><img src="https://2173810795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9ct3oWZAE255BxwYNdp5%2Fuploads%2F1nu3gankLjcE11lCldPr%2FlivenessResponseImage.png?alt=media&#x26;token=0c2baa4e-edbc-4d6f-9efd-90099f6d9d9a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The preferred threshold is **55%**, meaning that if an image achieves a score above this threshold, the face shown is considered ***Live***; otherwise, it is identified as a ***Spoof***.
{% endhint %}
