kahst / BirdNET

Soundscape analysis with BirdNET.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multithreading not working

tdelattre opened this issue · comments

Hi All,
I'm trying to run BirdNet on a server (without GPU computation). Installation works fine, the detection software runs but on only one thread/CPU. I've tried Ubuntu 20.04, 18.04 and even CentOS. None solves the problem. I also tried several versions of numpy just in case.
Does anyone know of a possible solution to this problem ?
The weird thing is that I installed it on my personal machine (with Ubuntu 20.04) and everything works fine, the algo runs on all 8 cores. I followed the exact same procedure in all cases (installation readme until step 7).
The goal is to be able to batch-process a high number of files collected on ARUs (otherwise I guess I could go for @mcguirepr89 's arm64 fork).

Generally speaking I'm a little worried about the fact that birdNET doesn't seem to be maintained anymore. I'm not criticising, the work provided by @kahst is incredibly good and useful! But I wonder if it is a good idea to invest time on a tool that may break anytime because dependencies break, libraries become outdated etc. Sadly I can't find a fork of BirdNET that is currently active and not on arm64.
Thanks in advance for your help!
Cheers all and thanks again @kahst @mcguirepr89 for all the good work.
Thomas

Hi, Thomas -- I'd be happy to try to adjust BirdNET-Pi's installer to allow for installation on x86_64 if you'd like. No promises on it delivering what you're looking for, but the newest version of BirdNET-Pi now splits the analyze.py script in two to allow a socketed server.py service to build the model and load the labels.txt file and accept and process data sent to the socket from analyze.py -- it is a good approach when you want to keep the model built and ready for data to continuously feed it.

Just let me know what you think -- it could be that the analyze.py and server.py from BirdNET-Pi would be all you need to achieve your batch processing. Oh, and for the actual TFLite binaries, I use pre-built binaries from @PINTO0309, so swapping out the ARM64 binaries for x86 shouldn't be too tough.

Lastly, I do know that @kahst is working on an updated model, so it may seem that the repo is dormant, but work is certainly still under way.

My best regards,
Patrick

Hi Patrick,
I'd be happy to try to adjust BirdNET-Pi's installer to allow for installation on x86_64 if you'd like
that would be super useful to us, thank you very much!
No promises on it delivering what you're looking for
Our goal is to batch-process with BirdNET a huge number of sound files recorded on automatic recorders. The idea is to do that on a server to make use of its computing power, and in particular to run multiple threads at once to accelerate the process. If BirdNET-Pi could do that, that would be wonderful!
One thing I'm unclear about is if there are differences in the results provided by BirdNET and BirdNET-Pi? I.e. will the detections and identifications be the same or does the choice of TFLite (for example) in BirdNET-Pi affect the results, compared to BirdNET?
Just let me know what you think -- it could be that the analyze.py and server.py from BirdNET-Pi would be all you need to achieve your batch processing.
Not sure what you mean here, sorry :-/
Oh, and for the actual TFLite binaries, I use pre-built binaries from [@PINTO0309](https://github.com/PINTO0309/TensorflowLite-bin), so swapping out the ARM64 binaries for x86 shouldn't be too tough.
It's cool if it doesn't take too much of your time. It's super nice of you to build those tools and make them available to the community. Being so readily available to answer questions and requests is even better, so much that I almost feel bad for asking!
Maybe we should continue this discussion from BirdNETPi's GitHub?
Thanks again for your kindness and availability,
Best regards,
Thomas

Created a discussion for this on the BirdNET-Pi repo