Ejemplo n.º 1
0
def register_mot(basedir):
    basedir = os.path.expanduser(basedir)
    classes_path = os.path.join(basedir, "classes.json")
    class_names = ["BG"] + get_class_names(classes_path)
    for split in ["train", "val"]:
        name = "mot_" + split
        DatasetRegistry.register(name,
                                 lambda x=split: MotDataset(basedir, split=x))
        DatasetRegistry.register_metadata(name, "class_names", class_names)
Ejemplo n.º 2
0
def register_mot(
    base_dir: str,
    dataset_file: str = "dataset.json",
    classes_file: str = "classes.json",
    images_folder: str = "Images_md5"
):
    """Register a dataset to the registry. See `MotDataset` for more details on arguments.
    """
    base_dir = os.path.expanduser(base_dir)
    classes_path = os.path.join(base_dir, "classes.json")
    class_names = ["BG"] + get_class_names(classes_path)
    for split in ["train", "val"]:
        name = "mot_" + split
        DatasetRegistry.register(name, lambda x=split: MotDataset(base_dir, split=x))
        DatasetRegistry.register_metadata(name, "class_names", class_names)