Fix Issue #345: KeypointDetectionModel returns correct prediction type #428
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.
Description
Fixes #345 where
KeypointDetectionModel.predictwas incorrectly returning aCLASSIFICATION_MODELprediction type. This caused thePredictionGroupto wrap the entire response as a single prediction instead of parsing the list of predictions, breaking integration with tools likesupervision.Adds
mypy ignoresfor optional image dependencies (pi_heif, pillow_avif) to fixmake check_code_qualityfailures in environments where these libraries are missing.Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
I created a reproduction script that mocks the Roboflow API response for a keypoint detection model
Before fix: The script failed because the result type was
ClassificationModeland supervision could not parse it.After fix: The result type is correctly identified as
KeypointDetectionModeland supervision successfully parses the keypoints.I also ran
make styleandmake check_code_qualityto ensure all checks pass.Any specific deployment considerations
None
Docs