antoinelame / GazeTracking

👀 Eye Tracking library easily implementable to your projects
MIT License
1.85k stars 505 forks source link

picture is ok ,but not work on video #26

Closed 1158755456 closed 4 years ago

1158755456 commented 4 years ago

When I tried to input the video stream, I could not detect the pupil coordinates. Can you give an example?

1158755456 commented 4 years ago

my code is as follows,maybe you can tell me what's wrong:

gaze = GazeTracking() cap = cv2.VideoCapture() cap.open('one.mp4') n_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) for i in range(n_frames):

ret, frame = cap.read()
gaze.refresh(frame)

frame = gaze.annotated_frame()
text = ""
 ......
cv2.imshow("video", frame)
if cv2.waitKey(1) == 27:
    break
Echo-jyt commented 4 months ago

my code is as follows,maybe you can tell me what's wrong:

gaze = GazeTracking() cap = cv2.VideoCapture() cap.open('one.mp4') n_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) for i in range(n_frames):

ret, frame = cap.read()
gaze.refresh(frame)

frame = gaze.annotated_frame()
text = ""
 ......
cv2.imshow("video", frame)
if cv2.waitKey(1) == 27:
    break

Hello, may I ask if you have solved it? How do you input a video for tracking?