def load_train_dev_test_annotations(): config_dir = get_config_dir() if not DATA_6000: data = load_json(os.path.join(config_dir, "annotation_results.json")) return data["train"], data["dev"], data["test"] else: train_data = load_json(os.path.join(config_dir, "train_annotations_6000.json")) dev_data = load_json(os.path.join(config_dir, "dev_annotations_6000.json")) test_data = load_json(os.path.join(config_dir, "test_annotations_6000.json")) return train_data, dev_data, test_data
def load_path(env_id, anno=True): anno_curve_path = paths.get_anno_curve_path(env_id) if os.path.isfile(anno_curve_path) and anno: path = load_json(anno_curve_path) else: path = load_json(paths.get_curve_path(env_id)) if path is None: print("Ground truth path not found for env: " + str(env_id)) return path x_arr = path['x_array'] y_arr = path['z_array'] path = np.asarray(list(zip(x_arr, y_arr))) return path
def load_params(setup_name): pydir = get_param_server_dir() paramsdir = os.path.join(pydir, "run_params") paramsname = setup_name + ".json" paramsfile = os.path.join(paramsdir, paramsname) params = load_json(paramsfile) return params
def load_train_dev_test_annotations(): config_dir = get_config_dir() anno_set = P.get_current_parameters()["Environment"].get("annotation_set") if anno_set == "7000": train_data = load_json( os.path.join(config_dir, "train_annotations_7000.json")) dev_data = load_json( os.path.join(config_dir, "dev_annotations_7000.json")) test_data = load_json( os.path.join(config_dir, "test_annotations_7000.json")) return train_data, dev_data, test_data elif anno_set == "6000": train_data = load_json( os.path.join(config_dir, "train_annotations_6000.json")) dev_data = load_json( os.path.join(config_dir, "dev_annotations_6000.json")) test_data = load_json( os.path.join(config_dir, "test_annotations_6000.json")) return train_data, dev_data, test_data elif anno_set == "4000": data = load_json(os.path.join(config_dir, "annotation_results.json")) return data["train"], data["dev"], data["test"] else: raise ValueError( f"Unknown annotation set: {anno_set}. Expected one of: 4000, 6000, 7000" )
def load_env_split(): path = paths.get_env_split_path() split = load_json(path) return split