mirror of
https://github.com/macaodha/batdetect2.git
synced 2026-04-04 23:30:21 +02:00
1.3 KiB
1.3 KiB
How to configure audio preprocessing
Use this guide to set sample-rate and waveform-level preprocessing behaviour.
1) Set audio loader settings
The audio loader config controls resampling.
samplerate: 256000
resample:
enabled: true
method: poly
If your recordings are already at the expected sample rate, you can disable resampling.
samplerate: 256000
resample:
enabled: false
2) Set waveform transforms in preprocessing config
Waveform transforms are configured in preprocess.audio_transforms.
preprocess:
audio_transforms:
- name: center_audio
- name: scale_audio
- name: fix_duration
duration: 0.5
Available built-ins:
center_audioscale_audiofix_duration
3) Use the config in your workflow
For CLI inference/evaluation, use --audio-config.
batdetect2 predict directory \
path/to/model.ckpt \
path/to/audio_dir \
path/to/outputs \
--audio-config path/to/audio.yaml
4) Verify quickly on a small subset
Run on a small folder first and confirm that outputs and runtime are as expected before full-batch runs.
Related pages
- Spectrogram settings: {doc}
configure-spectrogram-preprocessing - Preprocessing config reference: {doc}
../reference/preprocessing-config