AndreasLH / Heart-Rate-Estimation

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"

License:MIT License


Languages

Language:Jupyter Notebook 100.0%Language:Python 0.0%Language:Shell 0.0%