Skip to content

AndreasLH/Heart-Rate-Estimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code for my B.Sc. project "heart rate estimation in videos of faces"

Much of the code is structured in jupyter notebooks everything related to the ICA method in contained in the notebooks folder while the RhythmNet folder contains everything related to the RhythmNet model, the main notebooks are.

├───notebooks
│   ├───regression_ica.ipynb
│   ├───ICA_evaluation.ipynb
└───RhythmNet
    ├───train.ipynb

Quick links to the notebooks

  • regression_ica.ipynb The heart rate alteration is done in this notebook, much of the method section stems from this notebook

  • ICA_evaluation.ipynb This is both for evaluating the heart rate estimation and the quality of the video after alteration. This notebook corresponds to most of the Results section of the report

  • RhythmNet training This is where everything regarding the RhythmNet model happens. All the spatial temporal maps of the videos should be generated with generate_st_maps.py

  • Samples of modified videos (roughly the videos in notebooks/videos)

data is available here

Project Structure

Due to storage limitations, datafiles are not included on in the repo, but they should be structured like the following

├───checkpoint
├───cpi
│   ├───idx
├───data
│   ├───hr_data
│   ├───st_maps
│   │   ├───test
│   │   └───train
│   ├───test
│   └───train
├───notebooks
│   ├───videos
│   ├───x
└───RhythmNet
    ├───x

Compressing videos with ffmpeg

scale to 2/3

ffmpeg -i cpi_gym.avi -vf "scale=trunc(iw*(2/3)/2)*2:trunc(ih*(2/3)/2)*2" comp_vid.mp4

only compress (what I used)

ffmpeg -i cpi_gym.avi -vf comp_vid.mp4

ffmpeg -i cpi_gym.avi -vf comp_vid.mjpg

compress entire directory for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done

About

B.Sc. project "heart rate estimation in videos of faces"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published