phuselab / pyVHR

Python framework for Virtual Heart Rate
http://phuselab.di.unimi.it/
GNU General Public License v3.0
461 stars 128 forks source link

Taking not all possible frames into account #38

Closed Angloher closed 1 year ago

Angloher commented 2 years ago

https://github.com/phuselab/pyVHR/blob/933ff4e0b32508d4e5dc3176ee0d92446269c36d/pyVHR/deepRPPG/mtts_can.py#L38

Not sure if i understand this correctly, but it seems to me like you are unnecessarily leaving out an image in the loop. I am developing a script to run this in realtime, therefore my input are always 2 frames (current and previous frame). The algorithm should work with two frames, but it doesnt. Since normalized_len = 1, for j in range(0). I think the minus 1 in the loop is unnecessary since you are already subtracting 1 in line 36

aledamelio commented 2 years ago

Hi @Angloher, thanks for your interest in this project. You're probably right... it seems like the last frame is never used. When working offline this may not be a huge problem, but I understand that it's so in your case. The code that you're referring to is a faithful adaptation of the original code (you can find it here). The best thing to do would be to ping the authors of the model and check with them directly your specific case. Alternatively, you can modify and test the code yourself and make a pull request.

Cheers, Alessandro