sbss.common.datasets.WavHDF5Dataset¶
- class sbss.common.datasets.WavHDF5Dataset(dataset_path: Path | str, duration: int | None = None, sr: int | None = None, randperm_mic: bool = True, grp_list: Path | str | list[str] | None = None)[source]¶
Dataset class for loading and preprocessing multi-channel audio data stored in HDF5 format.
This dataset wraps an
HDF5Datasetusing a caching layer for faster access. It supports random microphone permutation for data augmentation and optional random cropping of the waveform based on the specified duration and sampling rate.- Parameters:
dataset_path (Path | str) – Path to the HDF5 dataset directory or file.
duration (int | None, optional) – Target duration of audio clips in seconds. If None, the full audio is used.
sr (int | None, optional) – Sampling rate used to calculate the crop length when
durationis specified.randperm_mic (bool, optional) – Whether to randomly permute microphone channels. Defaults to True.
grp_list (Path | str | list[str] | None, optional) – List or path specifying group names to load from the HDF5 dataset. If None, all groups are used.
- Returns:
A PyTorch dataset yielding preprocessed multi-channel waveforms.
- Return type:
torch.utils.data.Dataset
- __init__(dataset_path: Path | str, duration: int | None = None, sr: int | None = None, randperm_mic: bool = True, grp_list: Path | str | list[str] | None = None) None[source]¶
Methods
__init__(dataset_path[, duration, sr, ...])