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.txt
face_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_bank
python create_face_bank.py --help
For 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.JPG
python face_identification.py --help
For 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.jpg
python face_verification.py --help
For 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.py
you 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 🥲️
)