ubicomplab / rPPG-Toolbox

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

Using Pretrained Weights for prediction #230

Closed amishparekh closed 9 months ago

amishparekh commented 9 months ago

Hi, How do I use the pretrained weights for prediction? I tried to load them but when trying to use it I am getting errors for input shape.. I am certain, I am doing something wrong..could you help me out?

yahskapar commented 9 months ago

Hi @amishparekh,

Can you please share more details regarding what exactly you are doing (e.g., running an inference config?) and what the exact errors are? Feel free to include copied/pasted terminal outputs or screenshots.

Generally speaking, you should be able to utilize the pre-trained models quite easily for inference using any of the example inference configs as mentioned here in the README.

amishparekh commented 9 months ago

Hi @yahskapar , I don't want to do on an existing dataset so not using the config files I guess because they are with the purpose of training on a certain dataset and validating on other, wanted to use the pretrained model for prediction on just a single video and wanted to use the simple PURE DeepPhys pretrained model (PURE_DeepPhys.pth). I have done some preprocessing on my video to make sure face occupies the maximum part of my frames. So any suggestions on how can I do it? Not trying to validate against a complete different dataset for now, just a single video.

yahskapar commented 9 months ago

@amishparekh,

Check out my reply here that should be relevant. This toolbox's code is completely open-source, so you should be able to to match the preprocessing and postprocessing steps.

If you give this a try, or have given this a try already, after considering the existing code, feel free to ask specific questions with your code included - otherwise, it's impossible to help you without more context on your code and where there might be a bug.

amishparekh commented 9 months ago

@yahskapar , Thanks for the prompt reply.. I will try out again and let you know if I have some concerns.