From b056d7d28dbce76ad91fbaac1395b6d143dd48bc Mon Sep 17 00:00:00 2001 From: mbsantiago Date: Mon, 8 Sep 2025 18:03:56 +0100 Subject: [PATCH] Make sure training is still working --- example_data/dataset.yaml | 30 ------------------------------ justfile | 12 ++---------- src/batdetect2/evaluate/match.py | 2 +- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/example_data/dataset.yaml b/example_data/dataset.yaml index d96e0e5..790da8c 100644 --- a/example_data/dataset.yaml +++ b/example_data/dataset.yaml @@ -6,33 +6,3 @@ sources: description: Examples included for testing batdetect2 annotations_dir: example_data/anns audio_dir: example_data/audio - -classes: - # Each class has a name - - name: rhihip - - # Can be specified by some tags - tags: - - key: species - value: Rhinolophus hipposideros - - - name: myotis - - # Or if needed by more complex conditions - condition: - name: has_any_tag - tag: - - key: species - value: Myotis myotis - - key: species - value: Myotis nattereri - - key: species - value: Myotis daubentonii - - # Specifies how to translate back the "class" into - # the tag system - # If tags are provided and output_tags are not then - # just use the provided tags - output_tags: - - key: genus - value: Myotis diff --git a/justfile b/justfile index 17abb8c..97016a4 100644 --- a/justfile +++ b/justfile @@ -92,19 +92,11 @@ clean-build: clean: clean-build clean-pyc clean-test clean-docs # Examples -# Preprocess example data. -example-preprocess OPTIONS="": - batdetect2 preprocess \ - --base-dir . \ - --dataset-field datasets.train \ - --config example_data/config.yaml \ - {{OPTIONS}} \ - example_data/config.yaml example_data/preprocessed # Train on example data. example-train OPTIONS="": batdetect2 train \ - --val-dir example_data/preprocessed \ + --val-dataset example_data/dataset.yaml \ --config example_data/config.yaml \ {{OPTIONS}} \ - example_data/preprocessed + example_data/dataset.yaml diff --git a/src/batdetect2/evaluate/match.py b/src/batdetect2/evaluate/match.py index 15f3a34..df3bc60 100644 --- a/src/batdetect2/evaluate/match.py +++ b/src/batdetect2/evaluate/match.py @@ -282,7 +282,7 @@ def match_sound_events_and_raw_predictions( config = config or MatchConfig() target_sound_events = [ - targets.transform(sound_event_annotation) + sound_event_annotation for sound_event_annotation in clip_annotation.sound_events if targets.filter(sound_event_annotation) and sound_event_annotation.sound_event.geometry is not None