我正在重新利用here中的一些代码来执行对象检测:
# Create boxes list
boxes = [
[annotation['xmin'], annotation['ymin'], annotation['xmax'], annotation['ymax']]
for annotation in image_annotations
]
...
area = (boxes[:, 3] - boxes[:, 1]) * (boxes[:, 2] - boxes[:, 0])
在培训期间,我遇到了以下错误:
File "c:\2021-mcm-master\src\PyTorch-RCNN\ui-prediction\src\screenshot_dataset.py", line 94, in __getitem__
area = (boxes[:, 3] - boxes[:, 1]) * (boxes[:, 2] - boxes[:, 0])
IndexError: too many indices for tensor of dimension 1
根据建议here,我发现我的一些图像不包含任何边界框,并导致此错误:
相关问题 更多 >
编程相关推荐