Implement a face recognition using insightface
-
Verification: I used InsightFace package for face verification, allowing you to compare two images and determine if they are the same person.
-
Identification: I used InsightFace package for face identification, allowing you to recognize different people.
-
Face ID: At the end of the readme you will see I wrote a super snake game that it has a face recognition at the beginning of it.
pip install -r requirements.txtface_bank
│
└───Messi
│ │ Messi_image_1.jpg
│ │ Messi_image_2.jpg
│ │ ...
│
└───Ronaldo
│ │ Ronaldo_image_1.jpg
│ │ Ronaldo_image_2.jpg
│ │ ...
│
│
...
python create_face_bank.py --face-bank ./face_bankpython create_face_bank.py --helpFor Example:
--model: You can chose one of these models. default:buffalo_s--face-bank: You can change the face bank directory path. default:face_bank--face-bank-name: You can change the face bank file name. default:face_bank.npy
python face_identification.py --img YOUR_IMAGE.JPGpython face_identification.py --helpFor Example:
--model: You can chose one of these models. default:buffalo_s--thresh: You can change the threshold of distances between tow faces. default:25--face-bank: You can change the face bank file path. default:face_bank.npy--update, --no-update: You can update the face bank file. default:False--face-bank-path: You can change the face bank directory path if you want to update the face bank file. default:face_bank
python face_verification.py --img1 YOUR_FIRST_IMAGE.jpg --img2 YOUR_SECOND_IMAGE.jpgpython face_verification.py --helpFor Example:
--model: You can chose one of these models. default:buffalo_s--thresh: You can change the threshold of distances between tow faces. default:25--show, --no-show: You can see the result by this command default:False
First make your face bank with create_face_bank.py then run this command:
cd snake \
python main.pyyou can change these variables as well:
access, message = FaceIdentification.make_online(
model='buffalo_s',
thresh=25,
face_bank_path='./face_bank.npy',
camera_id=0,
is_show=False # Keep it false I have a threading error here 🥲️
)

