Tobias-Fischer / rt_gene

RT-GENE: Real-Time Eye Gaze and Blink Estimation in Natural Environments
http://www.imperial.ac.uk/personal-robotics
Other
370 stars 70 forks source link

problem while running estimate_gaze.launch #123

Closed qgy1384 closed 10 months ago

qgy1384 commented 10 months ago

The ros version I used is noetic and the dlib version is 19.14,and the following error occurs when I running the launch file. (This error occurs when a face is detected)Coulid you please tell me the reason and how to corret it, thank you. [ERROR] [1703251397.346772]: bad callback: <bound method LandmarkMethodROS.process_image of <main.LandmarkMethodROS object at 0x7f1997e833a0>> Traceback (most recent call last): File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback cb(msg) File "/home/qgy/gaze track/src/rt_gene/rt_gene/scripts/extract_landmarks_node.py", line 101, in process_image self.update_subject_tracker(color_img) File "/home/qgy/gaze track/src/rt_gene/rt_gene/scripts/extract_landmarks_node.py", line 282, in update_subject_tracker self.subject_tracker.track(tracked_subjects) File "/home/qgy/gaze track/src/rt_gene/rt_gene/src/rt_gene/tracker_face_encoding.py", line 95, in track self.__add_new_element(e) File "/home/qgy/gaze track/src/rt_gene/rt_gene/src/rt_gene/tracker_face_encoding.py", line 53, in add_new_element encoding = np.array(self.encode_subject(element)) File "/home/qgy/gaze track/src/rt_gene/rt_gene/src/rt_gene/tracker_face_encoding.py", line 44, in __encode_subject encoding = self.FACE_ENCODER.compute_face_descriptor(aligned_face) TypeError: compute_face_descriptor(): incompatible function arguments. The following argument types are supported:

  1. (self: dlib.face_recognition_model_v1, img: numpy.ndarray[(rows,cols,3),uint8], face: dlib.full_object_detection, num_jitters: int=0) -> dlib.vector
  2. (self: dlib.face_recognition_model_v1, img: numpy.ndarray[(rows,cols,3),uint8], faces: dlib.full_object_detections, num_jitters: int=0) -> dlib.vectors
  3. (self: dlib.face_recognition_model_v1, batch_img: List[numpy.ndarray[(rows,cols,3),uint8]], batch_faces: List[dlib.full_object_detections], num_jitters: int=0) -> dlib.vectorss

Invoked with: <dlib.face_recognition_model_v1 object at 0x7f1999cdf1b0>, array([[[ 12, 19, 14], [ 15, 22, 17], [ 16, 23, 18], ..., [ 0, 0, 0], [ 0, 0, 0], [ 0, 0, 0]],

   [[ 13,  20,  17],
    [ 15,  22,  19],
    [ 16,  23,  18],
    ...,
    [  0,   0,   0],
    [  0,   0,   0],
    [  0,   0,   0]],

   [[ 14,  21,  18],
    [ 15,  22,  19],
    [ 15,  22,  17],
    ...,
    [  0,   0,   0],
    [  0,   0,   0],
    [  0,   0,   0]],

   ...,

   [[ 72,  76, 104],
    [ 72,  76, 104],
    [ 74,  78, 106],
    ...,
    [  0,   0,   0],
    [  0,   0,   0],
    [  0,   0,   0]],

   [[ 73,  77, 106],
    [ 71,  75, 103],
    [ 71,  75, 103],
    ...,
    [  0,   0,   0],
    [  0,   0,   0],
    [  0,   0,   0]],

   [[ 73,  79, 108],
    [ 70,  77, 104],
    [ 69,  76, 103],
    ...,
    [  0,   0,   0],
    [  0,   0,   0],
    [  0,   0,   0]]], dtype=uint8)
ahmed-alhindawi commented 10 months ago

Has dlib changed their function arguments for compute_face_descriptor()? It seems we might not be compatible with 19.14. Try downgrading, from my memory, 19.11 worked but that could well be incorrect.

Alternatively, try switching off the face tracker module if you're only tracking one person and there isn't a requirement for re-identification.

Tobias-Fischer commented 10 months ago

@qgy1384 - how did you solve this?