Sample Application

Windows-Face SDK(lite version) Flask, Gradio, Surveillance Demo

Installation

- Download

Download WinFaceSDKDemo.rar [145M]

The Demo directory contains the following directories and files:

dependency\

Dependency files

engine\

SDK engine files

examples\

Sample images

flask\

Flask server side demo code

gradio\

Gradio demo code

video_surveillance_demo\

1:N Video Surveillance demo code

- Install dependencies

Install python-3.8.9.exe, VC_redist.2013.exe, VC_redist.2015-2022.exe files from dependency directory.

- Setting Up SDK License Key

Copy the license.txt license file to the engine directory.


Test

- Test Flask Server APIs

  • Install sub-dependencies for Flask Demo

cd flask
python -m pip install -r requirements.txt
  • Run app.py script:

python app.py
  • 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, gender, liveness, mask, 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

Postman usage guide for Flask Demo (analyze_face)
Postman usage guide for Flask Demo (compare_face)

- Test Gradio

  • Install sub-dependencies for Gradio Demo

cd gradio
python -m pip install -r requirements.txt
  • Run app.py script:

python app.py
Gradio Demo (face attribute)
Gradio Demo (face recognition)

- Test 1:N Surveillance

  • Install sub-dependencies for Surveillance Demo

cd video_surveillance_demo
python -m pip install -r requirements.txt
  • Run app.py script:

python app.py
  • Main Page

When you run the app.py script, the main page appears first.

main page in 1:N surveillance
  • Register Person Page

You can enroll user from image.

user registration page
  • User List Page

The registered user list is displayed.

user list page
  • Photo Match Page

You can identify registered users from selected image.

photo match page
  • Video Surveillance Page

You can identify registered users from video stream.

Media file, RTSP stream, Web Camera can be used as video stream.

select video stream page
video surveillance page

Last updated