Skip to content
Snippets Groups Projects
Commit 6dc3f7bd authored by uni19's avatar uni19 Committed by GitHub
Browse files

ensure items in dataset have the same order across multi machine (#780)

parent ebf3c084
No related branches found
No related tags found
No related merge requests found
...@@ -152,6 +152,7 @@ class CustomDataset(Dataset): ...@@ -152,6 +152,7 @@ class CustomDataset(Dataset):
seg_map = img.replace(img_suffix, seg_map_suffix) seg_map = img.replace(img_suffix, seg_map_suffix)
img_info['ann'] = dict(seg_map=seg_map) img_info['ann'] = dict(seg_map=seg_map)
img_infos.append(img_info) img_infos.append(img_info)
img_infos = sorted(img_infos, key=lambda x: x['filename'])
print_log(f'Loaded {len(img_infos)} images', logger=get_root_logger()) print_log(f'Loaded {len(img_infos)} images', logger=get_root_logger())
return img_infos return img_infos
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment