Dataset over a directory tree of the form root_dir/<class_name>/<audio_file.wav>, structurally identical to ImageFolderDataset (Phase 2): sorted subdirectory names are classes, sorted filenames within each are samples, decoded lazily per get() via WavReader.
More...
#include <audio_folder_dataset.hpp>
Dataset over a directory tree of the form root_dir/<class_name>/<audio_file.wav>, structurally identical to ImageFolderDataset (Phase 2): sorted subdirectory names are classes, sorted filenames within each are samples, decoded lazily per get() via WavReader.
◆ AudioFolderDataset()
| pulsatrix::AudioFolderDataset::AudioFolderDataset |
( |
const std::string & |
root_dir, |
|
|
DeviceBackend * |
backend |
|
) |
| |
- Exceptions
-
| std::runtime_error | if root_dir doesn't exist/isn't a directory, or contains no class subdirectories. |
◆ classes()
| const std::vector< std::string > & pulsatrix::AudioFolderDataset::classes |
( |
| ) |
const |
|
inline |
Sorted class names; classes()[i] is the human-readable name for label i.
◆ get()
| Sample pulsatrix::AudioFolderDataset::get |
( |
int64_t |
index | ) |
const |
|
overridevirtual |
- Exceptions
-
| std::out_of_range | if index is out of bounds. |
- Returns
- {waveform (1,channels,num_samples), label (1,) float, the class's sorted-order index}.
Implements pulsatrix::Dataset.
◆ size()
| int64_t pulsatrix::AudioFolderDataset::size |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following file: