ubicomplab / rPPG-Toolbox

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

.pth file is not generating Training on SCAMPS and testing on UBFC With Physnet #180

Closed Bhupendra589 closed 1 year ago

Bhupendra589 commented 1 year ago
(rppg-toolbox) PS C:\Users\bsing\rPPG-Toolbox-main> python main.py --config_file ./configs/train_configs/SCAMPS_SCAMPS_UBFC-rPPG_PHYSNET_BASIC.yaml
=> Merging a config file from ./configs/train_configs/SCAMPS_SCAMPS_UBFC-rPPG_PHYSNET_BASIC.yaml
Configuration:
BASE: ['']
DEVICE: cuda:0
INFERENCE:
  BATCH_SIZE: 1
  EVALUATION_METHOD: FFT
  EVALUATION_WINDOW:
    USE_SMALLER_WINDOW: False
    WINDOW_SIZE: 10
  MODEL_PATH:
LOG:
  PATH: runs/exp\
MODEL:
  BIGSMALL:
    FRAME_DEPTH: 3
  DROP_RATE: 0.2
  EFFICIENTPHYS:
    FRAME_DEPTH: 10
  MODEL_DIR: PreTrainedModels\SCAMPS_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse
  NAME: Physnet
  PHYSNET:
    FRAME_NUM: 128
  RESUME:
  TSCAN:
    FRAME_DEPTH: 10
NUM_OF_GPU_TRAIN: 1
TEST:
  DATA:
    BEGIN: 0.0
    CACHED_PATH: C:\Users\bsing\rPPG-Toolbox-main\cache\UBFC-rPPG_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse
    DATASET: UBFC-rPPG
    DATA_FORMAT: NCDHW
    DATA_PATH: C:\Users\bsing\rPPG-Toolbox-main\data\UBFC
    DO_PREPROCESS: False
    END: 1.0
    EXP_DATA_NAME: UBFC-rPPG_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse
    FILE_LIST_PATH: C:\Users\bsing\rPPG-Toolbox-main\cache\DataFileLists\UBFC-rPPG_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse_0.0_1.0.csv
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME:
      FOLD_PATH:
    FS: 30
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      BIGSMALL:
        BIG_DATA_TYPE: ['']
        RESIZE:
          BIG_H: 144
          BIG_W: 144
          SMALL_H: 9
          SMALL_W: 9
        SMALL_DATA_TYPE: ['']
      CHUNK_LENGTH: 128
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 32
          USE_MEDIAN_FACE_BOX: False
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['DiffNormalized']
      DO_CHUNK: True
      LABEL_TYPE: DiffNormalized
      RESIZE:
        H: 72
        W: 72
      USE_PSUEDO_PPG_LABEL: False
  METRICS: ['MAE', 'RMSE', 'MAPE', 'Pearson', 'SNR']
  USE_LAST_EPOCH: True
TOOLBOX_MODE: train_and_test
TRAIN:
  BATCH_SIZE: 1
  DATA:
    BEGIN: 0.0
    CACHED_PATH: C:\Users\bsing\rPPG-Toolbox-main\cache\SCAMPS_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse
    DATASET: SCAMPS
    DATA_FORMAT: NCDHW
    DATA_PATH: C:\Users\bsing\rPPG-Toolbox-main\data\SCAMPS\Train
    DO_PREPROCESS: False
    END: 1.0
    EXP_DATA_NAME: SCAMPS_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse
    FILE_LIST_PATH: C:\Users\bsing\rPPG-Toolbox-main\cache\DataFileLists\SCAMPS_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse_0.0_1.0.csv
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME:
      FOLD_PATH:
    FS: 30
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      BIGSMALL:
        BIG_DATA_TYPE: ['']
        RESIZE:
          BIG_H: 144
          BIG_W: 144
          SMALL_H: 9
          SMALL_W: 9
        SMALL_DATA_TYPE: ['']
      CHUNK_LENGTH: 128
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 32
          USE_MEDIAN_FACE_BOX: False
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['DiffNormalized']
      DO_CHUNK: True
      LABEL_TYPE: DiffNormalized
      RESIZE:
        H: 72
        W: 72
      USE_PSUEDO_PPG_LABEL: False
  EPOCHS: 30
  LR: 0.009
  MODEL_FILE_NAME: SCAMPS_SCAMPS_UBFC_physnet
  OPTIMIZER:
    BETAS: (0.9, 0.999)
    EPS: 0.0001
    MOMENTUM: 0.9
