Skip to main content

acids-dataset

Documentation Python PyTorch

Warning acids-dataset is still experimental, do not hesitate to open issues!

acids-dataset prepares audio data for generative models, such as RAVE and AFTER, and is open to custom use. It loads audio folders and gives PyTorch datasets and data loaders, with :

  • two modes sharing the same interface : online datasets, that read raw audio folders directly (no compilation step), and pre-processed datasets, compiled in an LMDB database for fast training ;
  • features, computed before-hand or on the fly : loudness, pitch, spectral, rhythmic, harmonic and spatial descriptors, neural embeddings, metadata extracted from file names... ;
  • flexible outputs (tuples, dicts, slices) and audio augmentations with probabilities, including spatial / ambisonic transforms ;
  • partitions (random, by file, by class, stratified over continuous features), class balancing, multi-dataset weighting and curriculum learning, compatible with distributed training and Lightning ;
  • TorchScript modules of features and transforms, to reuse them at inference time ;
  • a dataset browser and health reports to explore and check datasets ;
  • presets to share parsing settings between datasets, scripts and the command line.

Installation

pip install acids-dataset

Python 3.10 or above is required. Optional dependencies :

Extra Installs For
acids-dataset[ui] gradio, matplotlib the dataset browser
acids-dataset[pesto], [crepe], [pyworld] pesto-pitch, torchcrepe, pyworld additional pitch / F0 estimators (yin and pyin are available through librosa)

Audio is loaded with soundfile (wav, flac, aiff, ogg, opus, mp3, with sample-accurate partial loading), and with torchcodec (FFmpeg) for other formats (m4a, aac...).

Quick start

from acids_dataset.datasets import AudioDataset
from acids_dataset.features import Loudness

# a raw folder gives an online dataset ; a pre-processed folder gives a pre-processed one
dataset = AudioDataset("path/to/audio", sr=44100, chunk_length=131072, features=[Loudness()],
                       output_pattern="{waveform,loudness}")
partitions = dataset.split({"train": 0.9, "valid": 0.1}, features=["original_path"], seed=0)
loader = partitions["train"].get_loader(batch_size=16, num_workers=4)
batch = next(iter(loader))     # {"waveform": (16, 1, 131072), "loudness": (16,)}

To compile a dataset (and use it exactly the same way) :

acids-dataset preprocess --path path/to/audio --out path/to/compiled --preset rave --feature loudness
acids-dataset info --path path/to/compiled --health      # describe the dataset, and check its health
acids-dataset ui --path path/to/compiled                 # explore it in the browser

The command line also provides update (add features or files to a compiled dataset), add_embedding (embeddings of a TorchScript model) and presets. acids-dataset <command> --help lists the options of each command.

Documentation

The full documentation is on Read the Docs. It is written in docs/, with :

  • a step by step tutorial, from loading audio to training with Lightning ;
  • the user guide, by topic : datasets, loaders, features, augmentations, partitions, sampling, pre-processing, presets, command line, browser, extending the package ;
  • the API reference, generated from the code.

Additional tutorials are available as Jupyter notebooks in extras/.

To build the documentation locally :

pip install -e ".[docs]"    # or pip install -r docs/requirements.txt
mkdocs serve                # local preview at http://127.0.0.1:8000
mkdocs build --strict       # static site in site/

Development

pip install -e ".[ui]" pytest pytest-timeout gradio_client
pytest tests -m "not slow"     # fast suite (~10 minutes)
pytest tests -m slow           # long parametrized grids

tests/test_transforms.py has known failures (see TODO.md) and is not run in continuous integration. CI (.github/workflows/tests.yml) checks Python 3.10 compatibility with vermin, runs the fast suite on Python 3.10 to 3.13, and on Python 3.10 with the minimum versions of numpy, scipy, scikit-learn and librosa declared in pyproject.toml. See the development guide for details.

Contributors

Axel Chemla--Romeu-Santos and Nils Demerlé, at IRCAM (ACIDS team).

License

Creative Commons Attribution-NonCommercial 4.0 International.

Metadata

Release files for acids-dataset 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acids-dataset 0.2.0
File Size Uploaded Provenance Actions
acids_dataset-0.2.0.tar.gz 357.8 kB Without provenance Details for acids_dataset-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for acids-dataset 0.2.0
File Interpreter ABI Platform Actions
acids_dataset-0.2.0-py3-none-any.whl Python 3 none any Details for acids_dataset-0.2.0-py3-none-any.whl

Total release size: 680.4 kB

Release files / acids_dataset-0.2.0.tar.gz

Download URL acids_dataset-0.2.0.tar.gz
Size 357.8 kB
Tags Source
SHA-256 checksum
How to use checksums
60c28af6e06435b80b70d6b99c321358db0bdbffcbd9c62438c8b3c9b9a98a75
BLAKE2b-256 checksum
How to use checksums
567789fb668a9bab1d41222098759edb19baeb8877eb080cc610849c6de709b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / acids_dataset-0.2.0-py3-none-any.whl

Download URL acids_dataset-0.2.0-py3-none-any.whl
Size 322.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3345022a151c5adfc96a316abddcefca0ebf2bac3cf1184b6f74260bd328ff2c
BLAKE2b-256 checksum
How to use checksums
323c04eb30540cde924306c836d50cda1c748e059787fd646744bba292f76ef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for acids-dataset 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page