vak.prep.frame_classification.validators.validate_and_get_frame_dur#

vak.prep.frame_classification.validators.validate_and_get_frame_dur(dataset_df: DataFrame, input_type: str) float[source]#

Validate that there is a single, unique value for the frame duration for all samples (audio signals / spectrograms) in a dataset. If so, return that value.

The dataset is represented as a pandas DataFrame.

Parameters:
  • dataset_df (pandas.Dataframe) – A pandas.DataFrame created by vak.prep.spectrogram_dataset.prep_spectrogram_dataset() or vak.prep.audio_dataset.prep_audio_dataset().

  • input_type (str) – The type of input to the neural network model. One of {β€˜audio’, β€˜spect’}.

Returns:

frame_dur – The duration of a time bin in seconds for all spectrograms in the dataset.

Return type:

float