Skip to main content

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 by skip_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, validation or test group
  • 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

  1. Download the Slakh dataset (see the official website). It's about 100GB compressed so expect using some time on this point.

  2. Install the Python package with pip:

pip install slakh-dataset
  1. Convert the audio to 16 kHz (see https://github.com/ethman/slakh-utils)

  2. 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

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

slakh-dataset-0.1.24.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

slakh_dataset-0.1.24-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file slakh-dataset-0.1.24.tar.gz.

File metadata

  • Download URL: slakh-dataset-0.1.24.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.7.2 Darwin/20.1.0

File hashes

Hashes for slakh-dataset-0.1.24.tar.gz
Algorithm Hash digest
SHA256 6c9ddc4cfda1e376f88fb91cab71e76ace3d904df848c7049c59ba7b9ad19842
MD5 56a85774c7c1f81d80c9f47b1d1af093
BLAKE2b-256 c3e57cdf68588bd0dc7003b4c2164b66c4db20dc6ee05d580d716d7c7f4521b0

See more details on using hashes here.

File details

Details for the file slakh_dataset-0.1.24-py3-none-any.whl.

File metadata

  • Download URL: slakh_dataset-0.1.24-py3-none-any.whl
  • Upload date:
  • Size: 49.9 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

Hashes for slakh_dataset-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 afd47073705c0b11c75027bb97c510ba3dd6fa05bcf7fc7762d4232a63cff742
MD5 deabb90691ed094ede67e6b5101a418f
BLAKE2b-256 17c6dc4166d77f1cad74d24f5dc03f42a3ad9559aff4b4229c0ce3075be85fd8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page