Git Product home page Git Product logo

dl4mir's Introduction

dl4mir: A Tutorial on Deep Learning for MIR

by Keunwoo Choi ([email protected])

This is a repo for my tutorial paper; A Tutorial on Deep Learning for Music Information Retrieval.

Tutorials

  1. Example 1: Pitch detector with a dense layer
  2. Example 2: Chord recogniser with a convnet
  3. Example 3: Setup config.json
  4. Example 4: download and preprocess
  5. Real examples with real datasets! * Example 5-1: Time-varying classification example using Jamendo dataset * Example 5-2: Time-invariant classification example using FMA dataset

Prerequisites

$ pip install -r requirements.txt
$ git clone https://github.com/keunwoochoi/kapre.git
$ cd kapre
$ python setup.py install

to install

  • Librosa, Keras, Numpy, Matplotlib, Future
  • kapre

Notes

  • Datasets is removed from Kapre and the codes are directly imported into here.

Datasets

Dataset management

  • GTZan: (30s, 10 genres, 1,000 mp3)
  • MagnaTagATune: (29s, 188 tags, 25,880 mp3) for tagging and triplet similarity
  • MusicNet: (full length 330 classicals music, note-wise annotations)
  • FMA: small/medium/large/full collections, up to 100+K songs from free music archieve, for genre classification. With genre hierarchy, pre-computed features, splits, etc.
  • Jamendo: 61/16/24 songs for vocal activity detection

Some links

  • Repo
  • Slides
    • Deep Neural Networks in MIR: A tutorial focusing on feature learning, beat/rhythm analysis, structure analysis. Also a nice literature overview including publications by year, conference, task, network types, input representations, frame work, etc. By Meinard Muller et al.
    • DL in music informatics: ISMIR 2014 tutorial.
  • Documents, books
    • Deep learning book: The first deep learning textbook. by Ian Goodfellow and Yoshua Bengio and Aaron Courville.
  • Online

Cite?

@article{choi2017tutorial,
  title={A Tutorial on Deep Learning for Music Information Retrieval},
  author={Choi, Keunwoo and Fazekas, Gy{\"o}rgy and Cho, Kyunghyun and Sandler, Mark},
  journal={arXiv:1709.04396},
  year={2017}
}

Or visit the paper page on Google scholar for potential updates.

dl4mir's People

Contributors

keunwoochoi avatar lvaleriu 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  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  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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dl4mir's Issues

Cannot download FMA dataset.

When running python main_preprocess.py fma, the following error occurs:

FileNotFoundError: File b'dataset_download/fma/fma_metadata/tracks.csv' does not exist

Following is the full error message.

Traceback (most recent call last):
  File "main_preprocess.py", line 95, in <module>
    main(sys.argv[1])
  File "main_preprocess.py", line 77, in main
    prep_fma_small()
  File "main_preprocess.py", line 46, in prep_fma_small
    tracks = pd.read_csv(os.path.join(DIR_FMA_CSV, 'tracks.csv'), index_col=0, header=[0, 1])
  File "/home/kehops/dl4mir/venv/lib/python3.5/site-packages/pandas/io/parsers.py", line 705, in parser_f
    return _read(filepath_or_buffer, kwds)
  File "/home/kehops/dl4mir/venv/lib/python3.5/site-packages/pandas/io/parsers.py", line 445, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/home/kehops/dl4mir/venv/lib/python3.5/site-packages/pandas/io/parsers.py", line 814, in __init__
    self._make_engine(self.engine)
  File "/home/kehops/dl4mir/venv/lib/python3.5/site-packages/pandas/io/parsers.py", line 1045, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "/home/kehops/dl4mir/venv/lib/python3.5/site-packages/pandas/io/parsers.py", line 1684, in __init__
    self._reader = parsers.TextReader(src, **kwds)
  File "pandas/_libs/parsers.pyx", line 391, in pandas._libs.parsers.TextReader.__cinit__
  File "pandas/_libs/parsers.pyx", line 710, in pandas._libs.parsers.TextReader._setup_parser_source
  FileNotFoundError: File b'dataset_download/fma/fma_metadata/tracks.csv' does not exist

Should I download tracks.csv from separate source?

Example_5.1 - Predicting an entire song & Data generator details

While trying to visualize the predictions on this example, I am having difficulties understanding the data_gen() function and y_sample_to_frame().

  1. From what I read, a data generator on image processing has the purpose of providing smaller chunks of the data. Is there any recommended way to predict an entire song?

1.1. On a test data, of one song.
n_hop = 256
nsp_y = 5637632
I end up receiving 20 chunks of len 22022, which is not equivalent to the entire song.
Shouldn't I need 256 (5637632// 256) of those?

1.2 Using predict_generator returns only 22022 predictions... which leads me back to question 1

  1. On y_sample_to_frame().
n_hop = N_HOP
nsp_y = len(y)
ret = np.array([np.round(np.mean(y[max(0, (i - 1) * n_hop): min(nsp_y, (i + 1) * n_hop)])) \
                    for i in range(nsp_y // n_hop)], dtype=np.int)

Could you provide some comments on line 3?

In fact, I am trying to modify your example and see how it performs on SALAMI dataset. But it seems that the understanding of this two functions is fundamental. I have found relatively less information about the pre-processing of data for music structure analysis.
Sorry if my questions are not very clearly formulated, any extra information or source would be helpful.
Thanks in advance

Typos and fix suggestions in Example 1 notebook.

Thx for the awesome tutorial ๐Ÿ‘
I have run it on my own, and found some typos and python compatibility issues.

  1. this is probably 12 output nodes?

image

  1. 432 = 36 x 12, 36 x 12 + 12

image

  1. next() in iters as been renamed to __next__() in python 3. If proceeded with this, keras model would give DataGen is not iterable error.

image

I have tested this with Keras==2.0.9

  1. Similarly, calling next iteration have been changed in python3.

image

All datagen.next() had to be modified to next(datagen) in this cell.

AttributeError: module 'kapre' has no attribute 'datasets'

Hi,

I downloaded and placed jamendo dataset in dataset_download/jamendo.
When I run

python main_preprocess.py jamendo

I am getting the following error

Traceback (most recent call last):
File "main_preprocess.py", line 95, in
main(sys.argv[1])
File "main_preprocess.py", line 79, in main
prep_jamendo()
File "main_preprocess.py", line 62, in prep_jamendo
srcs_sets, ys_sets = kapre.datasets.load_jamendo(save_path=DIR_JAMENDO_DOWNLOAD,
AttributeError: module 'kapre' has no attribute 'datasets'

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.