AutoAlignV2 icon indicating copy to clipboard operation
AutoAlignV2 copied to clipboard

question about “crop_img_patch_with_box” function

Open buaazeus opened this issue 2 years ago • 5 comments

Hello, Do you add “crop_img_patch_with_box” in /AutoAlignV2/tools/data_converter/create_gt_database.py? Or is this function from mmdet3d? Thank you.

buaazeus avatar Oct 26 '22 07:10 buaazeus

i have the same question.it will show TypeError: list indices must be integers or slices, not tuple,right? there are actually a wrong, but do not know the solution. may i get your ways? thanks

guangqianzhang avatar Nov 12 '22 11:11 guangqianzhang

File "tools/create_data.py", line 237, in max_sweeps=args.max_sweeps) File "tools/create_data.py", line 84, in nuscenes_data_prep with_bbox=True) File "/opt/lcx/project/AutoAlignV2/tools/data_converter/create_gt_database.py", line 324, in create_groundtruth_database object_img_patches = crop_img_patch_with_box_v2(gt_boxes, example['img']) File "/opt/lcx/project/AutoAlignV2/tools/data_converter/create_gt_database.py", line 129, in crop_img_patch_with_box_v2 img_patch = org_img_list[num_img][y1:y1 + h, x1:x1 + w] IndexError: list index out of range

i meet the question like this. it shows that the org_img_list input only contains one image while we choose 6 images of different views to crop it. so my question is, why only crop one image patches?

ZecCheng avatar Jul 05 '23 02:07 ZecCheng

Hi, we only choose one view to crop, the first view that has the object, following the order (FRONT, LEFT_FRONT, RIGHT_FRONT, LEFT_BACK, RIGHT_BACK, BACK, maybe). The reason that I crop one image patch is we simply want to reduce the size of GT database.

zehuichen123 avatar Jul 05 '23 03:07 zehuichen123

thanks a lot for your prompt answer~ so in [crop_img_patch_with_box”] function, i may just filter other views like this? if(num_img ==0) img_patch = org_img_list[0][y1:y1 + h, x1:x1 + w] img_patches.append(img_patch) where num_img varies from 0 to 5, which means 6 different views gt bboxes.

buaazeus opened this issue on Oct 26, 2022 · 3 co

Hi, we only choose one view to crop, the first view that has the object, following the order (FRONT, LEFT_FRONT, RIGHT_FRONT, LEFT_BACK, RIGHT_BACK, BACK, maybe). The reason that I crop one image patch is we simply want to reduce the size of GT database.

ZecCheng avatar Jul 05 '23 03:07 ZecCheng

You may have a try. The code should not have this problem since I have used it to generate the database before... it's quite strange... Perhaps I changed it for waymo afterwards.

zehuichen123 avatar Jul 05 '23 03:07 zehuichen123