vak.cli.prep.prep#

vak.cli.prep.prep(toml_path)[source]#

Prepare datasets from vocalizations. Function called by command-line interface.

Parameters:

toml_path (str, pathlib.Path) – path to a configuration file in TOML format. Used to rewrite file with options determined by this function and needed for other functions

Notes

Saves a .csv file representing the dataset generated from data_dir.

Datasets are used to train neural networks that segment audio files into vocalizations, and then predict labels for those segments. The function also prepares datasets so neural networks can predict the segmentation and annotation of vocalizations in them. It can also split a dataset into training, validation, and test sets, e.g. for benchmarking different neural network architectures.

If the ‘purpose’ is set to ‘train’ or ‘learncurve’, and/or the duration of either the training or test set is provided, then the function attempts to split the dataset into training and test sets. A duration can also be specified for a validation set (used to measure performance during training). In these cases, the ‘split’ column in the .csv identifies which files (rows) belong to the training, test, and validation sets created from that Dataset.

If the ‘purpose’ is set to ‘predict’ or ‘eval’, or no durations for any of the training sets are specified, then the function assumes all the vocalizations constitute a single dataset, and for all rows the ‘split’ columns for that dataset will be ‘predict’ or ‘test’ (respectively).