Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug: compute_face_descriptor(): incompatible function arguments. #1474

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lanlingsheng
Copy link

fix bug:
Traceback (most recent call last):
File "D:\ProgramData\Python3.10\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "D:\ProgramData\Python3.10\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "g:\Github\face_recognition\examples\facerec_from_webcam_multiprocessing.py", line 85, in process
face_encodings = face_recognition.face_encodings(rgb_frame, face_locations)
File "D:\ProgramData\Python3.10\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:\ProgramData\Python3.10\lib\site-packages\face_recognition\api.py", line 214, in
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:
1. (self: _dlib_pybind11.face_recognition_model_v1, img: numpy.ndarray[(rows,cols,3),numpy.uint8], face: _dlib_pybind11.full_object_detection, num_jitters: int = 0, padding: float = 0.25) -> _dlib_pybind11.vector
2. (self: _dlib_pybind11.face_recognition_model_v1, img: numpy.ndarray[(rows,cols,3),numpy.uint8], num_jitters: int = 0) -> _dlib_pybind11.vector
3. (self: _dlib_pybind11.face_recognition_model_v1, img: numpy.ndarray[(rows,cols,3),numpy.uint8], faces: _dlib_pybind11.full_object_detections, num_jitters: int = 0, padding: float = 0.25) -> _dlib_pybind11.vectors
4. (self: _dlib_pybind11.face_recognition_model_v1, batch_img: List[numpy.ndarray[(rows,cols,3),numpy.uint8]], batch_faces: List[_dlib_pybind11.full_object_detections], num_jitters: int = 0, padding: float = 0.25) -> _dlib_pybind11.vectorss
5. (self: _dlib_pybind11.face_recognition_model_v1, batch_img: List[numpy.ndarray[(rows,cols,3),numpy.uint8]], num_jitters: int = 0) -> _dlib_pybind11.vectors

Invoked with: <_dlib_pybind11.face_recognition_model_v1 object at 0x00000151D00089F0>, array([[[118, 94, 108],
[117, 93, 107],
[116, 92, 106],
...,
[181, 193, 197],
[180, 194, 197],
[180, 194, 197]],

   [[120,  96, 106],
    [120,  96, 106],
    [120,  96, 106],
    ...,
    [178, 192, 194],
    [177, 193, 194],

   [[ 79,  73,  57],
    [ 82,  76,  58],
    [ 85,  79,  57],
    ...,
    [ 40,  72,  92],
    [ 37,  75,  89],
    [ 34,  75,  86]],

   [[104, 104,  80],
    [105, 105,  79],
    [105, 103,  74],
    ...,
    [ 39,  70,  91],
    [ 37,  75,  90],
    [ 36,  77,  89]]], dtype=uint8), <_dlib_pybind11.full_object_detection object at 0x00000151CFC4A330>, 1

@DocNR111
Copy link

我也有这个问题,请问最后怎么解决的,试了网上的其他方法还是不行

Copy link

@ThBean ThBean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes the bug and can be applied to other examples in the repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants