Skip to main content

A utility for wrapping the Free Spoken Digit Dataset into PyTorch-ready data set splits.

Project description

TorchFSDD

A utility for wrapping the Free Spoken Digit Dataset into PyTorch-ready data set splits.

PyPI PyPI - Python Version PyPI - License Read The Docs - Documentation

About

The Free Spoken Digit Dataset is an open data set consisting of audio recordings of various individuals speaking the digits from 0-9, with 50 recordings of each digit per individual.

The data set can be though of as an audio version of the popular MNIST data set which consists of hand-written digits. However, the fact that the data consists of recordings of different length makes it more challenging to deal with than the fixed-size images of MNIST.

Models based on recurrent neural networks that can be implemented in PyTorch are a common approach for this task, and TorchFSDD aims to provide an interface to FSDD for such neural networks in PyTorch, by providing a torch.utils.data.Dataset wrapper that is ready to be used with a torch.utils.data.DataLoader.

Build status

master dev
Travis Build (Master) Travis Build (Development)

Examples

from torchfsdd import TorchFSDDGenerator, TrimSilence
from torchaudio.transforms import MFCC
from torchvision.transforms import Compose

# Create a transformation pipeline to apply to the recordings
transforms = Compose([
    TrimSilence(threshold=1e-6),
    MFCC(sample_rate=8e3, n_mfcc=13)
])

# Fetch the latest version of FSDD and initialize a generator with those files
fsdd = TorchFSDDGenerator(version='master', transforms=transforms)

# Create a Torch dataset for the entire dataset from the generator
full_set = fsdd.full()
# Create two Torch datasets for a train-test split from the generator
train_set, test_set = fsdd.train_test_split(test_size=0.1)
# Create three Torch datasets for a train-validation-test split from the generator
train_set, val_set, test_set = fsdd.train_val_test_split(test_size=0.15, val_size=0.15)

A more complete example can be found here, showing how TorchFSDD can be used to train a neural network.

Installation and Usage

You can install TorchFSDD using pip.

pip install torchfsdd

Note: TorchFSDD assumes you have the following packages already installed (along with Python v3.6+).

Since there are many different possible configurations when installing PyTorch (e.g. CPU or GPU, CUDA version), we leave this up to the user instead of specifying particular binaries to install alongside TorchFSDD.

Make sure you have torch and torchaudio versions that are compatible!

If you really wish to install torch and torchaudio together with TorchFSDD automatically, the following will install CPU-only versions of both dependencies.

pip install torchfsdd[torch]

Documentation

Documentation for the package is available on Read The Docs.

Contributors

All contributions to this repository are greatly appreciated. Contribution guidelines can be found here.

Edwin Onuonga
Edwin Onuonga

✉️ 🌍

TorchFSDD © 2021-2022, Edwin Onuonga - Released under the MIT License.
Authored and maintained by Edwin Onuonga.

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

torchfsdd-0.1.2.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file torchfsdd-0.1.2.tar.gz.

File metadata

  • Download URL: torchfsdd-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for torchfsdd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 92903f5e1909264a4b3c02fcff59cdd1da082c326d60f13e8f689d3c376831ad
MD5 86663ff11cc7f24d6f375a9aab63bdc4
BLAKE2b-256 51e033c7d3a3337c2292ce8ba11178378501a8a373111b5cf18dd6167ede3278

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