Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit b1f85d1

Browse files
committed
fix coco plotting geometry order
1 parent a29e829 commit b1f85d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/coco.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def coco_to_shapely(inpath_json: Union[Path, str],
109109
data = utils.other.load_json(inpath_json)
110110
if categories is not None:
111111
# Get image ids/file names that contain at least one annotation of the selected categories.
112-
image_ids = list(set([x['image_id'] for x in data['annotations'] if x['category_id'] in categories]))
112+
image_ids = sorted(list(set([x['image_id'] for x in data['annotations'] if x['category_id'] in categories])))
113113
else:
114-
image_ids = list(set([x['image_id'] for x in data['annotations']]))
114+
image_ids = sorted(list(set([x['image_id'] for x in data['annotations']])))
115115
file_names = [x['file_name'] for x in data['images'] if x['id'] in image_ids]
116116

117117
# Extract selected annotations per image.

0 commit comments

Comments
 (0)