Open 45H15H opened 1 year ago
same, but i´m in windows machine python 3.11.4
replace the code line,
rgb_small_frame = small_frame[:, :, ::-1]
with below code line,
rgb_small_frame = cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)
replace the code line,
rgb_small_frame = small_frame[:, :, ::-1]
with below code line,
rgb_small_frame = cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)
这对我有所帮助,It works for me.
Description
I copied the code and modified it for my personal use. I am getting this error: Traceback (most recent call last): File "d:\face-recognition\face-recognition\face_recognition_live.py", line 55, in
face_encodings = face_recognition.face_encodings(rgb_small_frame, face_locations)
return [np.array(face_encoder.compute_face_descriptor(face_image, raw_landmark_set, num_jitters)) for raw_landmark_set in raw_landmarks]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: compute_face_descriptor(): incompatible function arguments. The following argument types are supported:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\face-recognition\myenv\Lib\site-packages\face_recognition\api.py", line 214, in face_encodings return [np.array(face_encoder.compute_face_descriptor(face_image, raw_landmark_set, num_jitters)) for raw_landmark_set in raw_landmarks] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\face-recognition\myenv\Lib\site-packages\face_recognition\api.py", line 214, in
Invoked with: <_dlib_pybind11.face_recognition_model_v1 object at 0x000002A23C639FF0>, array([[[203, 199, 188], [208, 198, 185], [204, 195, 191], ..., [225, 222, 222], [223, 219, 222], [224, 221, 224]],
What I Did
I just ran the code as it is. And I changed the sample images.