You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to run the /examples/facerec_from_webcam_faster.py, I found the error which is "ValueError: operands could not be broadcast together with shapes ( , ) (128, )".
There may be three possible reasons to cause the problem which I will show below.
What I Did
1.Check your image file encoding index.Get your image encoding by this way: your_image = face_recognition.load_image_file("../your.jpg") your_face_encoding = face_recognition.face_encodings(your_image)[0]
2.The parameter "face_location" in method "face_encodings" may not need when you first run the demo.So you can change the code like this: face_locations = face_recognition.face_locations(rgb_small_frame) face_encodings = face_recognition.face_encodings(rgb_small_frame)
3.The BGR image can be converted to RGB image by using cv2.cvtColor like this: rgb_small_frame = cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)
The text was updated successfully, but these errors were encountered:
Description
When I tried to run the /examples/facerec_from_webcam_faster.py, I found the error which is "ValueError: operands could not be broadcast together with shapes ( , ) (128, )".
There may be three possible reasons to cause the problem which I will show below.
What I Did
1.Check your image file encoding index.Get your image encoding by this way:
your_image = face_recognition.load_image_file("../your.jpg")
your_face_encoding = face_recognition.face_encodings(your_image)[0]
2.The parameter "face_location" in method "face_encodings" may not need when you first run the demo.So you can change the code like this:
face_locations = face_recognition.face_locations(rgb_small_frame)
face_encodings = face_recognition.face_encodings(rgb_small_frame)
3.The BGR image can be converted to RGB image by using cv2.cvtColor like this:
rgb_small_frame = cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)
The text was updated successfully, but these errors were encountered: