GithubHelp home page GithubHelp logo

audio-classifier-keras-cnn's Introduction

audio-classifier-keras-cnn

Audio Classifier in Keras using Convolutional Neural Network

DISCLAIMER: This code is not being maintained. Your Issues will be ignored. For up-to-date code, switch over to Panotti.

audio-classifier-keras-cnn's People

Contributors

drscotthawley 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

audio-classifier-keras-cnn's Issues

Train_network.py can't handle smaller mel spectrogram shapes

Hi Dr. Hawley,

I noticed a small problem in the code in both train_network and eval_network- there is no error handling for files that produce spectrograms smaller than width 1293. This happens leads when the training data is created from the mel spectrograms (X_train[train_count,:,:] = melgram, around line 140).
You have written code to chop off the extra width if it is too long ( melgram = melgram[:,:,:,0:mel_dims[3]] ) but nothing to account for melgrams being too short.
I was able to get around it by filling the empty space with 0's, but I thought it would be helpful to let you know!

Also- if you are interested, I would love to connect with you sometime to talk about potential ways to extend this example/model to a system that works in real time, and makes predictions on songs as it hears them through a computer microphone versus an uploaded mp3.
My email is [email protected] if you want to connect!

Thanks,

Aaron

ValueError: could not broadcast input array from shape (1,96,25) into shape (1,96,32)

Dear Professor, Thank you for the excellent tutorial.

For sample data, i created two folders and put one set of sounds in each folder.

Step 1 went well.

man@man:~/Downloads/audio-classifier-keras-cnn-master$ python preprocess_data.py 
class_names =  ['tring', 'hold']
 class name = tring          -   0, 9 files in this class
 Loading class: tring          ( 1 of  2 classes), file 1 of 9: Samples/tring/r4.wav
 class name = hold           -   1, 94 files in this class
 Loading class: hold           ( 2 of  2 classes), file 1 of 94: Samples/hold/hm1_081.mp3
 Loading class: hold           ( 2 of  2 classes), file 21 of 94: Samples/hold/hm1_011.mp3
 Loading class: hold           ( 2 of  2 classes), file 41 of 94: Samples/hold/hm1_020.mp3
 Loading class: hold           ( 2 of  2 classes), file 61 of 94: Samples/hold/hm1_077.mp3
 Loading class: hold           ( 2 of  2 classes), file 81 of 94: Samples/hold/hm1_043.mp3

STEP TWO ERROR

man@man:~/Downloads/audio-classifier-keras-cnn-master$ python train_network.py
Using TensorFlow backend.
class_names =  ['tring', 'hold']
total files =  103
   get_sample_dimensions: melgram.shape =  (1, 1, 96, 32)

 Loading class: tring          ( 1 of  2 classes), file 1 of 9: Preproc/tring/r6.wav.npy
Traceback (most recent call last):
  File "train_network.py", line 201, in <module>
    X_train, Y_train, paths_train, X_test, Y_test, paths_test, class_names, sr = build_datasets(preproc=True)
  File "train_network.py", line 147, in build_datasets
    X_train[train_count,:,:] = melgram
ValueError: could not broadcast input array from shape (1,96,25) into shape (1,96,32)
man@man:~/Downloads/audio-classifier-keras-cnn-master$ 

What is meant by ValueError: could not broadcast input array from shape (1,96,25) into shape (1,96,32) How do I resolve it?

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.