Coder Social home page Coder Social logo

melodyextraction_mcdnn's Introduction

README.txt

============================================================
** Contact Info 
============================================================
Sangeun Kum <[email protected]>
Changheun Oh <[email protected]>
Juhan Nam <[email protected]>

Korea Advanced Institute of Science and Technology 

============================================================
** Description 
============================================================
This is our submission to the 2016 MIREX melody extraction task.
The algorithm is a classification based approach using deep neural networks.
The file 'main.py' is the main function for calling the algorithm. 
It takes as parameter, input the full path string for the input file and output file.
If you want to know about this algorithms, 
please check https://wp.nyu.edu/ismir2016/wp-content/uploads/sites/2294/2016/07/119_Paper.pdf

============================================================
** Platform and Requirements
============================================================
1. OS : LINUX 

2. Programming language : Python 2.7

3. Python Library : 
  1) Keras (Deep Learning library for Theano)
    >> http://keras.io/
  
  2) Theano (Backend of Keras)
    >> http://deeplearning.net/software/theano/install.html#install
    
  3) Librosa (for audio analysis such as laod,STFT,resampling)  
    >> http://librosa.github.io/librosa/

  4) ffmpeg 
    >> https://www.ffmpeg.org/
    >> for install : brew install ffmpeg 

  5) Numpy, SciPy

4. Hardware
  1) GPU : GeForce GTX 980 
    >> https://developer.nvidia.com/cuda-toolkit

5. Expected runtime : 2~3 seconds/song 
     
============================================================
** Use 
============================================================
The algorithm is called as follows: 

(to call from the command line)
>>python main.py <parameter> <input path> <ouput path>
ex) >>python main.py 0.2 '/home/keums/Melody/dataset/adc2004_full_set/file/pop3.wav' './SAVE_RESULTS/pop3.txt'

or

(to call from the shell)
>>main(param = 0.2, PATH_LOAD_FILE='/home/keums/Melody/dataset/adc2004_full_set/file/pop4.wav', PATH_SAVE_FILE='./SAVE_RESULTS/pop4.txt')

** default param = 0.2, 
if the voice recall rate is low, increaing the param would be effective (0 <= param <= 1 ) 


melodyextraction_mcdnn's People

Contributors

keums avatar

Stargazers

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

Watchers

 avatar

melodyextraction_mcdnn's Issues

Can't load model weights

I'm using keras 2.2.4, and the code can't run. I found the model weights file in this repository has this architecture: (take _frames_11_note_res_1_drop_out_0.2_optimizer_rms_activation_relu_output_activation_sigmoid_Melody.hdf5 for example)

<HDF5 group "/layer_0" (2 members)>
('param_0', <HDF5 dataset "param_0": shape (2816, 512), type "<f4">)
('param_1', <HDF5 dataset "param_1": shape (512,), type "<f4">)
<HDF5 group "/layer_1" (0 members)>
<HDF5 group "/layer_10" (0 members)>
<HDF5 group "/layer_2" (0 members)>
<HDF5 group "/layer_3" (2 members)>
('param_0', <HDF5 dataset "param_0": shape (512, 512), type "<f4">)
('param_1', <HDF5 dataset "param_1": shape (512,), type "<f4">)
<HDF5 group "/layer_4" (0 members)>
<HDF5 group "/layer_5" (0 members)>
<HDF5 group "/layer_6" (2 members)>
('param_0', <HDF5 dataset "param_0": shape (512, 256), type "<f4">)
('param_1', <HDF5 dataset "param_1": shape (256,), type "<f4">)
<HDF5 group "/layer_7" (0 members)>
<HDF5 group "/layer_8" (0 members)>
<HDF5 group "/layer_9" (2 members)>
('param_0', <HDF5 dataset "param_0": shape (256, 41), type "<f4">)
('param_1', <HDF5 dataset "param_1": shape (41,), type "<f4">)

but the model created by the code has the architecture:

