BirdNET-Analyzer icon indicating copy to clipboard operation
BirdNET-Analyzer copied to clipboard

Shifted Begin Time (s) reported in output table when using high overlap

Open scrameri opened this issue 7 months ago • 1 comments

Hi Stefan,

Many thanks for this amazing set of tools!

Describe the bug Using analyzer.py with --overlap 2.9 causes Begin Time (s) in the output file to be shifted relative to the true begin time in the audiofile. The reported time is a couple of seconds earlier. I didn't notice this behaviour when using --overlap 0.

Code Used

python3 analyze.py --i path/to/folder/ --slist path/to/results/ --o path/to/results/  --sensitivity 0.5 --min_conf 0.05 --fmin 0 --fmax 16000 --overlap 2.9 --output_file BirdNET.selection.table_sensitivity_0.5_fmax_16000_overlap_2.9.txt --locale de

Expected behavior Begin Time (s) is expected to exactly match the beginning of a call in the audio file, regardless of the --overlap setting.

Selection	View	Channel	Begin Time (s)	End Time (s)	Low Freq (Hz)	High Freq (Hz)	Common Name	Species Code	Confidence	Begin Path	File Offset (s)
1	Spectrogram 1	1	606.7000000000694	609.7000000000694	0	8000.0	Waldkauz	tawowl1	0.0974	path/to/folder/20240425_202300.WAV	606.7000000000694
2	Spectrogram 1	1	606.8000000000694	609.8000000000694	0	8000.0	Waldkauz	tawowl1	0.2410	path/to/folder/20240425_202300.WAV	606.8000000000694
3	Spectrogram 1	1	606.9000000000694	609.9000000000694	0	8000.0	Waldkauz	tawowl1	0.6160	path/to/folder/20240425_202300.WAV	606.9000000000694
4	Spectrogram 1	1	607.0000000000695	610.0000000000695	0	8000.0	Waldkauz	tawowl1	0.8510	path/to/folder/20240425_202300.WAV	607.0000000000695
5	Spectrogram 1	1	607.1000000000695	610.1000000000695	0	8000.0	Waldkauz	tawowl1	0.7917	path/to/folder/20240425_202300.WAV	607.1000000000695
6	Spectrogram 1	1	607.2000000000695	610.2000000000695	0	8000.0	Waldkauz	tawowl1	0.9630	path/to/folder/20240425_202300.WAV	607.2000000000695

However, the audiofile shows that the first call starts at ca. 610 seconds, about 3 seconds later than reported. In this case, the size of the shift is about the same as the size of --overlap.

Questions

  • Is this expected?
  • Can I always add --overlap to the reported Begin Time (s) to create correct audio subsets?

Any help is appreciated!

Session Info

  • OS: MacOS, 14.2.1
  • Python 3.9.6
  • birdnetlib 0.17.2

scrameri avatar Jul 16 '24 21:07 scrameri