Audio dataloaders
Project description
Audidata
Audidata is a toolkit that allows users to easily load audio datasets in less than 5 minutes. Audidata supports music, audio, and speech datasets. Audidata also provides samplers, tokenizers, and transforms. Users can also create their own datasets inside audidata.
0. Installation
python >= 3.9 is required.
Method 1. Download source code (Recomended for developers)
Download source code allows users to edit and create new features for audidata easily.
git clone https://github.com/AudioFans/audidata
Set environment (for each terminal).
cd audidata
export PYTHONPATH=`pwd` # Export environment path so that users can import audidata anywhere in the terminal.
Method 2. Install via pip (Developing)
pip install git+https://github.com/AudioFans/audidata.git@main
1. Example
Users must download the dataset manually. We provided how the datasets should be structured in each dataset file. Here is an example of loading GTZAN dataset.
from audidata.datasets import GTZAN
root = "/datasets/gtzan"
dataset = GTZAN(root=root, split="train", test_fold=0, sr=16000)
print(dataset[0])
Output:
{'audio_path': '/datasets/gtzan/genres/blues/blues.00010.au',
'audio': array([[ 0.11234417, 0.13617763, 0.10609552, ..., -0.06634186, -0.07007345, -0.07359146]], dtype=float32),
'target': array([1., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32),
'label': 'blues'}
For more examples please see audidata/examples. For example, users can run the following example script to concatenate multiple datasets:
python examples/test_concat_datasets.py
Output:
0 dict_keys(['dataset_name', 'audio_path', 'bass', 'drums', 'other', 'vocals', 'accompaniment', 'mixture']) 1 dict_keys(['dataset_name', 'audio_path', 'audio', 'target', 'label']) 2 dict_keys(['dataset_name', 'audio_path', 'bass', 'drums', 'other', 'vocals', 'accompaniment', 'mixture']) 3 dict_keys(['dataset_name', 'audio_path', 'audio', 'target', 'label'])
Repo structure
audidata ├── audidata │ ├── collate │ │ ├── base.py │ │ └── ... │ ├── datasets │ │ ├── gtzan.py │ │ └── ... │ ├── io │ │ ├── audio.py │ │ └── ... │ ├── samplers │ │ ├── multi_datasets.py │ │ └── ... │ ├── tokenizers │ │ ├── base.py │ │ └── ... │ └── transforms │ ├── midi.py │ └── ... ├── examples │ ├── test_concat_datasets.py │ └── ... ├── LICENSE ├── README.md └── pyproject.toml
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file audidata-0.0.1.tar.gz.
File metadata
- Download URL: audidata-0.0.1.tar.gz
- Upload date:
- Size: 35.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab23f18d20b5a24192404d6d098fd87a919ada391f1ce32deb7c8c552852d536
|
|
| MD5 |
f54f2a87cb4f595bf8e8af1ab1fd19ab
|
|
| BLAKE2b-256 |
c5c1fbc37796659bc53c6aa3de9d99d6648ad07fe9ee1262b9edc2e769fd3dec
|
File details
Details for the file audidata-0.0.1-py3-none-any.whl.
File metadata
- Download URL: audidata-0.0.1-py3-none-any.whl
- Upload date:
- Size: 61.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
598a75b7e531f6630e97d271dfa780fee1ef4e6739c50d84adef438a895d67b7
|
|
| MD5 |
9559989eecf46747f51caeb69a01c2e6
|
|
| BLAKE2b-256 |
0e566670c3be775d45889501e13ce2bfe64cb74bdd9aa8a67ca44f9f177ece9c
|