woheller69 / whoBIRD

Identify bird sounds in real time with this Android version of BirdNET. Bird sound recognition for more than 6,000 species worldwide.
GNU General Public License v3.0
288 stars 15 forks source link

prediction results in csv file. #2

Closed nishantnnb closed 7 months ago

nishantnnb commented 7 months ago

Hello, Liked this app. I had downloaded last week and now seeing that few more features are added !!! I wanted to use my custom model trained with birdnet in android app and my purpose got solved by replacing the birdnet model file and label file with my files.

Ty for all your efforts.

Feature requests for your kind consideration. 1) for e.g If i go for a bird walk and turned this app ON. it starts giving results of the predictions on the screen. But I won't be able to recollect all predictions later. Can you save results in a csv file containing date & time, bird name and probability %.

2) If i have few custom models trained with birdnet, can you give option to load and save the model file and label file? Then option to select a model for prediction from earlier saved models. this could be an option in settings of the app.

3) And in long term, can you save the sound recordings as well. I am sure this will be in your plan :-)

best wishes & Regards, Nishant

woheller69 commented 7 months ago

I already thought of writing the observations to a csv Date, Time, location, latin bird name, id, probability Id is the index in the labels file

Labels are part of the code, Stefan Kahl allowed me to use them under GPL3 license. So changing the model AND labels would be a problem, because due to license issues the tflite models (under CC-BY-NC-SA 4.0 license) are no longer part of the code. They have to be downloaded from a different place...

Saving audio parallel to analysis may be an issue. I don't know yet.

We will see how it evolves. I have quite a few apps on F-Droid, which also need some time...

Maybe there are others who want to help and contribute some code :-)

woheller69 commented 7 months ago

BTW, what is the difference of your own model?

nishantnnb commented 7 months ago

Thank you for the reply. I will wait for the CSV option. thank you.

Birdnet-analyzer, lets you train your own model with your own data. And gives the output in terms of your own tflite file & labels. The difference in my model are following: 1) Currently, the birdnet 2.4v doesn't contain all birds from my region. I am from Mumbai, India. 2) I have trained about 200 birds of my region with sound data collected from my area hence there is better chance of detecting the birds. Because there could be difference in sounds made by birds at different regions. 3) Other distinct thing is that for few birds I have gone a level deeper: I have made different classes for different types of Songs and calls a bird makes. So the result gives type of sound & call as well. Malabar_whistling_thrush_Song1 or Malabar_whistling_thrush_Call2. 4) Also I have collected different background noises e.g. cicadas (insects) in the 'Noise' class from my area. Hence it could improve results by ignoring the Noises.

Thank you again.

Regards, Nishant.

aviceda commented 7 months ago

Just downloaded android app on 2 devices, it picked up 2 australian cuckoo calls (Fan-tailed and Brush) but agree with Nishant that a csv download option would be great. Keep up the good-work! Tom

Ilav1 commented 7 months ago

Hi, Is it possible to add a history in the app so you can see the history without download a csv? Thanks for all the apps you published until now :)

woheller69 commented 7 months ago

I am planning to add a database for observations. These could be exported to csv or displayed in another window.

stevedee commented 7 months ago

I love your BirdNET application. I also think a downloadable CSV file would be very useful.

...and maybe the last 5 detections listed under the current one?

nishantnnb commented 7 months ago

I am planning to add a database for observations. These could be exported to csv or displayed in another window.

Thank you so much ! Looking forward to it.

woheller69 commented 7 months ago

Here is a first quick solution for exporting. There are 2 buttons at the bottom.

  1. Share: This provides a string containing csv data. Just select an app, such as an editor to open it
  2. Delete: This clears all observations

The first entry in the csv is a unix timestamp in milliseconds since Jan 1, 1970 In Excel you should be able to convert it to a date using =A1/86400000+DATE(1970;1;1)

Uninstall Remove .zip and install app-release.apk.zip

Shellfishgene commented 7 months ago

Maybe if you're going to work on csv export anyway it would be great if the csv could be saved to some cloud storage like Drobox or Google Drive automatically. I always thought that the old smartphones pretty much anyone has collecting dust in some drawer could be made into field bird logging devices. There is already a microphone, battery and modem, really only a solar panel is needed. A full webserver like Birdnet-Pi or Birdnet-go would be best of course, but that's probably out of scope for this app.

woheller69 commented 7 months ago

You should be able to share with any app that accepts text

Shellfishgene commented 7 months ago

Yes, but I meant that new versions of the file are also shared automatically, so that one can look at the new detections of a remote station without accessing it. Now that I think about it, if the csv file is updated by whoBIRD one could use some automation app like Tasker to copy it to a cloud drive at some interval.

stevedee commented 7 months ago

Here is a first quick solution for exporting. There are 2 buttons at the bottom.

1. Share: This provides a string containing csv data. Just select an app, such as an editor to open it

2. Delete: This clears all observations

The first entry in the csv is a unix timestamp in milliseconds since Jan 1, 1970 In Excel you should be able to convert it to a date using =A1/86400000+DATE(1970;1;1)

Uninstall Remove .zip and install app-release.apk.zip

Many thanks woheller69 for this version, it works great!

The next obvious request is to be able to enter a confidence % so CSV only contains confident detections (...whatever that may be).

woheller69 commented 7 months ago

the confidence level is currently the same as for displaying a detection. Might be an option in future. But in the csv you can apply a filter afterwards as needed.

nishantnnb commented 7 months ago

Here is a first quick solution for exporting. There are 2 buttons at the bottom.

  1. Share: This provides a string containing csv data. Just select an app, such as an editor to open it
  2. Delete: This clears all observations

The first entry in the csv is a unix timestamp in milliseconds since Jan 1, 1970 In Excel you should be able to convert it to a date using =A1/86400000+DATE(1970;1;1)

Uninstall Remove .zip and install app-release.apk.zip

This is working nice thank you. I am not a programmer but I tried to export results to CSV.
Modified SoundClassifier.kt file. Imported few things and added code in the function 'startRecognition'. This writes the results in a txt file in following folder in the phone: android/data/org.woheller69.whobird/files/download/

Name of the txt file contains current date & time. Contains of the file: Date & time Bird name Probability%

New file gets created whenever the app is closed and started again. I was trying to create new file for every pause/start button event but could not do it.

Hope this can be of any use to you.

Remove".zip" SoundClassifier.kt.zip

woheller69 commented 7 months ago

For now I decided to simply share the csv as string. This is very flexible, you can share it to a file manager to save it as a file or e.g. send it to your desktop via an email app or whatever. And it does not cause problems with ever changing Google requirements for accessing the file system.

The database will also be used for other stuff in future.