ahaliassos / LipForensics

Lips Don't Lie: A Generalisable and Robust Approach to Face Forgery Detection (CVPR 2021)
MIT License
120 stars 26 forks source link

How to use the Retinaface to generate the landmarks file... #6

Closed yejiaxiong closed 2 years ago

yejiaxiong commented 2 years ago

Processing Forensics/RealFF... 0%| | 0/1000 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/yejx/PycharmProjects/LipForensics-main/preprocessing/crop_mouths.py", line 203, in main() File "/home/yejx/PycharmProjects/LipForensics-main/preprocessing/crop_mouths.py", line 199, in main crop_video_and_save(video_dir, landmarks_dir, target_dir, mean_face_landmarks, args) File "/home/yejx/PycharmProjects/LipForensics-main/preprocessing/crop_mouths.py", line 126, in crop_video_and_save smoothed_landmarks[STABLE_POINTS, :], mean_face_landmarks[STABLE_POINTS, :], cur_frame, STD_SIZE IndexError: index 33 is out of bounds for axis 0 with size 1

Process finished with exit code 1

yejiaxiong commented 2 years ago

Processing Forensics/RealFF... 0%| | 0/1000 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/yejx/PycharmProjects/LipForensics-main/preprocessing/crop_mouths.py", line 203, in main() File "/home/yejx/PycharmProjects/LipForensics-main/preprocessing/crop_mouths.py", line 199, in main crop_video_and_save(video_dir, landmarks_dir, target_dir, mean_face_landmarks, args) File "/home/yejx/PycharmProjects/LipForensics-main/preprocessing/crop_mouths.py", line 126, in crop_video_and_save smoothed_landmarks[STABLE_POINTS, :], mean_face_landmarks[STABLE_POINTS, :], cur_frame, STD_SIZE IndexError: index 33 is out of bounds for axis 0 with size 1

Process finished with exit code 1

yejiaxiong commented 2 years ago
        # Get aligned frame as well as affine transformation that produced it
        trans_frame, trans = warp_img(
            smoothed_landmarks[STABLE_POINTS, :], mean_face_landmarks[STABLE_POINTS, :], cur_frame, STD_SIZE
        )
yejiaxiong commented 2 years ago

STABLE_POINTS = [33, 36, 39, 42, 45]

yejiaxiong commented 2 years ago

how to solve it?

bestalllen commented 2 years ago

how to solve it?

How did you solve this problem? I ran into the same problem. Thank you!

bestalllen commented 2 years ago

how to solve it?

How did you solve this problem? I ran into the same problem. Thank you!

Excuse me, I have solved this problem. The key points of 68 face landmarks need to be resized to an array of (68, 2).