Update test_detection.py to match refactored detection.py API#277
Merged
tkswanson merged 2 commits intoMay 1, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/conservationtechlab/animl-py/sessions/881cb7e4-7510-4803-b0c5-50d8e946b6d1 Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conservationtechlab/animl-py/sessions/881cb7e4-7510-4803-b0c5-50d8e946b6d1 Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tkswanson
May 1, 2026 20:21
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
detection.pywas refactored to consolidate_convert_onnx_detectionsand_convert_yolo_detectionsinto a single_convert_detections(predictions, batch, letterbox, model_type)function, andparse_detectionsnow expectscategory_labelin each detection dict. The tests were left referencing the old API.Changes
_convert_onnx_detections/_convert_yolo_detectionswith_convert_detectionsTestConvertOnnxDetections/TestConvertYoloDetections: Update all call sites to use the unified signature:_make_detection_result+ inline detection dicts: Addcategory_labelkey to detection entries to satisfyparse_detections' direct dict accesstest_filepath_preserved: Fix stale assertion ('my_image.jpg') that was testing with a different path than what was in the batch; now constructs a distinct-path batch to properly validate preservation