ubicomplab / rPPG-Toolbox

rPPG-Toolbox: Deep Remote PPG Toolbox (NeurIPS 2023)
https://arxiv.org/abs/2210.00716
Other
504 stars 129 forks source link

预测指令是什么样的? #251

Closed yuer629 closed 8 months ago

yuer629 commented 9 months ago

rPPTG-Toolbox 怎么预测执行什么命令可以预测一个视频的心率呢,视频文件1.mp4,命令怎么样的?

girishvn commented 8 months ago

Assuming that my translation is correct and your question is "what command to execute to predict the heart rate of a video, the video file is 1.mp4, what is the command like?"

  1. You will first need to write a dataloader for your video file (if it is not a video from a supported dataset). This dataloader should read in the video file, and preprocess it (face cropping, etc.).
  2. You can then do a few things. Either load a pretrained PPG model (I suggest ./final_model_release/PURE_DeepPhys.pth) or use an unsupervised methods (for example CHROM) and feed your preprocessed video frames through this method. This will provide an output rPPG predicted signal (or difference signal for many deep methods like DeepPhys).
  3. You can then use a functionality similar to that of /evaluation /post_process.pycalculate_metric_per_video (take a look at how the predicted signals are processed) to calculate the HR.

Unfortunately, this may seem rather confusing. In my opinion, the best way to get accustomed with this toolbox is to run through the exercises of Example of Using Pre-trained Models and Examples of Neural Network Training in the ReadMe. Following the data flow (maybe with either breakpoints or added print statements) will help best understand the data flow of the preprocessing, and how this data is fed during training, inference, and evaluation.

I suggest downloading the UBFC-rPPG dataset, and running inference using one of the pre-trained models. Hope this helps!

girishvn commented 8 months ago

Hope this helped. Feel free to re-open if need be. (Closing for inactivity)