Sample Application

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

Docker

Pull the Docker image and run the container:

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

Installation

- Download

Download FaceRecognition-Demo.zip[191M]

The Demo directory contains the following directories and files:

- 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 FR_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

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

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

POST /api/compare_face_base64

Perform face match between two face base64 images

Parameters

image1: base64 image for the 1st face

image2: base64 image 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