crisie/RecurrentGaze

generate training files

kevinsu628 opened this issue · 1 comments

Hello,

Nice work! I just have a few questions regarding the generate_training_X file.

It seems like it expects a "frames" folder that contains a few files that we need to generate by ourselves for the EYEDIAP dataset:

  1. extracted bmp images from the original videos (the rgb_vga.mov one? )
  2. 3D landmarks using Bulat et al. 2017 code, that should be formatted as 'result3D_' + session_str + '.txt', correct?

Thanks!

For those of you who are also wondering the same question:

  1. Yes,
def extract_frames_from_video(video_path, output_path):
    import cv2
    cap = cv2.VideoCapture(video_path)
    i = 0
    while cap.isOpened():
        ret, frame = cap.read()
        if not ret:
            break
        cv2.imwrite(os.path.join(output_path, format(i, '05') + '.bmp'), frame)
        i += 1

    cap.release()
    cv2.destroyAllWindows()
  1. Yes