1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.89k stars 1.33k forks source link

Bad failures cases on cuda #215

Closed old-fan-kk closed 3 years ago

old-fan-kk commented 3 years ago

When device=cpu, it can be detected correctly, but when device=cuda, there are many frames that cannot be detected. The video data I use is Obama Weekly Address, which has high resolution and all front faces. the following is my code:

predictor = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device='cuda',  flip_input=True)
video = cv2.VideoCapture(video_dir)
while (video.isOpened()):
    ret, frame = video.read()
    shape = predictor.get_landmarks(frame)
    # reach EOF
    if (ret == False):
        break
1adrianb commented 3 years ago

This is expected for dlib since different models are in fact used in cpu vs gpu mode, but the rest should produce consistent results. Could you share a frame that results in different predictions for the s3fd detector?

old-fan-kk commented 3 years ago

This problem did not occur when I changed to another machine, I think this problem may be caused by memory