Recognito
  • About RECOGNITO
  • Face Recognition SDK
    • Performance Overview
    • Integration Guide
      • Linux
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • Windows
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • Android
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • iOS
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • Flutter
        • Installation
        • API Reference
        • Licensing
        • Sample Application
  • Face Liveness Detection SDK
    • Performance Overview
    • Integration Guide
      • Linux
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • Windows
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • Android
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • iOS
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • Flutter
        • Installation
        • API Reference
        • Licensing
        • Sample Application
  • ID Document Recognition SDK
    • Performance Overview
    • Integration Guide
      • Linux
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • Android
        • Installation
        • API Reference
        • Licensing
        • Sample Application
      • iOS
        • Installation
        • API Reference
        • Licensing
        • Sample Application
  • ID Document Liveness Detection SDK
    • Performance Overview
    • Integration Guide
      • Linux
        • Installation
        • API Reference
        • Licensing
        • Sample Application
  • License Option
  • How to implement 1:N identification with RECOGNITO SDK
  • Contact & Support
Powered by GitBook
On this page
  • Docker
  • Installation
  • - Download
  • - Install dependencies
  • - Setting Up SDK License Key
  • Test
  • - Run Demo
  • - Test Flask Server APIs
  • - Test Gradio
  1. Face Liveness Detection SDK
  2. Integration Guide
  3. Linux

Sample Application

Linux-Face Liveness Detection SDK(updated version) Flask, Gradio Demo

PreviousLicensingNextWindows

Last updated 4 months ago

Docker

Pull the Docker image and run the container:

sudo docker pull recognito/face-liveness_v7:latest
sudo docker run -it -e FL_LICENSE_KEY="XXXXX-XXXXX-XXXXX-XXXXX" -p 8001:8000 -p 7861:7860 recognito/face-liveness_v7:latest [OPTION --gradio(-g), --flask(-f)]

Installation

- Download

The Demo directory contains the following directories and files:

dependency\

Dependency files

engine\

SDK engine files

examples\

Sample images for face liveness detection

flask\

Flask server side demo code

gradio\

Gradio demo code

Dockerfile

Dockerfile for building a Docker image

install.sh

Script for install environment

license.txt

License key file

run_demo.sh

Script for run demo

- Install dependencies

Run the install.sh script to install dependencies:

./install.sh

- Setting Up SDK License Key

  • Online Licensing: Set the online license key as an environment variable:

export FL_LICENSE_KEY="XXXXX-XXXXX-XXXXX-XXXXX"
  • Offline Licensing: Copy the license.txt license file to the demo directory.


Test

- Run Demo

Run the demo script with the desired option:

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

- Test Flask Server APIs

POST /api/check_liveness

Perform face liveness detection and attribute analysis on an image file

Parameters

image: image file

Response

result: face liveness, attribute check result

liveness_score: liveness score of detected face

face_rect: face bounding box of detected face

angles: Pitch, Yaw, Roll of detected face

POST /api/check_liveness_base64

Perform face liveness detection and attribute analysis on a base64 image

Parameters

image: base64 image

Response

result: face liveness, attribute check result

liveness_score: liveness score of detected face

face_rect: face bounding box of detected face

angles: Pitch, Yaw, Roll of detected face

- Test Gradio

To test the Flask Server API, you can use . Here are the endpoints for testing:

Go to on a web browser.

FaceLivenessDetection-Demo(v7).zip
Postman
http://127.0.0.1:7860/
Postman usage guide for Flask Demo
Gradio Demo