Skip to content

Loading RPPG Transformer in pyVHR 2.0 #95

@shamussim-ai

Description

@shamussim-ai

Hi. I am struggling to load the RPPG transformer model in the pyVHR_demo_deep.ipynb notebook. I managed to run the notebook successfully until the rppg model. MTTS-CAN and HR CNN worked fine for me.

My setup:
NVIDIA V100
pyvhr 2.0
Python 3.9.7
Setup the package following the instructions for pyvhr GPU. Including git clone

Code

patch_bvps = np.array(patch_bvps)
bvp_pred = vhr.deepRPPG.RPPG_TRANSFORMER_bvp_pred(patch_bvps[:,0:104,:])

Error

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[65], [line 2](vscode-notebook-cell:?execution_count=65&line=2)
      [1](vscode-notebook-cell:?execution_count=65&line=1) patch_bvps = np.array(patch_bvps)
----> [2](vscode-notebook-cell:?execution_count=65&line=2) bvp_pred = vhr.deepRPPG.RPPG_TRANSFORMER_bvp_pred(patch_bvps[:,0:104,:])

AttributeError: module 'pyVHR.deepRPPG' has no attribute 'RPPG_TRANSFORMER_bvp_pred'

Some additional debugging steps

import pyVHR.deepRPPG as deepRPPG

print(dir(deepRPPG))

Returns
['Attention_mask', 'DataLoader', 'FaceHRNet09V4ELU', 'HR_CNN', 'HR_CNN_bvp_pred', 'MTTS_CAN', 'MTTS_CAN_deep', 'OrderedDict', 'PulseDataset', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'butter', 'butter_bandpass_filter', 'cv2', 'detrend', 'h5py', 'hr_cnn', 'img_as_float', 'mtts_can', 'np', 'os', 'preprocess_raw_video', 'pyVHR', 'requests', 'scipy', 'spdiags', 'tf', 'time', 'torch', 'transforms']

As u can see RPPG_TRANSFORMER_bvp_pred is not listed in this directory. So I am wondering if this issue has to do with the installation and setup of pyvhr 2.0?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions