Skip to content

Commit 99d8376

Browse files
authored
ensure items in dataset have the same order across multi machine (open-mmlab#780)
1 parent f72727c commit 99d8376

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mmseg/datasets/custom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def load_annotations(self, img_dir, img_suffix, ann_dir, seg_map_suffix,
152152
seg_map = img.replace(img_suffix, seg_map_suffix)
153153
img_info['ann'] = dict(seg_map=seg_map)
154154
img_infos.append(img_info)
155+
img_infos = sorted(img_infos, key=lambda x: x['filename'])
155156

156157
print_log(f'Loaded {len(img_infos)} images', logger=get_root_logger())
157158
return img_infos

0 commit comments

Comments
 (0)