Methodology described in R. Kaushik and R. Simmons, “Early Prediction of Student Engagement from Facial and Contextual Features,” in International Conference on Social Robotics, 2020.
- Install PuTTY or other SSH client
- Install WinSCP or other file transfer application
- Login to
bardot.autonomy.ri.cmu.edu - Follow this tutorial to install OpenFace into your home directory (i.e. create
~\OpenFace) - Apply
chmod 777to any directories that you will be adding/moving/deleting files from
Install ffmpeg, python3, pickle, numpy, cv2, multiprocessing
- Create directory
~\OpenFace\build\videosand copy all videos into that directory - Create directory
~\OpenFace\build\videos\crop_videos - In
~\OpenFace\build\videos, execute the following:
for f in *.mp4; do ffmpeg -i $f -filter:v "crop=185:135:839:20" crop_videos/$f; done;
4. In ~\OpenFace\build\crop_videos, execute the following:
for f in *.mp4; do ../../bin/FeatureExtraction -f $f; done;
- Copy the csv files created in
~\OpenFace\build\crop_videos\processedto your computer
To generate data from videos, use the direct_VF.py script located in the home directory.
- Create directory
~\data\picture_sides - Use the function
def get_picture_side(video_filename) :to generate a file containing the side the picture is located on for each frame (represented by a line). This file will be stored in the data/picture_sides directory.
Make sure video mp4, picture side, and OpenFace feature files are available.
- Create directory
~\data\activities - Run
python3 direct_VF directory_name video_name- If you want to generate CSV files for all videos in a given directory, run the following:
python3 direct_VF directory_name allThis will create csv files for each activity labeled by the video name, activity number, and activity name located in the data/activities directory.
Run create_dataset.py with appropriate variables to create a pkl file for the entire dataset
main.py is the file to run which:
- Splits into train-test with cross-validation
- Runs all combinations of hyperparameters and calculates performance metrics
- Chooses hyperparameter combination with highest combined performance metric
- Saves results into a
pklfile