def __init__(self, path, *args, **kwargs): if isinstance(path, str): path = Path('metadata', 'datasets', f'{path}.yaml') assert path.exists() super(DatasetMeta, self).__init__(path=path, *args, **kwargs) if 'fs' not in self.meta: logger.exception( KeyError(f'The file {path} does not contain the key "fs"')) self.inv_lookup = dict() for task_name in self.meta['tasks'].keys(): task_label_file = metadata_path('tasks', f'{task_name}.yaml') task_labels = load_yaml(task_label_file) dataset_labels = self.meta['tasks'][task_name]['target_transform'] if not set(dataset_labels.keys()).issubset(task_labels.keys()): logger.exception( ValueError( f'The following labels from dataset {path} are not accounted for in {task_label_file}: ' f'{set(dataset_labels.keys()).difference(task_labels.keys())}' )) self.inv_lookup[task_name] = { dataset_labels[kk]: kk for kk, vv in dataset_labels.items() }
def __init__(self, path, *args, **kwargs): super(ModalityMeta, self).__init__(name=metadata_path('modality.yaml'), *args, **kwargs)
def __init__(self, path, *args, **kwargs): super(PlacementMeta, self).__init__(name=metadata_path('placement.yaml'), *args, **kwargs)
def __init__(self, path, *args, **kwargs): super(LocalisationMeta, self).__init__(path=metadata_path('tasks', 'localisation.yaml'), *args, **kwargs)
def __init__(self, path, *args, **kwargs): super(HARMeta, self).__init__(path=metadata_path('tasks', 'har.yaml'), *args, **kwargs)
def __init__(self, path, *args, **kwargs): super(LocalisationMeta, self).__init__( path=metadata_path("tasks", "localisation.yaml"), *args, **kwargs )
def __init__(self, path, *args, **kwargs): super(HARMeta, self).__init__(path=metadata_path("tasks", "har.yaml"), *args, **kwargs)