Skip to content

fix: merge clip outputs before saving batdetect2 format#69

Merged
mbsantiago merged 2 commits into
mainfrom
fix/GH-66-fix-features
Jun 23, 2026
Merged

fix: merge clip outputs before saving batdetect2 format#69
mbsantiago merged 2 commits into
mainfrom
fix/GH-66-fix-features

Conversation

@mbsantiago

Copy link
Copy Markdown
Collaborator

Summary

This fixes a regression in batdetect2 process directory when saving predictions in the batdetect2 output format.

When inference produced multiple clip-level predictions for the same recording, each clip was being saved to the same output filename derived from the recording name. That meant later clips overwrote earlier ones, so only detections from the last clip appeared in the final saved file.

This change merges clip-level predictions belonging to the same recording into a single recording-level ClipDetections object before formatting and saving in the batdetect2 format.

Thanks to @Jeff37 for pointing this out!

Additional Note

This branch also includes a small plotting update that was added while diagnosing the issue and is worth keeping.

Testing

  • uv run pytest tests/test_inference/test_batch.py tests/test_cli/test_process.py

@mbsantiago mbsantiago merged commit 4f8b6ee into main Jun 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant