π¨βπ» Working on AI platform
Fun Facts
Fing
is my nickname- I used
mtobeiyf
as username which comes from The Hunger Games quote: "May The Odds Be Ever In Your Favor"
:musical_score: Environmental sound classification using Deep Learning with extracted features
When I try to put wav files in data directory, it appears:
[Error] extract feature error in data_wav/6/148835-6-0-0.wav. Frequency band exceeds Nyquist. Reduce either fmin or n_bands.
Solution: tune "fmin" parameter in function "extract_feature(file_name=None)" as follows:
contrast = np.mean(librosa.feature.spectral_contrast(S=stft, sr=sample_rate, fmin=180.0).T,axis=0)
I am experiencing the same issue. Should I prep the .wav files in a specific way?
Also, if I reduce fmin to 120.0, I receive the following error:
librosa.util.exceptions.ParameterError: Filter pass-band lies beyond Nyquist
Please advise.
Okay, thanks. It's a problem related to the audio files.
I'll close this issue for now.
Originally posted by @mtobeiyf in #10 (comment)
Steps which I did..
1)download ESC-10 dataset then inserted in data directory
2)executed command python feat_extract.py
3)4 file are created feat.py,lable.py,predict_feat,predict_filenames
4)executed command svm.py and output is fitting... acc=0.756
5)executed nn.py
6)executed cnn.py -t
7)putting single sample audio at predict folder and executed the command cnn.py -t but erorr occures like
Traceback (most recent call last):
File "cnn.py", line 123, in
main(args)
File "cnn.py", line 109, in main
elif args.predict: predict(args)
File "cnn.py", line 73, in predict
pred = model.predict_classes(X_predict)
File "C:\Users\Abhijeet\Anaconda3\envs\tfp3.6\lib\site-packages\keras\engine\s
equential.py", line 268, in predict_classes
if proba.shape[-1] > 1:
AttributeError: 'list' object has no attribute 'shape'
I got two errors when executing the file "cnn.py".
When I tried to predict the classes there seemed to be some kind of pattern. The class names given by folder is different from the predicted name:
Name, Predicted,Actual
rain=0,2
seawaves=1,3
baby=2,4
clock=3,5
sneeze=4,6
helicopter=5,7
chainsaw=6,8
rooster=7,9
firecracker=8,10
dog=13,1
What could be the reason?
when executing nn.py gives following error
Using TensorFlow backend.
Traceback (most recent call last):
File "nn.py", line 37, in
y_train = keras.utils.to_categorical(y_train-1, num_classes=10)
File "C:\Users\TUSHAR\Anaconda3\lib\site-packages\keras\utils\np_utils.py", line 32, in to_categorical
categorical[np.arange(n), y] = 1
IndexError: index 21 is out of bounds for axis 1 with size 10
numpy
librosa
pysoundfile
sounddevice
matplotlib
scikit-learn
tensorflow
keras
I have run feat_extract.pyοΌand there is feat.npy and ;label.npy,when I run cnn.py,it occured error above
Hi , i am using the same structure as you said but when i run feat_extract.py ,it run smoothly and gives me this output :
extract .ipynb_checkpoints features done
extract 001 - Dog bark features done
extract 002 - Rain features done
extract 003 - Sea waves features done
extract 004 - Baby cry features done
extract 005 - Clock tick features done
extract 006 - Person sneeze features done
extract 007 - Helicopter features done
extract 008 - Chainsaw features done
extract 009 - Rooster features done
extract 010 - Fire crackling features done
but in feat.npy, it says Error! feat.npy is not UTF-8 encoded
please help me to understand this and how i can resolve it
what's the optimal accuracy can this cnn model reach after fully trained, can this be written on README ? thanks
Can you guide the prediction part?
So this happened with both my own OGG data and the ESC data, with one OGG file in the predict folder.
Everything went normally, the SVN and MLP worked. Then I tried the CNN:
_
Phonecian:audio-classification skiwheelr$ python3 cnn.py -t
Using TensorFlow backend.
2020-04-03 23:29:32.002190: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-04-03 23:29:32.015288: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f8e13dfbac0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-04-03 23:29:32.015310: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Traceback (most recent call last):
File "cnn.py", line 124, in
main(args)
File "cnn.py", line 109, in main
if args.train: train(args)
File "cnn.py", line 51, in train
y_train = keras.utils.to_categorical(y_train, num_classes=class_count)
File "/usr/local/lib/python3.7/site-packages/keras/utils/np_utils.py", line 52, in to_categorical
categorical[np.arange(n), y] = 1
IndexError: index 12 is out of bounds for axis 1 with size 12
What could be causing this? There is enough data.
The following is the error I have encountered. Could you please guide me out of it?
Traceback (most recent call last):
File "cnn.py", line 139, in
main(args)
File "cnn.py", line 125, in main
elif args.predict: predict(args)
File "cnn.py", line 88, in predict
X_predict = np.expand_dims(X_predict, axis=2)
UnboundLocalError: local variable 'X_predict' referenced before assignment
Hello, when I run nn.py and cnn.py, the spyder showed that AttributeError: 'ProgbarLogger' object has no attribute 'log_values' . It seems that something wrong the keras
Hello,
I have a question.
Convert label to onehot
y_train = keras.utils.to_categorical(y_train-1, num_classes=num_classes)
y_test = keras.utils.to_categorical(y_test-1, num_classes=num_classes)
Why did you use (y_train - 1), not just (y_train) when you call keras.utils.to_categorical()
What are the classes if I use ECS-10? Is it like: 0 - dog bark, 1 - ***, ..., etc.
I put a dog bark.ogg from the training data into the predict folder, it outputs 13 however. What is wrong with it?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.