Ok so I am trying to make a face recognition login system but I keep on getting the same error.
Here is my code:
import cv2 import pyttsx3 from deepface import DeepFace def take_picture(): print("Scanning Face...") cap = cv2.VideoCapture(0) ret, frame = cap.read() cv2.imwrite("img1.jpg", frame) cv2.destroyAllWindows() cap.release() print("Face Scan Complete") take_picture() img1 = "img1.jpg" img2 = "Just Me.png" model_name = "Facenet" authentication = DeepFace.verify(img1_path=img1, img2_path=img2, model_name=model_name, enforce_detection=False) # print(authentication['verified']): if authentication['verified']: print("Access Granted") else: print("Access Denied.")**
And here is the error i am getting:
Scanning Face... [ WARN:0@38.046] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback Face Scan Complete 1/1 [==============================] - 9s 9s/step Traceback (most recent call last): File "c:\Users\Admin\Desktop\JARVIS\JARVIS_FACE_RECOGNITION.py", line 30, in authentication = DeepFace.verify(img1_path=img1, img2_path=img2, model_name=model_name, enforce_detection=False) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\deepface\DeepFace.py", line 170, in verify img2_representation = represent(img_path = img2_path File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\deepface\DeepFace.py", line 754, in represent img = functions.preprocess_face(img = img_path File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\deepface\commons\functions.py", line 175, in preprocess_face img = load_image(img) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\deepface\commons\functions.py", line 90, in load_image raise ValueError("Confirm that ",img," exists") ValueError: ('Confirm that ', 'Just Me.png', ' exists')