Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 1.27 KB

File metadata and controls

32 lines (19 loc) · 1.27 KB

Gaze Data and Focus on Faces

Analyzing gaze data from watching movies to determine the percentage of gaze locations on faces in each frame

Loading Data

Save the video file and gaze data file to the same directory as face_detection.py. The gaze data file must have the headers:

frame_num shot_num x y timestamp subject eyetracker_valid in_frame subject_valid_for_clip film

To extract the frames from the video file, you can run

ffmpeg -i myclip.mp4 'path/to/where/i/want/frames/myclip_%d.jpg'

Ensure that all of the file names only contain a single number that corresponds to the frame number in the gaze data. Do not include any other numbers in the name. Note that using %d numbers all of the frames appropriately except for the first one. You might have to manually add "_0" to the file name.

Installation

pip install -r requirements.txt

Analyzing the Data

Run face_detector.py

Analyzing the Entire Dataset

To get the percentage of gaze locations for each frame, run

plot_percentages(frames_directory, data_file_path, film_name)

This will save a csv file to your directory and will create a plot of the data.

Visualizing Bounding Boxes

To view where the bounding boxes on a frame are, run

detect_faces(frame_path, visualize=True)