allow COCO json to have no "bbox"
@@ -171,7 +171,7 @@ Category ids in annotations are not in [1, #categories]! We'll apply a mapping f
assert anno.get("ignore", 0) == 0, '"ignore" in COCO json file is not supported.'
obj = {key: anno[key] for key in ann_keys if key in anno}
- if len(obj["bbox"]) == 0:
+ if "bbox" in obj and len(obj["bbox"]) == 0:
raise ValueError(
f"One annotation of image {image_id} contains empty 'bbox' value! "
"This json does not have valid COCO format."
