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 # and the values are a list of object with the following properties: # [patch_top, patch_left, patch_height, patch_width, label] import torch class VsNetImageLabeler: def __init__(self, label_file): if not isinstance(label_file, list): label_file = [label_file] self.labeled_images = {} for lfil in label_file: with open(lfil, "r") as read_file: self.label_file = label_file # Format of JSON file: # "key_binding" { # "label": "