UNSUPERVISED:
  DATA:
    BEGIN: 0.0
    CACHED_PATH: PreprocessedData\_SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse_unsupervised
    DATASET:
    DATA_FORMAT: NDCHW
    DATA_PATH:
    DO_PREPROCESS: False
    END: 1.0
    EXP_DATA_NAME: _SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse_unsupervised
    FILE_LIST_PATH: PreprocessedData\DataFileLists\_SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse_unsupervised_0.0_1.0.csv
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME:
      FOLD_PATH:
    FS: 0
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      CHUNK_LENGTH: 180
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 30
          USE_MEDIAN_FACE_BOX: False
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['']
      DO_CHUNK: True
      LABEL_TYPE:
      RESIZE:
        H: 128
        W: 128
      USE_PSUEDO_PPG_LABEL: False
  METHOD: []
  METRICS: []
VALID:
  DATA:
    BEGIN: 0.0
    CACHED_PATH: C:\Users\bsing\rPPG-Toolbox-main\cache
    DATASET: SCAMPS
    DATA_FORMAT: NCDHW
    DATA_PATH: C:\Users\bsing\rPPG-Toolbox-main\data\SCAMPS\Val
    DO_PREPROCESS: False
    END: 1.0
    EXP_DATA_NAME:
    FILE_LIST_PATH: PreprocessedData\DataFileLists
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME:
      FOLD_PATH:
    FS: 30
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      BIGSMALL:
        BIG_DATA_TYPE: ['']
        RESIZE:
          BIG_H: 144
          BIG_W: 144
          SMALL_H: 9
          SMALL_W: 9
        SMALL_DATA_TYPE: ['']
      CHUNK_LENGTH: 128
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 32
          USE_MEDIAN_FACE_BOX: False
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['DiffNormalized']
      DO_CHUNK: True
      LABEL_TYPE: DiffNormalized
      RESIZE:
        H: 72
        W: 72
      USE_PSUEDO_PPG_LABEL: False

Cached Data Path C:\Users\bsing\rPPG-Toolbox-main\cache\SCAMPS_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse

File List Path C:\Users\bsing\rPPG-Toolbox-main\cache\DataFileLists\SCAMPS_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse_0.0_1.0.csv
 train Preprocessed Dataset Length: 32

Testing uses last epoch, validation dataset is not required.

Cached Data Path C:\Users\bsing\rPPG-Toolbox-main\cache\UBFC-rPPG_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse

File List Path C:\Users\bsing\rPPG-Toolbox-main\cache\DataFileLists\UBFC-rPPG_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse_0.0_1.0.csv
 test Preprocessed Dataset Length: 51

====Training Epoch: 0====
Train epoch 0: 100%|███████████████| 32/32 [00:44<00:00,  1.38s/it, loss=0.0573]
Traceback (most recent call last):
  File "main.py", line 287, in <module>
    train_and_test(config, data_loader_dict)
  File "main.py", line 78, in train_and_test
    model_trainer.train(data_loader_dict)
  File "C:\Users\bsing\rPPG-Toolbox-main\neural_methods\trainer\PhysnetTrainer.py", line 81, in train
    self.save_model(epoch)
  File "C:\Users\bsing\rPPG-Toolbox-main\neural_methods\trainer\PhysnetTrainer.py", line 180, in save_model
    torch.save(self.model.state_dict(), model_path)
  File "C:\Users\bsing\anaconda3\envs\rppg-toolbox\lib\site-packages\torch\serialization.py", line 376, in save
    with _open_file_like(f, 'wb') as opened_file:
  File "C:\Users\bsing\anaconda3\envs\rppg-toolbox\lib\site-packages\torch\serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "C:\Users\bsing\anaconda3\envs\rppg-toolbox\lib\site-packages\torch\serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'PreTrainedModels\\SCAMPS_SizeW72_SizeH72_ClipLength128_DataTypeDiffNormalized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len32_Median_face_boxFalse\\SCAMPS_SCAMPS_UBFC_physnet_Epoch0.pth'
(rppg-toolbox) PS C:\Users\bsing\rPPG-Toolbox-main>
Bhupendra589 commented 1 year ago

.yaml file

