Sample Application

Linux-Face SDK(lite version) Flask, Gradio Demo

Docker

Pull the Docker image and run the container:

sudo docker pull recognito/facesdk-lite:latest
sudo docker run -it -v ./license.txt:/home/recognito_lite/license.txt -p 8001:8000 -p 7861:7860 recognito/facesdk-lite:latest [OPTION --gradio(-g), --flask(-f)]

Installation

- Download

Download FaceSDK-Lite-Demo.zip[72M]

The Demo directory contains the following directories and files:

cpp_demo\

C++ demo files

engine\

SDK engine files

examples\

Sample images

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

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

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

POST /api/analyze_face

Perform face analysis on an image file

Parameters

image: image file

Response

result: face detection result

face_rect: face bounding box of detected face

attribute: attributes(age, angle, eye_open, gender, liveness, mask, mouth_open, wear_glass) of detected face

POST /api/compare_face

Perform face match between two face image files

Parameters

image1: image file for the 1st face

image2: image file for the 2nd face

Response

result: face match result

similarity: similarity between two faces

detection: face bounding boxes of two faces

- Test Gradio

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

Last updated