Code Monkey home page Code Monkey logo

meta-rppg's Introduction

License CC BY-NC-SA 4.0 Python 3.6

Meta-rPPG: Remote Heart Rate Estimation Using a Transductive Meta-Learner

This repository is the official implementation of Meta-rPPG: Remote Heart Rate Estimation Using a Transductive Meta-Learner that has been accepted to ECCV 2020.

Heatmap Visualization

Left to right:

  1. Cropped input image
  2. End-to-end trained model (baseline)
  3. Meta-rPPG (transducive inference)
  4. Top to down: rPPG signal, Power Spectral Density (PSD), Predicted and ground truth heart rate

Requirements

To install requirements:

pip install -r requirements.txt

All experiments can be run on a single NVIDIA GTX1080Ti GPU.

The code was tested with python3.6 the following software versions:

Software version
cuDNN 7.6.5
Pytorch 1.5.0
CUDA 10.2

Training

Training Data Preparation

Download training data (example.pth) from Google Drive. Due to privacy issue (face images), provided data contains only a subset of the entire training data, i.e. contains faces of the authors of this paper.

Move example.pth to data/ directory:

mv example.pth data/

Begin Training

To begin training, run:

python3 train.py

Validation Data

Validation data can be requested from:

MAHNOB-HCI

UBFC-rPPG

Contributing

If you find this work useful, consider citing our work using the following bibTex:

@inproceedings{lee2020meta,
  title={Meta-rPPG: Remote Heart Rate Estimation Using a Transductive Meta-Learner},
  author={Lee, Eugene and Chen, Evan and Lee, Chen-Yi},
  booktitle={European Conference on Computer Vision (ECCV)},
  year={2020}
}

meta-rppg's People

Contributors

eugenelet avatar evanchen022kan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meta-rppg's Issues

Help! testing model

Can you please provide a way to test the model that has been trained using example.pth? much appreciated!

train on VIPL dataset

Hi @eugenelet @EvanChen022kan,
Thanks for your work, I know that BVP is the signal that results when highpass filtering the PPG signal, so can I use BVP in VIPL dataset as ground truth label in model? How do you normalize ppg label in example.pth file?

Error

Hi

thanks for codes sharing !

I installed requirements and run python train.py

but I have bellow error

RuntimeError: result type Float can't be cast to the desired output type Byte

image

Please advise me!

How to predict heart rate?

Could you please tell me whether to obtain the average heart rate it is enough to pass the output of the ordinal regression through the Hanh window, then Butterworth filter and Welch density decomposition, like the get_bpm function suggests?

def get_bpm(Sig, rate= 30.0):

If possible, I would be grateful if you could give an intuitive understanding of what the Butterworth bandpass does, since you use it both in pre-processing and post-processing.

"Algorithm 1 Training of Meta-Learner"

Where in the code occurs the division into frames V and W mentioned in the article in "Algorithm 1 Training of Meta-Learner".

What is "L steps" in the code?

Was "fewshot_test" supposed to be adaptation steps mentioned in the article?

image

Pretrained model

Hi,
Thank you for releasing the code for Meta-rPPG, very interesting paper indeed.
However, It would be really helpful if you could provided access to the custom training data-set or if privacy is a concern you could maybe upload the pretrained model.

Thank you.

PreProcessing Issue

It is calling baseline process function, after checking baseline process it seems you are doing mean subtraction, mask multiplication and butter processing, but when I checked the output It is actually only doing mean subtraction and not mask multiplication and butter etc. Is it intentional or is it a bug in code ? Thanks

self.baseline_procress(inputs, masks.clone())
ppg = self.quantify(ppg) 

learning phase

Thanks for releasing the code for the meta-rPPG paper! Very interesting paper!

I am wondering where is the code for the learning phase described in the algrotihm 1 (Training of Meta-Learner)? Is it 'def fewshot_learning' whic is currently unifished? If so, does the trainng pipeline work without it?

Thanks!

What should be the input for the method set_input_for_test?

Based on the example.pth, I thought it should be a tensor with size (1, 60, 3, 64, 64) representing the input returned by the test SlideWindowDataLoader, but when I try to use this method with model.test(), it gives me the following error: "Expected hidden[0] size (4, 1, 60), got (4, 3, 60)". So I would like to know what should be the shape. Also, if possible, could tell me the diference between model.fewshot_test() and model.test()?

about AttentionNet

Hi, could you share the AttentionNet with me? I want to learn how your net design~

RuntimeError: result type Float can't be cast to the desired output type Byte

(py370) C:\Users\bunny\Desktop\Meta-rPPG>py train.py
----------- Networks initialized -------------
Total number of parameters : 0.380 M
---------------------end----------------------
dataset [rPPGDataset-train] was created
dataset [rPPGDataset-test] was created
Data Size: 650 ||||| Batch Size: 3 ||||| initial lr: 0.001000
Traceback (most recent call last):
  File "C:\Users\bunny\Desktop\Meta-rPPG\train.py", line 38, in <module>
    data = dataset[task_list, 0]
  File "C:\Users\bunny\Desktop\Meta-rPPG\data\dataload.py", line 68, in __getitem__
    dat = self.dataset[idx, items[1]]
  File "C:\Users\bunny\Desktop\Meta-rPPG\data\pre_dataload.py", line 97, in __getitem__
    self.baseline_procress(inputs, masks.clone())
  File "C:\Users\bunny\Desktop\Meta-rPPG\data\pre_dataload.py", line 120, in baseline_procress
    mask /= 255
RuntimeError: result type Float can't be cast to the desired output type Byte

How to produce example.pth?

Thank you for provide the source code, I want to training the model with some other data, the training and testing dataset, exmple.pth, how to produce this file?

Can you upload a pre-trained model?

Thanks a lot for releasing the code of Meta-rPPG paper!
I understand that due to privacy issue, it is hard to get your training dataset. But can you provide a pre-trained model? This will help me a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.