worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.35k stars 1.43k forks source link

Possibility of partial match #280

Open damares86 opened 1 year ago

damares86 commented 1 year ago

Hi. I just wanted to know if it's possible use this project to scan the ambient's sound and send an alarm when it match just only a percentage and not 100%.

I'll try to explain my request: my son is epileptic and all the doctor says that the monitoring systems for the seizure during the night are not so reliable, the only thing that helps us to be alerted of a epileptic seizure starting is a baby monitor, because the sound of the breathing changes in a very particular way during an epileptic seizure. My idea is this: if I record the sound of the breathing of my son during some epileptic seizure (let's say 20 times) and I put that files in the dejavu database, it is possibile that dejavu will find a match, even if it's not a 100% match? And it's possible to keep dejavu active during the night and make it sending alerts in that cases?

If I didn't explain weel the problem tell me and I'll try to explain it better. Thank you.

steveouma commented 1 year ago

Hi @damares86, I think it may be possible to use dejavu to achieve this but it'll require some work. You need to be able to keep a continuous audio stream through the sleep process. You can then run a scan against the stream.

damares86 commented 1 year ago

Thank you @steveouma for your reply! I don't know python so I don't think I will be able to do that work. Do you know some similar projects or some kind of forum where I can found some suggestions? Because it's also difficult to find the right keywords for this kind of search on Google

steveouma commented 1 year ago

Unfortunately, I don't know of any similar projects. It looks like a very niche conversation area from what I can see online. In case I stumble upon anything interesting I will buzz back. https://nightwatchepilepsy.com/

damares86 commented 1 year ago

Thank you for all!

denis-stepanov commented 1 year ago

Dejavu supports "partial matches" out of the box; by default it returns two nearest matches and their confidence, and the confidence could be anything in between 0 and 100%. It is then up to your code to decide if what's returned is a good enough match or not.

I recently made a Dejavu-based project of finding advertisement jingles in TV transmissions, https://github.com/denis-stepanov/advent. While seemingly different area, I believe that it has got 90% of what you need. It supports listening from a stream like a mike continuously, and you can specify match confidence. The only difference is that you'd need to replace a line which controls TV with something that would send a whatever alert you need. Some Python knowledge would not hurt anyway.

I can't tell for the quality of ambient sound recognition; this is something that you would need to test for your case.