WZMIAOMIAO / deep-learning-for-image-processing

deep learning for image processing including classification and object-detection etc.
GNU General Public License v3.0
23.25k stars 8.01k forks source link

HRNet #805

Open 1334233852 opened 6 months ago

1334233852 commented 6 months ago

HRNet相关问题,老师您好,请问HRNet自适应任何分辨率的图片尺寸大小吗,我自制的数据集图片尺寸大小是1280x720的,但是训练的时候出现RuntimeError: The size of tensor a (180) must match the size of tensor b (184) at non-singleton dimension 3,是不是720这个维度在stage4里面做下采样的时候一直到45的时候再下采样就除不尽的,不知道是不是这个原因,老师可否有高见!谢谢!

WZMIAOMIAO commented 6 months ago

不支持动态分辨率哦,你可以看下train.py文件,--fixed-size写死的是256x192,你可以根据你自己的数据集修改下--fixed-size https://github.com/WZMIAOMIAO/deep-learning-for-image-processing/blob/bf4384bfc14e295fdbdc967d6b5093cce0bead17/pytorch_keypoint/HRNet/train.py#L192

1334233852 commented 6 months ago

老师您好,这个问题我也注意到了,但我还有个问题,就是说如果我数据集分辨率是1280x720的话,我对应的关键点标注信息也是对应1280x720的,如果我对数据集原始图片进行resize变成384x288或者256x192那么我的标签如何处理,或者我在数据增强那里,对输入到网络的图片大小进行resize那么标签应该如何处理!感谢老师!恳请给个意见

1334233852 commented 6 months ago

老师,我这里对我的数据和标签进行了调整,都弄成了384x288的尺寸大小,但是在评估的时候使用coco的标准,coco2017人体关键点检测是17个,我这里不是17,只有8个,我在coco_eval里面做了调整还是出现这个问题,请问老师有何高见 Traceback (most recent call last): File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_multi_GPU.py", line 272, in main(args) File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_multi_GPU.py", line 164, in main key_info = utils.evaluate(model, data_loader_test, device=device, File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, kwargs) File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_utils/train_eval_utils.py", line 115, in evaluate coco_info = key_metric.evaluate() File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_utils/coco_eval.py", line 128, in evaluate self.coco_evaluator.evaluate() File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 148, in evaluate self.ious = {(imgId, catId): computeIoU(imgId, catId) \ File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 148, in self.ious = {(imgId, catId): computeIoU(imgId, catId) \ File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 229, in computeOks e = (dx2 + dy**2) / vars / (gt['area']+np.spacing(1)) / 2 ValueError: operands could not be broadcast together with shapes (8,) (17,)