GithubHelp home page GithubHelp logo

hendriks73 / directional_cnns Goto Github PK

View Code? Open in Web Editor NEW
32.0 2.0 3.0 225 KB

Source code repository for the SMC paper "Musical Tempo and Key Estimation using Convolutional Neural Networks with Directional Filters".

License: Other

Python 95.84% Shell 4.16%
ml cnn music tempo key classification keras

directional_cnns's Introduction

CC BY 3.0

Directional CNNs

This repository accompanies the paper Musical Tempo and Key Estimation using Convolutional Neural Networks with Directional Filters in order to improve reproducibility of the reported results.

If you just want to estimate tempo or key values using models from the paper, please take a look at the tempo-cnn and key-cnn repos. They hosts pre-trained models.

Audio Files

Unfortunately, because of size limitations imposed by GitHub as well as copyright issues, this repository does not contain all audio samples or extracted features. But you can download those and extract them yourself.

Download links:

Should you use any of the datasets in your academic work, please cite the corresponding publications.

Annotations

All necessary ground truth annotations are in the annotations folder. For easy parsing they are formatted in a simple tab separated values (.tsv) format, with columns id \t bpm \t key \t genre \n. The class GroundTruth is capable of reading and interpreting these files.

Installation

In a clean Python 3.5/3.6 environment:

git clone https:/github.com/hendriks73/directional_cnns.git
cd directional_cnns
python setup.py install

Feature Extraction

To extract features, you can use the code in feature_extraction.py or the command line script mentioned below. Depending on how you define sample identifiers, you may need to make some manual adjustments. The created .joblib files are simple dictionaries, containing strings as keys and a spectrograms as values. Note that the extracted spectrograms for the key and the tempo task differ (CQT vs Mel).

After installation, you may run the extraction using the following command line script:

directional_cnn_extraction -a AUDIO_FILES_FOLDER [-g GROUND_TRUTH.tsv]

The ground truth file is optional. If given, only files that also occur in the ground truth are added to the created feature .joblib files.

Running

You can run the code either locally or on Google ML Engine.

Local

Running this locally only makes sense on a GPU and even then it will take very long.

To run the training/reporting locally, you can execute the script training.py or the command line script mentioned below with the following arguments (example for key):

--job-dir=./
--model-dir=./
--train-file=annotations/key_train.tsv --valid-file=annotations/key_valid.tsv
--test-files=annotations/giantsteps-key.tsv,annotations/gtzan_key.tsv,annotations/lmd_key_test.tsv
--feature-files=features/giantsteps_key.joblib,features/mtg_tempo_key.joblib,features/gtzan_key.joblib,features/lmd_key.joblib

After installation, you may run the training code using the following command line script:

directional_cnn_training [arguments]

Remote

To run the training/reporting remotely on Google ML Engine, you first need to sign up, upload all necessary feature- and annotation-files to Google storage and then adapt the provided scripts trainandpredict_key_ml_engine.sh and trainandpredict_tempo_ml_engine.sh accordingly.

License

This repository is licensed under CC BY 3.0. For attribution, please cite:

Hendrik Schreiber and Meinard Müller, Musical Tempo and Key Estimation using Convolutional Neural Networks with Directional Filters, In Proceedings of the Sound and Music Computing Conference (SMC), Málaga, Spain, May 2019.

directional_cnns's People

Contributors

hendriks73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.