Skip to content

Commit

Permalink
fix remove_invalid_coco_results (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon authored Sep 12, 2021
1 parent a0fa800 commit 7733fc3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sahi/utils/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -2140,7 +2140,6 @@ def remove_invalid_coco_results(result_list_or_path: Union[List, str], dataset_d
Removes invalid predictions from coco result such as:
- negative bbox value
- extreme bbox value
- when x2/y2 is smaller than x1/y1 in bbox
Args:
result_list_or_path: path or list for coco result json
Expand Down Expand Up @@ -2177,7 +2176,7 @@ def remove_invalid_coco_results(result_list_or_path: Union[List, str], dataset_d
if not bbox:
print("ignoring invalid prediction with empty bbox")
continue
if bbox[0] > bbox[2] or bbox[1] > bbox[3] or bbox[0] < 0 or bbox[1] < 0 or bbox[2] < 0 or bbox[3] < 0:
if bbox[0] < 0 or bbox[1] < 0 or bbox[2] < 0 or bbox[3] < 0:
print(f"ignoring invalid prediction with bbox: {bbox}")
continue
if dataset_dict_or_path is not None:
Expand Down

0 comments on commit 7733fc3

Please sign in to comment.