Use trainer.predict for single images#1398
Open
jveitchmichaelis wants to merge 1 commit into
Open
Conversation
fc0ccd4 to
a74e9c9
Compare
9e91399 to
ce18d68
Compare
Collaborator
Author
|
Ready for review and we can address the inconsistency separately. For now this should fix the device placement bug. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1398 +/- ##
==========================================
- Coverage 86.61% 85.26% -1.36%
==========================================
Files 26 27 +1
Lines 3736 3875 +139
==========================================
+ Hits 3236 3304 +68
- Misses 500 571 +71
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ce18d68 to
77881cf
Compare
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.
Description
Use the trainer for single image prediction, similar to other predict routes (predict_file).
We should probably use SingleImage, but this accepts a
patch_sizeoption which is not the behavior we had before. Here I've forced patch_size to be the same size as the image only indeepforest.predict_imagewhich is a hack, but it doesn't change anything.I've refactored
_dataloader_wrapper_for convenience and added crop_model support for single images. It now uses_crop_models_wrapper_which has the same logic for multiple models.There are some inconsistencies that we could look into - predict_file returns an empty dataframe for no predictions, while predict_tile and predict_image (previously and here) return None. Some prediction paths convert labels from int->str - plan to make everything consistent there?
Related Issue(s)
Would supersede and fix #1391
AI-Assisted Development
N/A