コード例 #1
0
def register_json_datasets():
    json_dataset_names = [
        os.path.splitext(filename)[0] for filename in os.listdir(
            get_dir_path(D2GO_DATASETS_BASE_MODULE.replace(".", "/")))
        if filename.startswith("json_dataset_")
    ]
    json_dataset_names = [
        x for x in json_dataset_names if x not in [
            "json_dataset_lvis",
            "json_dataset_oculus_external",
            "json_dataset_people_ai_foot_tracking",
        ]
    ]

    # load all splits from json datasets
    all_splits = {}
    for dataset in json_dataset_names:
        module = _import_dataset(dataset)
        assert (len(set(all_splits).intersection(set(module.DATASETS))) == 0
                ), "Name confliction when loading {}".format(dataset)
        all_splits.update(module.DATASETS)

    # register all splits
    for split_name in all_splits:
        split_dict = all_splits[split_name]
        register_dataset_split(split_name, split_dict)
コード例 #2
0
def register_builtin_datasets():
    builtin_dataset_names = [
        os.path.splitext(filename)[0] for filename in os.listdir(
            get_dir_path(D2GO_DATASETS_BASE_MODULE.replace(".", "/")))
        if filename.startswith("builtin_dataset_")
    ]
    for dataset in builtin_dataset_names:
        _import_dataset(dataset)