I ran the edge-impulse-linux-runner
command and I wanted a way to customize the output and so I found this classification-audio.js example on the github repo
However there is no README on how to run the file. Kindly help
I ran the edge-impulse-linux-runner
command and I wanted a way to customize the output and so I found this classification-audio.js example on the github repo
However there is no README on how to run the file. Kindly help
Hi @eskay,
edge-impulse-linux
normally: npm install edge-impulse-linux -g --unsafe-perm
classify-audio.js
file locally on your computer/linux deviceconst { AudioClassifier, LinuxImpulseRunner, AudioRecorder } = require("edge-impulse-linux");
export PATH=$PATH:~/sox-14.4.2/
edge-impulse-linux-runner --download modelfile.eim
node classify-audio.js modelfile.eim
If you see the following output, then you need to also clarify which microphone you want to use:
➜ node classify-audio.js modelfile.eim
Starting the audio classifier for Jenny Plunkett / Glass Breaking - Acoustic Anomaly Detection (v12)
Parameters freq 16000Hz window length 1000ms. classes [ 'background', 'glassbreak' ]
Error: Multiple microphones found ("MacBook Pro Microph", "MacBook Pro Speaker", "Virtual Desktop Mic", "Virtual Desktop Spe", "ZoomAudioDevice"), add the microphone to use to this script (node classify-audio.js model.eim microphone)
at /Users/jenny/Local/portenta/classify-audio.js:29:19
Run the script and select a microphone, successful output looks something like this:
➜ node classify-audio.js modelfile.eim "MacBook Pro Microph"
Starting the audio classifier for Jenny Plunkett / Glass Breaking - Acoustic Anomaly Detection (v12)
Parameters freq 16000Hz window length 1000ms. classes [ 'background', 'glassbreak' ]
classification 1ms. { background: '0.0000', glassbreak: '1.0000' }
classification 0ms. { background: '0.0000', glassbreak: '1.0000' }
classification 0ms. { background: '0.0000', glassbreak: '1.0000' }
classification 1ms. { background: '0.0000', glassbreak: '1.0000' }
classification 0ms. { background: '0.0001', glassbreak: '0.9999' }
classification 0ms. { background: '0.0000', glassbreak: '1.0000' }
Hope this helps! I will add these to the README.
Thank you!
Jenny
Thank you very much. It worked!
Additional question. I am uploading the classification results to MongoDB but the classifier is too fast. Is there a way I can slow it down so that I upload one classification at a time?