Add numpy promise
Summary:
When transforms.transforms is [], then after apply, the bbox will still be a list, then .clip will post errors
Pull Request resolved:
@@ -276,7 +276,7 @@ def transform_instance_annotations(
# bbox is 1d (per-instance bounding box)
bbox = BoxMode.convert(annotation["bbox"], annotation["bbox_mode"], BoxMode.XYXY_ABS)
# clip transformed bbox to image size
- bbox = transforms.apply_box([bbox])[0].clip(min=0)
+ bbox = transforms.apply_box(np.array([bbox]))[0].clip(min=0)
annotation["bbox"] = np.minimum(bbox, list(image_size + image_size)[::-1])
annotation["bbox_mode"] = BoxMode.XYXY_ABS
