vak.datapipes.parametric_umap.metadata.Metadata¶
- class vak.datapipes.parametric_umap.metadata.Metadata(dataset_csv_filename, shape, audio_format=None)[source]¶
Bases:
object
A dataclass that represents metadata associated with a dataset that was generated by
vak.core.prep.prep()
.- dataset_csv_filename¶
Name of csv file representing the source files in the dataset. Csv file will be located in root of directory representing dataset, so only the filename is given.
- Type:
- __init__(dataset_csv_filename, shape, audio_format=None) None ¶
Method generated by attrs for class Metadata.
Methods
__init__
(dataset_csv_filename, shape[, ...])Method generated by attrs for class Metadata.
from_dataset_path
(dataset_path)from_path
(json_path)Load dataset metadata from a json file.
is_valid_shape
(attribute, value)to_json
(dataset_path)Dump dataset metadata to a json file.
Attributes
shape
METADATA_JSON_FILENAME
- classmethod from_path(json_path: str | Path)[source]¶
Load dataset metadata from a json file.
Class method that returns an instance of
FrameClassificationDatatsetMetadata
.- Parameters:
json_path (string, pathlib.Path) – Path to a ‘metadata.json’ file created by
vak.core.prep.prep()
when generating a dataset.- Returns:
metadata – Instance of
FrameClassificationDatatsetMetadata
with metadata loaded from json file.- Return type:
vak.datasets.frame_classification.FrameClassificationDatatsetMetadata
- to_json(dataset_path: str | Path) None [source]¶
Dump dataset metadata to a json file.
This method is called by
vak.core.prep.prep()
after it generates a dataset and then creates an instance ofFrameClassificationDatatsetMetadata
with metadata about that dataset.- Parameters:
dataset_path (string, pathlib.Path) – Path to root of a directory representing a dataset generated by
vak.core.prep.prep()
. where ‘metadata.json’ file should be saved.