<HDF5 group "/activation_1" (0 members)>
<HDF5 group "/activation_2" (0 members)>
<HDF5 group "/activation_3" (0 members)>
<HDF5 group "/activation_4" (0 members)>
<HDF5 group "/dense_1" (1 members)>
('dense_1', <HDF5 group "/dense_1/dense_1" (2 members)>)
<HDF5 group "/dense_2" (1 members)>
('dense_2', <HDF5 group "/dense_2/dense_2" (2 members)>)
<HDF5 group "/dense_3" (1 members)>
('dense_3', <HDF5 group "/dense_3/dense_3" (2 members)>)
<HDF5 group "/dense_4" (1 members)>
('dense_4', <HDF5 group "/dense_4/dense_4" (2 members)>)
<HDF5 group "/dropout_1" (0 members)>
<HDF5 group "/dropout_2" (0 members)>
<HDF5 group "/dropout_3" (0 members)>

when running the code, keras would raise:
ValueError: You are trying to load a weight file containing 0 layers into a model with 4 layers.

There may be something wrong with the result

I did some modify so that the code could wrong.

  • in the MelodyExtraction_MCDNN.py, I modify the line where loads the weights file:
    model.load_weights(weight_file,by_name=True)

  • in the main.py, there is a bug
    TypeError: slice indices must be integers or None or have an __index__ method ,so I modify something as follow:
    `for i in range(y_predict_3rd.shape[0]):
    for j in range(y_predict_1st.shape[1]-1):
    y_predict_tmp_1_3[i,int(jratio_res_1_3):int(jratio_res_1_3+ratio_res_1_3)] = y_predict_1st[i,j]
    y_predict_tmp_1_3[i,-1] = y_predict_1st[i,-1]

    for i in range(y_predict_3rd.shape[0]):
    for j in range(y_predict_2nd.shape[1]-1):
    y_predict_tmp_2_3[i,int(jratio_res_2_3):int(jratio_res_2_3+ratio_res_2_3)] = y_predict_2nd[i,j]
    y_predict_tmp_2_3[i,-1] = y_predict_2nd[i,-1] `

After this ,the code works well. But the result txtfile looks strange:
0.000000 0.000000 0.010000 0.000000 0.020000 578.909109 0.030000 578.909109 0.040000 578.909109 0.050000 578.909109 0.060000 578.909109 0.070000 578.909109 0.080000 578.909109 0.090000 578.909109 0.100000 578.909109 0.110000 578.909109 0.120000 578.909109 0.130000 578.909109 0.140000 578.909109 0.150000 578.909109 0.160000 578.909109 0.170000 578.909109 0.180000 578.909109 0.190000 578.909109 0.200000 578.909109 0.210000 578.909109 0.220000 578.909109 0.230000 578.909109 0.240000 578.909109 0.250000 578.909109 0.260000 578.909109 0.270000 578.909109 0.280000 578.909109 0.290000 578.909109 0.300000 578.909109 0.310000 578.909109 0.320000 578.909109 0.330000 578.909109 0.340000 578.909109 0.350000 578.909109 0.360000 578.909109 0.370000 578.909109 0.380000 578.909109 0.390000 578.909109 0.400000 578.909109 0.410000 578.909109 0.420000 578.909109 0.430000 578.909109 0.440000 578.909109 0.450000 578.909109 0.460000 578.909109 0.470000 578.909109 0.480000 578.909109 0.490000 578.909109 0.500000 578.909109
the pitch only have two value: 0 or 578.909109
I don't know where goes wrong! Please help!
Thank you very much!

Librosa API changed

in librosa changelog:

#627_ The following functions and features have been removed:

  • real= parameter in cqt
  • core.logamplitude (replaced by amplitude_to_db) <--- used in your code
  • beat.estimate_tempo (replaced by beat.tempo)
  • n_fft= parameter to feature.rmse
  • ref_power= parameter to power_to_db

No license?

I personally recommend GPLv3, but I would rather there just be a license so the air is clear about ownership of any audio made with this software and whether it can be borrowed from in contributing to projects like Audacity or Blender. Please & Thanx~!

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.