1:N FaceRecognition(Face Search) - Docker

This demo demonstrates 1:N face recognition by registering face data and search it from the data enrolled on database like PostgreSQL.

Overview

This project demonstrates an advanced 1:N face recognition technology implemented via a Dockerized Flask API.

This demo performs 1:N face recognition, face search SDK derived from KBY-AI's face recognition server SDK by implementing the functionalities to register face and search face from database(PostgreSQL). This demo offers APIs to enroll face, to search face, to see database, to clear database. And every API can be customized by updating app.py file accordingly.

SDK

Face Search SDK(1:N Face Recognition) - Server

Github

Test Online

Postman Endpoints

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

  1. http://<your-base-url>/register This API enrolls face data from image base64 format and save it to database(PostgreSQL)

  2. http://<your-base-url>/search This API seeks face similar to input face among database and returns enrolled image ID and similarity score.

  3. http://<your-base-url>/user_list This API shows all data enrolled on database(PostgreSQL).

  4. http://<your-base-url>/remove_all This API removes all data from database.

Example of face search endpoint

How to Run

1. System Requirements

CPU: 2 cores or more (Recommended: 8 cores)

RAM: 4 GB or more (Recommended: 8 GB)

HDD: 4 GB or more (Recommended: 8 GB)

OS: Ubuntu 20.04 or later

Dependency: OpenVINO™ Runtime (Version: 2022.3)

2. Setup and Test

  • Clone the project:

git clone https://github.com/kby-ai/FaceSearch-Docker.git
cd FaceSearch-Docker

wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=19vA7ZOlo19BcW8v4iCoCGahUEbgKCo48' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=19vA7ZOlo19BcW8v4iCoCGahUEbgKCo48" -O data.zip && rm -rf /tmp/cookies.txt

unzip data.zip
  • Build the Docker image:

sudo docker build --pull --rm -f Dockerfile -t kby-ai-face-search:latest .
  • Get Machine Code:

sudo docker run -e LICENSE="xxxxx" kby-ai-face-search:latest
  • Send us the machine code obtained.

How to get machine code
  • Update the license.txt file by overwriting the license key that you received from KBY-AI team.

  • Run the Docker container:

sudo docker run -v ./license.txt:/root/kby-ai-face/license.txt -p 8081:8080 -p 9001:9000 kby-ai-face-search:latest
Activation value 0 indicates that SDK has been activated successfully.

Last updated