ubicomplab / rPPG-Toolbox

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

When I run visualization file .ipynb on Jupyter, I found it can not work. #231

Closed sunmer1rain closed 9 months ago

sunmer1rain commented 9 months ago

When I use the preprocessing visualization file .ipynb, I don't see the corresponding ppg signal and the visualization figure for the moving frame. ![Uploading 1.png…]()

sunmer1rain commented 9 months ago

1

yahskapar commented 9 months ago

Hi @sunmer1rain,

Can you share a few more details on how exactly you're running the notebook? JupyterLab? Can you share any other debugging details that JupyterLab might provide if you're using JupyterLab?

I only tested the notebook in VSCode so it's possible there's some differences in notebook environments that's causing some issue or another. Happy to try and troubleshoot this with you, though I recommend also trying it in VSCode to see if works there on your machine.

sunmer1rain commented 9 months ago

Thank you very much for your reply. At first, when I was using the code, I found that no matter how I dragged the frame bar or changed the chunk, the screen area remained blank. Later, I discovered that I need to use the line of code "visualizer.update_frame()" to display the images. However, it still doesn't dynamically display the images and heart rate. I need to run "visualizer.update_frame()" every time I change the chunk or frame bar to correctly display the current image.

And I have another question. When reading about EfficientNet in the paper, I found that the input videos for this model do not require preprocessing. But in your code, I see that the training configuration file includes preprocessing steps like the pos algorithm for videos. Does this deviate from the original paper?

sunmer1rain commented 9 months ago

Sorry, I misspoke earlier. It should be called EfficientPhys. In this paper, I also found that it should not require ROI extraction for videos, but your code seems to perform ROI partitioning.

yahskapar commented 9 months ago

@sunmer1rain,

You should only need to run the last cell of the notebook once to properly set everything up and interactively visualize all of the chunks (without reloading). Again, can you share more details about where you're running this (e.g., JupyterLab?) and if any debug information was displayed when you ran the original code (as it currently is in the toolbox)?

This is the first time I'm hearing of this not working as is, so I'd like to figure out what might be going on even if you figured out a workaround.

Also, regarding your questions on EfficientPhys:

1) Can you elaborate on what you mean by "the preprocessing steps like the POS algorithm for videos"? Please note that the EfficientPhys implementation and config defaults in this toolbox are for direct comparison to the other methods in the toolbox. As a result, you should really be referring to the paper associated with the toolbox here if you want to try and reproduce certain results.

2) Again, for ROI extraction (face cropping), this is done with EfficientPhys for more direct comparisons to other methods that are in the toolbox.

sunmer1rain commented 9 months ago

I'm sorry, I misunderstood and confused the processing of unsupervised methods with the processing of deep learning methods while reviewing the code. The EfficientPhys method does not use the POS algorithm, it only performs facial cropping. Thank you for your guidance. I now understand that by setting DATA_TYPE and LABEL_TYPE to RAW, and setting DO_crop_face to FALSE, I can achieve preprocessing-free operations. Regarding the visualization file .ipynb, I did use Jupyter Notebook to run this file. I did not change any parameters. I just change the Path here. 1 When I run the last cell, it can not show the properly figure. image image But I can run "visualizer.update_frame()" to correctly display the current image. image

yahskapar commented 9 months ago

@sunmer1rain,

Good to hear your question regarding EfficientPhys has been resolved. Regarding the notebook, I can't really reproduce what you're seeing, though I'm also using VSCode and the JupyterLab extension within VSCode specifically. If you're running this in just JupyterLab, outside of VSCode, can you try the advice mentioned here and let me know that goes? It's possible this is some sort of issue with IPyWidgets and some of the advice mentioned on Stack Overflow may be able to fix it.

In the near future I may also just re-do the visualization notebook to not rely on widgets, primarily to avoid having to deal with any weird, deprecated behavior down the line.

sunmer1rain commented 9 months ago

I used to run the code on a remote Jupyter server on Linux. When I run it locally on my own computer using Jupyter, I found that the display can now be updated in real-time. It might have been caused by some unknown issues with the server previously.

yahskapar commented 9 months ago

Perhaps, good to hear that it can be updated in real-time now though. I'll try to investigate this a bit more in the future when I have time to re-do some of the visualization tools to be more robust and not rely on IPyWidgets. I'll go ahead and close this issue for now - feel free to create a new issue if you have any other questions or concerns.

sunmer1rain commented 9 months ago

Thanks