Git Product home page Git Product logo

torch-fsdd's Introduction

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 thought 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 durations makes it more challenging to deal with than the fixed-size images of MNIST.

TorchFSDD aims to provide an interface to FSDD for PyTorch model development, by providing a torch.utils.data.Dataset wrapper that is ready to be used with a torch.utils.data.DataLoader.

Build status

master dev
CircleCI Build (Master) CircleCI 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

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 versions 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]

Development

Please see the contribution guidelines to see installation instructions for contributing to this repository.

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.

eonu
eonu
black-puppydog
black-puppydog

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

torch-fsdd's People

Contributors

black-puppydog avatar eonu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

black-puppydog

torch-fsdd's Issues

Make it possible to apply separate transformations to data splits

Currently when we do the following, the same transformations are applied to the training, validation and test set.

transforms = Compose([...])
fsdd = TorchFSDDGenerator(version='master', transforms=transforms)
train_set, val_set, test_set = fsdd.train_val_test_split(test_size=0.15, val_size=0.15)

This obviously isn't ideal as there are some transformations (such as data augmentations) that you might want to apply to different splits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.