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

SkinExtractionFaceParsing torch model issue #84

Open aytekin827 opened 1 year ago

aytekin827 commented 1 year ago

hello, first of all it's really great work for rPPG task. thank you so much!

now I'm on following the pipeline which is pyVHR library

I got this error message from "skin_extraction_methods.py" when initializing SkinExtractionFaceParsing class object.


File "C:\Users\ok\anaconda3\envs\pyvhr\lib\site-packages\pyVHR\extraction\skin_extraction_methods.py", line 72, in init self.net.load_state_dict(torch.load(save_pth, map_location=torch.device('cpu'))) File "C:\Users\ok\anaconda3\envs\pyvhr\lib\site-packages\torch\serialization.py", line 608, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "C:\Users\ok\anaconda3\envs\pyvhr\lib\site-packages\torch\serialization.py", line 777, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, '\x0a'.

what I tried for trouble shooting

  1. check path whether it is right
  2. re-downloaded "19999_iter.pth" file again

if anyone has same problem could you give some way to deal with this problem?

thank you so much

mbpictures commented 11 months ago

Hi! I had the same error. Check this line the URL to the pre-trained model is wrong and therefor it downloads the 404 error page of GitHub. I fixed the issue by manually downloading the model and placing it inside of the resources/faceparsing/ folder. Alternatively, you can replace the URL in the python script. The correct URL for the model is: https://github.com/phuselab/pyVHR/raw/master/resources/faceparsing/79999_iter.pth

Hope this helps you! Maybe one of the maintainers can correct the URL of the package?