Unofficial PyTorch dataset for Slakh
Project description
Slakh PyTorch Dataset
Unofficial PyTorch dataset for Slakh.
This project is a work in progress, expect breaking changes!
Roadmap
Automatic music transcription (AMT) usecase with audio and labels
- Specify dataset split (
original,splits_v2,redux) - Add new splits (
redux_no_pitch_bend, ...) (Should also be filed upstream) (implemented byskip_pitch_bend_tracks) - Load audio
mix.flac(all the instruments comined) - Load individual audio mixes (need to combine audio in a streaming fashion)
- Specify
train,validationortestgroup - Choose sequence length
- Reproducable load sequences (usefull for validation group to get consistent results)
- Add more instruments (
eletric-bass,piano,guitar, ...) - Choose between having audio in memory or stream from disk (solved by
max_files_in_memory) - Add to pip
Audio source separation usecase with different audio mixes
- List to come
Usage
-
Download the Slakh dataset (see the official website). It's about 100GB compressed so expect using some time on this point.
-
Install the Python package with pip:
pip install slakh-dataset
-
Convert the audio to 16 kHz (see https://github.com/ethman/slakh-utils)
-
You can use the dataset (AMT usecase):
from torch.utils.data import DataLoader
from slakh_dataset import SlakhAmtDataset
dataset = SlakhAmtDataset(
path='path/to/slakh-16khz-folder'
split='redux', # 'splits_v2','redux-no-pitch-bend'
audio='mix.flac', # 'individual'
label_instruments='electric-bass', # or `label_midi_programs`
# label_midi_programs=[33, 34, 35, 36, 37],
groups=['train'],
skip_pitch_bend_tracks=True,
sequence_length=327680,
max_files_in_memory=200,
)
batch_size = 8
loader = DataLoader(dataset, batch_size, shuffle=True, drop_last=True)
# train model on dataset...
Acknowledgement
-
This code is based on the dataset in Onset and Frames by Jong Wook Kim which is MIT Lisenced.
-
Slakh http://www.slakh.com/
Project details
Release history Release notifications | RSS feed
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 slakh-dataset-0.1.25.tar.gz.
File metadata
- Download URL: slakh-dataset-0.1.25.tar.gz
- Upload date:
- Size: 49.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.7.2 Darwin/20.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b8030cffc7458f320fe268862436d9dec8161ad7e3cfa4e453569dfbf9948c9
|
|
| MD5 |
3174ffd839f9930c8ac99765506d1383
|
|
| BLAKE2b-256 |
de51c8d611c59ea934ace0f36a30fc6c1dab312b9b4cb4be2b1aef001c4e06ef
|
File details
Details for the file slakh_dataset-0.1.25-py3-none-any.whl.
File metadata
- Download URL: slakh_dataset-0.1.25-py3-none-any.whl
- Upload date:
- Size: 50.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.7.2 Darwin/20.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9af2db7a54b10238db2f5016a396d22a54258cebfe1fb056761a8be3657aa6ee
|
|
| MD5 |
675e18c07b6a250e7ceaef7a3b356ef4
|
|
| BLAKE2b-256 |
8739ed0db376a74c4d4c66f4c16e7e0d6597ff3d95636094287acc97ced0c5df
|