Spetlik, R., Franc, V., Cech, J. and Matas, J. (2018) Visual Heart Rate Estimation with Convolutional Neural Network. In Proceedings of British Machine Vision Conference, 2018
See http://cmp.felk.cvut.cz/~spetlrad/ecg-fitness/ for the original paper and the ECG-Fitness dataset.
This repo is being constructed. You can monitor the progress bellow.
- Document the installation.
- Convert models to a reasonable format.
- Create public evaluation scripts.
- Create public learning scripts.
We support only the following plug-and-play installation. You don't have to follow the steps bellow, but it may happen that it will not work :( This setup should work regardless of the operation system (i.e. Windows and Linux is OK).
- Clone the repo to a directory of your preference with
git clone [email protected]:radimspetlik/hr-cnn.git
. - Change directory to the clonned repo.
- Install miniconda http://lmgtfy.com/?q=miniconda+install.
- Run
conda env update --file environment.yml
OR manually:- Create a Python 2.7 environment hr-cnn with
conda create -n hr-cnn python=2.7
. - Install docopt with
conda install docopt
. - Install scipy with
conda install scipy
- Install h5py with
conda install h5py
- Install opencv with
conda install opencv
- Install boost 1.65.1 with
conda install boost=1.65.1
- Install bob.blitz with
conda install bob.blitz
- Install lmdb-python
conda install lmdb-python
- Create a Python 2.7 environment hr-cnn with
- Activate the environment with
source activate hr-cnn
. - Install Pytorch http://lmgtfy.com/?q=install+pytorch.
- Add the data.
- Download the models from http://cmp.felk.cvut.cz/~spetlrad/ecg-fitness/models.zip and extract them to
data/models/
. - Copy the contents of the
bbox
directory (distributed in the 7zipped ECG Fitness database or available at https://goo.gl/aXDQiy) tobob/db/ecg_fitness/data/bbox/
. - Copy the contents of the
test_h5_faces.zip
(available at https://goo.gl/9iw3LY) todata/experiments/cnn/ecg-fitness-face-192x128/15/01/
.
- Download the models from http://cmp.felk.cvut.cz/~spetlrad/ecg-fitness/models.zip and extract them to
- Run the evaluation test script with
python test-evaluation.py
. The network will evaluate two sequences attached in the repo. You should get the following results:
[INFO]==================
[INFO]=== STATISTICS-whole train ===
[INFO]Root Mean Squared Error-whole = 8.38
[INFO]Mean of error-rate percentage-whole = 0.09
[INFO]Mean absolute error-whole = 8.30
[INFO]Pearson's correlation-whole = nan
[INFO]Pearson's correlation-whole significance = nan
[INFO]==================
[INFO]=== STATISTICS-whole test ===
[INFO]Root Mean Squared Error-whole = 8.38
[INFO]Mean of error-rate percentage-whole = 0.09
[INFO]Mean absolute error-whole = 8.30
[INFO]Pearson's correlation-whole = nan
[INFO]Pearson's correlation-whole significance = nan
WARNING - the computations are very GPU memory-demanding. Running the test script requires at least 12GB of GPU memory. If you don't have enough memory, try changing the batch_size
variable in the test.py
script.
My scripts are using a minimalist hackish version of https://pypi.org/project/bob.rppg.base/. I am sorry for that. Be sure to checkout their repo. Just to be absolutely sure - everything you need from their repo to run my scripts is included in my repo.