"docs/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "ae7cd5ad4c3ec9e13b5ad1b8d6f25b31696e78cf"
Commit b4d9aad9 authored by Xi Yin's avatar Xi Yin Committed by Facebook GitHub Bot
Browse files

fix bug in valid_bbox check

Summary: In case the height/width is None, the original version will cause a crash. So adding additional check to bypass this issue.

Reviewed By: ppwwyyxx

Differential Revision: D29807853

fbshipit-source-id: b2b1a7edb52b7911da79a11329d4cf93f343c279
parent f0de0b50
...@@ -191,7 +191,7 @@ def convert_to_dict_list(image_root, id_map, imgs, anns, dataset_name=None): ...@@ -191,7 +191,7 @@ def convert_to_dict_list(image_root, id_map, imgs, anns, dataset_name=None):
bbox_object = obj.get("bbox", None) bbox_object = obj.get("bbox", None)
if bbox_object is not None and "bbox_mode" in obj: if bbox_object is not None and "bbox_mode" in obj:
bbox_object = BoxMode.convert(bbox_object, obj["bbox_mode"], BoxMode.XYWH_ABS) bbox_object = BoxMode.convert(bbox_object, obj["bbox_mode"], BoxMode.XYWH_ABS)
if "width" in record and "height" in record and (not valid_bbox(bbox_object, record["width"], record["height"])): if record.get("width") and record.get("height") and not valid_bbox(bbox_object, record["width"], record["height"]):
num_instances_without_valid_bounding_box += 1 num_instances_without_valid_bounding_box += 1
continue continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment