s2anet
s2anet copied to clipboard
Add RandomCrop in config
I'm trying to add a RandomCrop transform in the train pipeline.
I modified an example config configs/hrsc2016/s2anet_r50_fpn_3x_hrsc2016.py, and it shown an error
File "/home/zegwe/s2anet/mmdet/datasets/pipelines/transforms.py", line 337, in __call__
bboxes = results[key] - bbox_offset
ValueError: operands could not be broadcast together with shapes (1,5) (4,)
I tried to edit line 334 in file mmdet/datasets/pipelines/transforms.py
Before:
bbox_offset = np.array([offset_w, offset_h, offset_w, offset_h],
After
bbox_offset = np.array([offset_w, offset_h, 0, 0, 0],
It works with no error now, but trains very slow, maybe the RandomCrop transform costs too much time?
Is there anything I did wrong? And how can I solve it?