Created
February 8, 2024 09:11
-
-
Save Muriano/d59d164a05ee8fd7756daca01f64e7ae to your computer and use it in GitHub Desktop.
Face Recognition in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import face_recognition | |
img = cv2.imread('original.png') | |
rgb_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) | |
img_encodings = face_recognition.face_encodings(rgb_img)[0] | |
img2 = cv2.imread('fake.png') | |
rgb_img2 = cv2.cvtColor(img2, cv2.COLOR_BGR2RGB) | |
img2_encodings = face_recognition.face_encodings(rgb_img2)[0] | |
results = face_recognition.compare_faces([img_encodings], img2_encodings) | |
print(results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment