wip: fix padding issues in augmentation pipeline#1275
Draft
jveitchmichaelis wants to merge 1 commit intoweecology:mainfrom
Draft
wip: fix padding issues in augmentation pipeline#1275jveitchmichaelis wants to merge 1 commit intoweecology:mainfrom
jveitchmichaelis wants to merge 1 commit intoweecology:mainfrom
Conversation
b95c172 to
2994bed
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1275 +/- ##
==========================================
- Coverage 87.89% 86.99% -0.91%
==========================================
Files 20 20
Lines 2776 2775 -1
==========================================
- Hits 2440 2414 -26
- Misses 336 361 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Fixes some unexpected behavior during augmentation.
kornia.This may be a limitation of how
korniaconstructs/chains the transformation matrices for different operations.korniatransforms input boxes/points but it doesn't do any filtering afterwards. If the source image is rotated for example, it will may result in boxes going out of bounds. Currently, we clip to the bounds of the augmented image, but if padding is forced to be the last operation, we should clip to the source image and then pad to the desired size. In the other direction, if the image is cropped, then we want to bound the labels to the transformed image.This PR makes two changes:
PadTooperation, move it to the final step. This ensures that the resulting labels are correct. This is opinionated, but until we figure out a way to solve the label transform problem, it's a safe compromise and should always yield correct labels even if the transform pipeline is specified out of order by mistake.Typical corrected sample:
Related Issue(s)
#1274 - related, but this does not change the behavior of PadTo (unexpected cropping).
AI-Assisted Development
Auto-complete only for updating filter_boxes