svip-lab / HRNet-for-Fashion-Landmark-Estimation.PyTorch

[DeepFashion2 Challenge] Fashion Landmark Estimation with HRNet
MIT License
129 stars 22 forks source link

Visuliaztion problem #14

Open Rudy112 opened 1 year ago

Rudy112 commented 1 year ago

First, thanks for sharing this great work! Here is some issue that I met.

I try to visualize the result by running the script###

python tools/test.py --cfg experiments/deepfashion2/hrnet/w48_384x288_adam_lr1e-3.yaml TEST.MODEL_FILE models/pose_hrnet-w48_384x288-deepfashion2_mAP_0.7017.pth TEST.USE_GT_BBOX True DATASET.MINI_DATASET True TAG 'experiment description' WORKERS 4 TEST.BATCH_SIZE_PER_GPU 8 TRAIN.BATCH_SIZE_PER_GPU 8

the config file is

AUTO_RESUME: false # CUDNN: BENCHMARK: true DETERMINISTIC: false ENABLED: true DATA_DIR: '' GPUS: (1,) OUTPUT_DIR: 'output' LOG_DIR: 'log' WORKERS: 8 PRINT_FREQ: 100 PIN_MEMORY: true

DATASET: COLOR_RGB: false DATASET: 'deepfashion2' DATA_FORMAT: jpg FLIP: true NUM_JOINTS_HALF_BODY: 8 PROB_HALF_BODY: 0.3 ROOT: 'data/deepfashion2/' ROT_FACTOR: 15 #45 SCALE_FACTOR: 0.1 #0.35 TEST_SET: 'validation' TRAIN_SET: 'train' MINI_DATASET: True SELECT_CAT: [1,2,3,4,5,6,7,8,9,10,11,12,13] MODEL: INIT_WEIGHTS: true NAME: pose_hrnet NUM_JOINTS: 294 PRETRAINED: '' TARGET_TYPE: gaussian IMAGE_SIZE:

I change the CONFIG parameter to True, however it still does not save any image. The image saving only works when I change the BATH_SIZE_PER_GPU to 1. However, the image-saving function is based on a torch grid, thus result in a very wired visualization since the scale of keypoint and output is different. Could you please try to solve the problem? I am using a single GPU RTX 3080TI with Ubuntu 18.04.

BastianSch commented 1 year ago

Hi,

in lib/core/function.py the iterator i from line 142 https://github.com/svip-lab/HRNet-for-Fashion-Landmark-Estimation.PyTorch/blob/f4ac2e1ef63e08fc51733cdf042b607b41f59261/lib/core/function.py#L142 is reused in line 195 https://github.com/svip-lab/HRNet-for-Fashion-Landmark-Estimation.PyTorch/blob/f4ac2e1ef63e08fc51733cdf042b607b41f59261/lib/core/function.py#L195 So I changed it to j: for j in range(preds_local.shape[0]): preds[j] = transform_preds( preds_local[j], c[j], s[j], [config.MODEL.HEATMAP_SIZE[0], config.MODEL.HEATMAP_SIZE[1]] )

Did you resolve the issue with the scalings of the keypoints?