Filter predict outputs to save only test_crop_manifest labels#197
Filter predict outputs to save only test_crop_manifest labels#197rhoadesScholar merged 12 commits intomainfrom
Conversation
Co-authored-by: rhoadesScholar <[email protected]>
Co-authored-by: rhoadesScholar <[email protected]>
Co-authored-by: rhoadesScholar <[email protected]>
Co-authored-by: rhoadesScholar <[email protected]>
Co-authored-by: rhoadesScholar <[email protected]>
Co-authored-by: rhoadesScholar <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR implements filtering of prediction outputs to save only the class labels specified in the test_crop_manifest for each crop when running predict(crops="test"). This optimization reduces storage requirements and processing time by avoiding saving predictions for classes that won't be scored.
Changes:
- Added
get_test_crop_labels()utility function to retrieve scored labels per crop from the test manifest - Modified
predict()to filter classes to the intersection of model classes and crop-specific labels whencrops="test" - Modified
_predict()to structure outputs using all model classes but filter them before disk write
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/cellmap_segmentation_challenge/utils/crops.py | Added get_test_crop_labels() function to retrieve class labels for a specific test crop from the manifest |
| src/cellmap_segmentation_challenge/utils/init.py | Exported the new get_test_crop_labels function |
| src/cellmap_segmentation_challenge/predict.py | Modified prediction pipeline to filter outputs based on test_crop_manifest labels; added support for model_classes parameter to maintain model compatibility while filtering saved classes |
| tests/test_crops.py | Added comprehensive unit tests for get_test_crop_labels() covering various scenarios including edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: rhoadesScholar <[email protected]>
Co-authored-by: rhoadesScholar <[email protected]>
Co-authored-by: rhoadesScholar <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: rhoadesScholar <[email protected]>
Fixed all issues in 2ee6319:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.