Skip to content

RTae/KhaoManee

Repository files navigation

KhaoManee

Build Status

KhaoManee is a face-detection and face-recognition API that provides face bounding box and face-landmarks for face-detection. KhaoManee's face-detection model uses MTCNN model that returns 5 points face-landmark. KhaoManee's face-recognition API can recognize the member of Parliament in Thailand, but it can detect only a few people such as Prayut Chan-o-cha, Prawit Wongsuwan, Thanathorn Juangroongruangkit. I will add more in the future. If you have any person who is a member of Parliament in Thailand that you are interested in. You can tell me by creating an issue. I will consider it and add it. KhaoManee's face-recognition use Facenet model to find similarity with embedding vector (For this project, I use vector size is 512). Last, this project implements the model with Pytorch and API with FastAPI. If you have any problems or any questions, you can tell me by creating issue 🙏

📌 Requirement

  1. python 3.7.x or Higher

  2. torch 1.5 or higher

  3. torchvision 0.8.2 or higher

  4. fastapi 0.63.0 or higher

  5. uvicorn 0.13.3 or higher

  6. python-multipart 0.0.5 or higher

  7. requests 2.25.1 or higher

⚙️ How to use

  1. Clone this project.

    git clone https://github.com/RTae/KhaoManee.git
    
  2. Run this line to install package,

    pip install -r reqguirements.txt
    
  3. Run this line to run FastAPI in local.

    uvicorn main:app --reload
    
  4. 127.0.0.1:8000/docs to see the document of this api. Done !!!

👤 How to add more face to recognize

You can
  1. Create a folder with the name that you want to recognize.

    ./data/imges/<your_folder_with_name>
    

    example /data/imges/prayuth

  2. Add images of the person that you want to recognize at least one imges (recommed to be straight face picture).

  3. Run this line to add.

    python add_face_rec_images.py
    
  4. Run this line to test it

    uvicorn main:app --reload
    

🐳 Docker Build

Build

    docker build -t myimage .

Run

    docker container run -d --name mycontainer -p 80:80 myimage

or from my build

    docker container run -d --name mycontainer -p 80:80 rtae/khaomanee:1.0.7

🔥 Demo

Return images with draw bounding box bounding box source of images

Return images with draw bounding box and landmarks bounding box and landmarks source of images

Return data of bounding box and landmarks bounding box and landmarks data source of images

Return images with draw bounding and their name face recognition

source of images

📘 Reference

  1. timesler's facenet+mtcnn repo repository (Big Thank you to this repo 🙏 🙏)

  2. F. Schroff, D. Kalenichenko, J. Philbin. FaceNet: A Unified Embedding for Face Recognition and Clustering, arXiv:1503.03832, 2015. PDF

  3. Q. Cao, L. Shen, W. Xie, O. M. Parkhi, A. Zisserman. VGGFace2: A dataset for recognising face across pose and age, International Conference on Automatic Face and Gesture Recognition, 2018. PDF

  4. K. Zhang, Z. Zhang, Z. Li and Y. Qiao. Joint Face Detection and Alignment Using Multitask Cascaded Convolutional Networks, IEEE Signal Processing Letters, 2016. PDF

  5. FastAPI link

  6. Annoy, Spotify link

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published