karolpiczak / ears Goto Github PK
View Code? Open in Web Editor NEWEARS: Environmental Audio Recognition System
License: MIT License
EARS: Environmental Audio Recognition System
License: MIT License
I'm running into errors with building llvmlite when running the "pip install -r /home/pi/ears/requirements.txt" command. I believe I'm following the steps properly, but I've been held up at this one for a number of separate attempts. Thanks!
Also, I think in the "Install Python with required packages:" section, "-add channels" should be "--add channels".
Greetings
it would be great to add ears to pip3 package manager. it would be specially great if it could run on any architecture OOB
cheers
Can I use another audio system with the jack? Or does it have to be a usb audio recorder?
Kind regards!!
for training I need module pydub, tqdm
Hello,
Last week I install and run successfully, now I try again from zero and unable, receive errors when installing.
when installing requirements it says running cythonize failed
. complete log attached.
then when check sounddevice python -m sounddevice
it says module not found.
(ears)pi@raspberrypi:~ $ python -m sounddevice
/home/pi/.conda/envs/ears/bin/python: No module named sounddevice
I am installing fresh as per your instructions, I was able to last week and now get these errors. Any help is appreciated.
Thank you
you are using too much thing and i want to detect voices and print on my console screen instead of local server.... is it possible to delete all files which is related with local server and make ur code simple...plz help me
Hi,
I have been testing your code and seen research papers too. It's nice to get working on this code. I have found that you have reported accuracy more than 80% in many cases and I have also found while retraining the model but here is a trick. It seems you have done, training, testing, and validation on the same dataset that's why it showing 85% accuracy after 100 epochs. But in the real world, It is not doing any better than hit-n-trail methods. Even a single classification is not right.
It is classifying Fan to Cat, Cat to a mouse click, keyboard to frog and so on. Overall, there is no relation between input and taget classification.
One more thing I have noticed that there is a huge jerk in recorded audio after a periodic time. perhaps, this model was not tested with unseen data, i.e. out of training data.
I am hoping, you would get back to me with a suggestion. Thanks for posting it here, at least now I can start modifying this model itself. Thanks.
when running a modified version of EARS run script, on ubuntu x86_64, i get the following log.
my script says
bokeh serve --allow-websocket-origin=127.0.0.1:5006 ears
everything seems to run fine, but i cannot tell exactly if all the modules comiled successfully
here's my terminal log
./run.sh
INFO:bokeh.server.server:Starting Bokeh server version 0.12.5
DEBUG:bokeh.server.tornado:These host origins can connect to the websocket: ['127.0.0.1:5006']
DEBUG:bokeh.server.tornado:Patterns are:
DEBUG:bokeh.server.tornado: [('/ears/?',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.doc_handler.DocHandler'>,
DEBUG:bokeh.server.tornado: {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x7f2f091d35c0>,
DEBUG:bokeh.server.tornado: 'bokeh_websocket_path': '/ears/ws'}),
DEBUG:bokeh.server.tornado: ('/ears/ws',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.ws.WSHandler'>,
DEBUG:bokeh.server.tornado: {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x7f2f091d35c0>,
DEBUG:bokeh.server.tornado: 'bokeh_websocket_path': '/ears/ws'}),
DEBUG:bokeh.server.tornado: ('/ears/autoload.js',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.autoload_js_handler.AutoloadJsHandler'>,
DEBUG:bokeh.server.tornado: {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x7f2f091d35c0>,
DEBUG:bokeh.server.tornado: 'bokeh_websocket_path': '/ears/ws'}),
DEBUG:bokeh.server.tornado: ('/ears/static/(.)',
DEBUG:bokeh.server.tornado: <class 'tornado.web.StaticFileHandler'>,
DEBUG:bokeh.server.tornado: {'path': '/home/tmm88/Workspace/EARS/ears/static'}),
DEBUG:bokeh.server.tornado: ('/?',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.root_handler.RootHandler'>,
DEBUG:bokeh.server.tornado: {'applications': {'/ears': <bokeh.server.application_context.ApplicationContext object at 0x7f2f091d35c0>},
DEBUG:bokeh.server.tornado: 'prefix': '',
DEBUG:bokeh.server.tornado: 'use_redirect': True}),
DEBUG:bokeh.server.tornado: ('/static/(.)',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.static_handler.StaticHandler'>)]
INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006 with applications at paths ['/ears']
INFO:bokeh.command.subcommands.serve:Starting Bokeh server with process id: 9686
INFO:audio:Initializing a convolutional neural network model...
Using Theano backend.
WARNING:theano.tensor.blas:Using NumPy C-API based implementation for BLAS functions.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/tmm88/Workspace/EARS/ears/audio.py", line 78, in start
model.load_weights('ears/model.h5')
File "/home/tmm88/.local/lib/python3.5/site-packages/keras/models.py", line 723, in load_weights
raise ImportError('load_weights
requires h5py.')
ImportError: load_weights
requires h5py.
DEBUG:bokeh.server.tornado:[pid 9686] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 0 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 0 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 0 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 0 sessions with 0 unused
INFO:tornado.access:302 GET / (127.0.0.1) 7.26ms
INFO:tornado.access:200 GET /ears (127.0.0.1) 539.48ms
INFO:tornado.access:200 GET /ears/static/css/bootstrap.css (127.0.0.1) 90.55ms
INFO:tornado.access:200 GET /static/css/bokeh.min.css?v=1bb409ee97bc7539326089bbfc2aad84 (127.0.0.1) 0.98ms
INFO:tornado.access:200 GET /static/css/bokeh-widgets.min.css?v=de1aa4588db0ebb1076588c26ac1e07c (127.0.0.1) 1.09ms
INFO:tornado.access:200 GET /static/js/bokeh.min.js?v=d5277ec06271e90def555abd13cd3b2f (127.0.0.1) 1.75ms
INFO:tornado.access:200 GET /static/js/bokeh-widgets.min.js?v=ff67b7fa94bb9ebef0e0e2c97f8c95f0 (127.0.0.1) 1.39ms
INFO:tornado.access:200 GET /ears/static/css/custom.css (127.0.0.1) 56.15ms
INFO:tornado.access:200 GET /static/js/bokeh-gl.min.js?v=dac0ba7cb19b33bf935e67b96a95b546 (127.0.0.1) 1.90ms
INFO:tornado.access:200 GET /ears/static/js/bootstrap.min.js (127.0.0.1) 26.06ms
INFO:tornado.access:200 GET /ears/static/js/custom.js (127.0.0.1) 14.85ms
INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol('1.0')
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol('1.0')
INFO:bokeh.server.views.ws:ServerConnection created
DEBUG:bokeh.server.session:Sending pull-doc-reply from session 'FaQmL9wUZBfOZU2Z10aUOTYcTbpyMBFdpnWaCKqMkkBi'
/home/tmm88/.local/lib/python3.5/site-packages/bokeh/core/json_encoder.py:73: FutureWarning: pandas.tslib is deprecated and will be removed in a future version.
You can access Timestamp as pandas.Timestamp
if pd and isinstance(obj, pd.tslib.Timestamp):
/home/tmm88/.local/lib/python3.5/site-packages/bokeh/core/json_encoder.py:75: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
elif np.issubdtype(type(obj), np.float):
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 0.68ms
DEBUG:bokeh.server.tornado:[pid 9686] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 1 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 1 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 1 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 1 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 1 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 9686] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 9686] /ears has 1 sessions with 0 unused
^C
Interrupted, shutting down
DEBUG:bokeh.server.server:Shutdown: cleaning up
^C
Hi, I changed the theano flag to 'device=cpu' as I don't have cuda supported gpu. I got an error stating 'Segmentation fault' right after Epoch 1/100. Is it because my computer run out of ram?
i did the following:
i noticed the following:
here's my console log:
¨¨
./run.sh
INFO:bokeh.server.server:Starting Bokeh server version 0.12.5
DEBUG:bokeh.server.tornado:These host origins can connect to the websocket: ['127.0.0.1:5006']
DEBUG:bokeh.server.tornado:Patterns are:
DEBUG:bokeh.server.tornado: [('/ears/?',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.doc_handler.DocHandler'>,
DEBUG:bokeh.server.tornado: {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x7facc5f0d5f8>,
DEBUG:bokeh.server.tornado: 'bokeh_websocket_path': '/ears/ws'}),
DEBUG:bokeh.server.tornado: ('/ears/ws',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.ws.WSHandler'>,
DEBUG:bokeh.server.tornado: {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x7facc5f0d5f8>,
DEBUG:bokeh.server.tornado: 'bokeh_websocket_path': '/ears/ws'}),
DEBUG:bokeh.server.tornado: ('/ears/autoload.js',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.autoload_js_handler.AutoloadJsHandler'>,
DEBUG:bokeh.server.tornado: {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x7facc5f0d5f8>,
DEBUG:bokeh.server.tornado: 'bokeh_websocket_path': '/ears/ws'}),
DEBUG:bokeh.server.tornado: ('/ears/static/(.)',
DEBUG:bokeh.server.tornado: <class 'tornado.web.StaticFileHandler'>,
DEBUG:bokeh.server.tornado: {'path': '/home/tmm88/Workspace/EARS/ears/static'}),
DEBUG:bokeh.server.tornado: ('/?',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.root_handler.RootHandler'>,
DEBUG:bokeh.server.tornado: {'applications': {'/ears': <bokeh.server.application_context.ApplicationContext object at 0x7facc5f0d5f8>},
DEBUG:bokeh.server.tornado: 'prefix': '',
DEBUG:bokeh.server.tornado: 'use_redirect': True}),
DEBUG:bokeh.server.tornado: ('/static/(.)',
DEBUG:bokeh.server.tornado: <class 'bokeh.server.views.static_handler.StaticHandler'>)]
INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006 with applications at paths ['/ears']
INFO:bokeh.command.subcommands.serve:Starting Bokeh server with process id: 16708
INFO:audio:Initializing a convolutional neural network model...
/usr/local/lib/python3.5/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Using Theano backend.
WARNING:theano.tensor.blas:Using NumPy C-API based implementation for BLAS functions.
DEBUG:audio:Loaded Keras model with weights.
INFO:audio:Priming recording device 5.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/tmm88/Workspace/EARS/ears/audio.py", line 122, in start
ref_power=1e-5, top_db=None)
File "/home/tmm88/.local/lib/python3.5/site-packages/librosa/core/spectrum.py", line 1073, in perceptual_weighting
return offset + power_to_db(S, **kwargs)
TypeError: power_to_db() got an unexpected keyword argument 'ref_power'
DEBUG:bokeh.server.tornado:[pid 16708] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 16708] /ears has 0 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 16708] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 16708] /ears has 0 sessions with 0 unused
INFO:tornado.access:302 GET / (127.0.0.1) 2.28ms
INFO:tornado.access:200 GET /ears (127.0.0.1) 459.74ms
INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol('1.0')
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol('1.0')
INFO:bokeh.server.views.ws:ServerConnection created
DEBUG:bokeh.server.session:Sending pull-doc-reply from session '7ALPJ52uRtQHh4TP7ZGI6c5BeviSyJ29qzkZfh1dlZMa'
/home/tmm88/.local/lib/python3.5/site-packages/bokeh/core/json_encoder.py:73: FutureWarning: pandas.tslib is deprecated and will be removed in a future version.
You can access Timestamp as pandas.Timestamp
if pd and isinstance(obj, pd.tslib.Timestamp):
/home/tmm88/.local/lib/python3.5/site-packages/bokeh/core/json_encoder.py:75: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
elif np.issubdtype(type(obj), np.float):
./run.sh: line 3: 16708 Illegal instruction (core dumped) bokeh serve --allow-websocket-origin=127.0.0.1:5006 ears
¨¨
I type this command in my mac, and show it:
> 0 Built-in Microphone, Core Audio (2 in, 0 out)
< 1 Built-in Output, Core Audio (0 in, 2 out)
How could I name my microphone in /ears/config.py
at line6 ?
Thx~
Hi Karol,
When installing on a RPi3 I run into trouble on step 2:
(ears)hugo@soundscaper:~/ears $ sudo apt-get install libasound-dev libportaudio-dev portaudio19-dev libportaudio2
[sudo] password for hugo:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libasound2-dev' instead of 'libasound-dev'
libportaudio2 is already the newest version.
libportaudio2 set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
portaudio19-dev : Conflicts: libportaudio-dev but 18.1-7.1 is to be installed
E: Unable to correct problems, you have held broken packages.
Any suggestions getting around this?
Thx
everything else runs fine.. the setup is also successful except for this one error when i do ./run.sh
using rpi 3b
rasbian buster desktop latest version
using blue yeti as mic
i can access web server as well but no data/stream being generated
ERROR:
Using Theano backend.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/pi/.conda/envs/ears/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/pi/.conda/envs/ears/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/ears/ears/audio.py", line 72, in start
keras.backend.set_image_dim_ordering('th')
AttributeError: module 'keras.backend' has no attribute 'set_image_dim_ordering'
do you know why this is?
Hello, this is a great idea. Can I ask question please.
Does this keep log of when a sound was recognized and for how long?
Can you point me to best place to insert a trigger task for when a sound is recognized?
Thank you
fixed documentation in a separate fork. i see that:
feel free to merge the changes and update your master branch. you can do it yourself
👍 "karoldvl
Is there an option to integrate Jackd into EARS operation?
I am getting fairly inaccurate results when testing. for example. when laughing it will it will report "laughing" only 1/10 times. plus the the percentile doesn't seem to go above 30% i suspect its because of a small dateset used in training the model?
i would like the output to be a little more reliable.. is there any way to do that?
one of the ways i thought of was to create an if statement to see if the percentile for a certain target is above a certain threshold, if so show it. otherwise don't.
but i am not sure how to do that... would like to hear your thoughts on it.
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.