Closed kdarras closed 1 year ago
Hi there. Can you share an example audio file so we can debug this.
Hi there! They are the audio example files that are provided within batdetect2:
Hi again. In run_batdetect.py
, can you change the following lines:
for ii, audio_file in enumerate(files):
print('\n' + str(ii).ljust(6) + os.path.basename(audio_file))
try:
results = du.process_file(audio_file, model, params, args)
if args['save_preds_if_empty'] or (len(results['pred_dict']['annotation']) > 0):
results_path = audio_file.replace(args['audio_dir'], args['ann_dir'])
du.save_results_to_file(results, results_path)
except:
error_files.append(audio_file)
print("Error processing file!")
to this:
for ii, audio_file in enumerate(files):
print('\n' + str(ii).ljust(6) + os.path.basename(audio_file))
results = du.process_file(audio_file, model, params, args)
if args['save_preds_if_empty'] or (len(results['pred_dict']['annotation']) > 0):
results_path = audio_file.replace(args['audio_dir'], args['ann_dir'])
du.save_results_to_file(results, results_path)
This should give you a more detailed error that you can share here.
seems related to librosa:
Yes, looks like it. Can I ask what version of librosa you are using, the requirements file calls for librosa==0.9.2
.
I used librosa 0.10.0. Apparently this was not downgraded during the environment creation.
So I downgraded manually to librosa 0.9.2 using:
pip install --force-reinstall -v "librosa==0.9.2"
This solved my problem:
Maybe the solution would then be to set up the environment in a way to force librosa 0.9.2 to be installed since the code is not (yet) forward-compatible?
Great - glad you got it working. We will look into updating the code so that the latest version on librosa is used. I'll keep the issue open for now to remind myself.
Excellent - looking forward! batdetect2 worked nicely with some sample 10-min Audiomoth recordings, just now.
Hi both! This issue has been addressed in a branch we've been working on. Will merge the changes soon 👍🏽.
@kdarras cool, will be interested to see how well it works for you.
BTW we have an online demo here that you can also try if interested:
https://huggingface.co/spaces/macaodha/batdetect2
yes, I tried it, but we have longer audio files :)
After installing Anaconda 3 and running "python run_batdetect.py example_data/audio/ example_data/anns/ 0.3":
Also ran this after manually creating the output folder, same error. No output is created.