tolgasumer / face-api

Combining the popular face_recognition library with a simple flask backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Face API

Version License: MIT

Combining the popular face_recognition library with a simple flask backend that can receive images and respond with the labeled ones, without saving them locally.

πŸ’Ύ Install

pip3 install -r requirements.txt

πŸš€ Usage

  • To run the server with the sample model
python3 api.py
  • To train your own KNN classifier with your dataset, place your images according to the structure below:
images/train/
        β”œβ”€β”€ <person1_name>/
        β”‚   β”œβ”€β”€ <someimage1>.jpeg
        β”‚   β”œβ”€β”€ <someimage2>.jpeg
        β”‚   β”œβ”€β”€ ...
        β”œβ”€β”€ <person2_name>/
        β”‚   β”œβ”€β”€ <someimage1>.jpeg
        β”‚   └── <someimage2>.jpeg
        └── ...
python3 train.py

The trained model will be placed in the root folder, named as "trained_knn_model.clf"

  • Send POST requests to the /upload endpoint with a file on them as form-data Postman

Sample results of using it as the backend of a web page

Frontend

πŸ“ License

MIT


About

Combining the popular face_recognition library with a simple flask backend


Languages

Language:Python 100.0%