BASE: ['']
TOOLBOX_MODE: "train_and_test"      # "train_and_test"  or "only_test"
TRAIN:
  BATCH_SIZE: 1
  EPOCHS: 30
  LR: 9e-3
  MODEL_FILE_NAME: SCAMPS_SCAMPS_UBFC_physnet
  DATA:
    FS: 30
    DATASET: SCAMPS
    DO_PREPROCESS: False               # if first time, should be true
    DATA_FORMAT: NCDHW
    DATA_PATH: 'C:\Users\bsing\rPPG-Toolbox-main\data\SCAMPS\Train'         # Raw dataset path, need to be updated
    CACHED_PATH: 'C:\Users\bsing\rPPG-Toolbox-main\cache'    # Processed dataset save path, need to be updated
    EXP_DATA_NAME: ""
    BEGIN: 0.0
    END: 1.0
    PREPROCESS :
      DATA_TYPE: ['DiffNormalized']         #if use physnet, should be DiffNormalized
      LABEL_TYPE: DiffNormalized
      DO_CHUNK: True
      CHUNK_LENGTH: 128                 #only support for factor of 512
      CROP_FACE:
        DO_CROP_FACE: True
        USE_LARGE_FACE_BOX: True
        LARGE_BOX_COEF: 1.5
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY : 32
          USE_MEDIAN_FACE_BOX: False    # This should be used ONLY if dynamic detection is used
      RESIZE:
        H: 72
        W: 72
VALID:
  DATA:
    FS: 30
    DATASET: SCAMPS
    DO_PREPROCESS: False                  # if first time, should be true
    DATA_FORMAT: NCDHW
    DATA_PATH: 'C:\Users\bsing\rPPG-Toolbox-main\data\SCAMPS\Val'          # Raw dataset path, need to be updated
    CACHED_PATH: 'C:\Users\bsing\rPPG-Toolbox-main\cache'    # Processed dataset save path, need to be updated
    EXP_DATA_NAME: ""
    BEGIN: 0.0
    END: 1.0
    PREPROCESS :
      DATA_TYPE: ['DiffNormalized']         #if use physnet, should be DiffNormalized
      LABEL_TYPE: DiffNormalized
      DO_CHUNK: True
      CHUNK_LENGTH: 128                 #only support for factor of 512
      CROP_FACE:
        DO_CROP_FACE: True
        USE_LARGE_FACE_BOX: True
        LARGE_BOX_COEF: 1.5
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY : 32
          USE_MEDIAN_FACE_BOX: False    # This should be used ONLY if dynamic detection is used
      RESIZE:
        H: 72
        W: 72
TEST:
  METRICS: ['MAE','RMSE','MAPE','Pearson', 'SNR']
  USE_LAST_EPOCH: True                     # to use provided validation dataset to find the best epoch, should be false
  DATA:
    FS: 30
    DATASET: UBFC-rPPG
    DO_PREPROCESS: False                    # if first time, should be true
    DATA_FORMAT: NCDHW
    DATA_PATH: 'C:\Users\bsing\rPPG-Toolbox-main\data\UBFC'                     # Raw dataset path, need to be updated
    CACHED_PATH: 'C:\Users\bsing\rPPG-Toolbox-main\cache'    # Processed dataset save path, need to be updated
    EXP_DATA_NAME: ""
    BEGIN: 0.0
    END: 1.0
    PREPROCESS :
      DATA_TYPE: ['DiffNormalized']         #if use physnet, should be DiffNormalized
      LABEL_TYPE: DiffNormalized
      DO_CHUNK: True
      CHUNK_LENGTH: 128                 #only support for factor of 512
      CROP_FACE:
        DO_CROP_FACE: True
        USE_LARGE_FACE_BOX: True
        LARGE_BOX_COEF: 1.5
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY : 32
          USE_MEDIAN_FACE_BOX: False    # This should be used ONLY if dynamic detection is used
      RESIZE:
        H: 72
        W: 72
DEVICE: cuda:0
NUM_OF_GPU_TRAIN: 1
LOG:
  PATH: runs/exp
MODEL:
  DROP_RATE: 0.2
  NAME: Physnet
  PHYSNET:
    FRAME_NUM: 128
INFERENCE:
  BATCH_SIZE: 1
  EVALUATION_METHOD: "FFT"        # "FFT" or "peak detection"
  EVALUATION_WINDOW:
    USE_SMALLER_WINDOW: False        # Change this if you'd like an evaluation window smaller than the test video length
    WINDOW_SIZE: 10        # In seconds
  MODEL_PATH: ""
Whitesixln commented 1 year ago

Hello, I'm sorry to bother you. I'm facing the same issue, and I wanted to ask how you resolved it. I'm using a Windows system, and I'm wondering if it might be related. Thank you. image