diff --git a/codes/data/image_folder_dataset.py b/codes/data/image_folder_dataset.py index 4279842d..9817cb62 100644 --- a/codes/data/image_folder_dataset.py +++ b/codes/data/image_folder_dataset.py @@ -134,7 +134,7 @@ if __name__ == '__main__': 'corrupt_before_downsize': True, 'labeler': { 'type': 'patch_labels', - 'label_file': 'F:\\4k6k\\datasets\\ns_images\\512_unsupervised\\categories.json' + 'label_file': 'F:\\4k6k\\datasets\\ns_images\\512_unsupervised\\categories_new.json' } } diff --git a/codes/data/image_label_parser.py b/codes/data/image_label_parser.py index f8d55c84..bc9a7a28 100644 --- a/codes/data/image_label_parser.py +++ b/codes/data/image_label_parser.py @@ -1,4 +1,5 @@ import os +from collections import OrderedDict import orjson as json # Given a JSON file produced by the VS.net image labeler utility, produces a dict where the keys are image file names @@ -9,39 +10,40 @@ import torch class VsNetImageLabeler: def __init__(self, label_file): - with open(label_file, "r") as read_file: - # Format of JSON file: - # "" { - # "label": "