FaceRecognitionWithMask
FaceRecognitionWithMask copied to clipboard
Quickly build a server to face recognition with mask
python enviroment
dlib==19.20.0
opencv_python==4.2.0.34
onnxruntime==1.2.0
fastapi==0.61.0
numpy==1.19.1
How to use ?
1. build the target database
Put all target pictures in a directory (data/mask_nomask in this project), one person with some of pictures (masked and none-masked is recommended), the way of file naming is name.index.jpg
2. dowload the weight files
you can download the all weight files from
- baiduyunpan passwd:60ri (need a baidu account)
- lanzhoucloud (no restriction to download)
and put them in data directory
3. test a video demo
python demo_video.py --face_db_root data/mask_nomask --input_video_path 0.mp4 --output_video_path output.mp4
4. test in fastapi server
uvicorn main:app --reload --host 0.0.0.0
you can upload a picture from http://127.0.0.1:8000/docs, and retrive the face recognition information [name,box,mask or not]
blogs
https://blog.csdn.net/jiangpeng59/article/details/107986046
reference
https://github.com/sgrvinod/a-PyTorch-Tutorial-to-Object-Detection https://github.com/AIZOOTech/FaceMaskDetection https://github.com/davisking/dlib