-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force mask interpolation #2003
Force mask interpolation #2003
Conversation
Reviewer's Guide by SourceryThis pull request introduces a new 'mask_interpolation' parameter to various geometric transformation classes in the Albumentations library. The change allows users to specify the interpolation method for masks separately from the main image interpolation method. This addresses several issues related to mask interpolation, particularly in cases where preserving mask values is crucial. Class diagram for updated transformation classes with mask_interpolationclassDiagram
class BaseDistortion {
int border_mode
ColorType value
ColorType mask_value
int mask_interpolation
float p
apply(img, map_x, map_y, params)
apply_to_mask(mask, map_x, map_y, params)
}
class ElasticTransform {
int alpha
float sigma
bool approximate
bool same_dxdy
int mask_interpolation
}
class Perspective {
bool fit_output
int interpolation
int mask_interpolation
}
class Affine {
ScaleFloatType scale
ScaleFloatType translate_percent
ScaleIntType translate_px
ScaleFloatType rotate
ScaleFloatType shear
int interpolation
int mask_interpolation
}
class ShiftScaleRotate {
ScaleFloatType shift_limit
ScaleFloatType scale_limit
ScaleFloatType rotate_limit
int mask_interpolation
}
class PiecewiseAffine {
int mask_interpolation
}
class OpticalDistortion {
int mask_interpolation
}
class GridDistortion {
int mask_interpolation
}
class RandomScale {
ScaleFloatType scale_limit
int interpolation
int mask_interpolation
}
class LongestMaxSize {
int max_size
int interpolation
int mask_interpolation
}
class SmallestMaxSize {
int max_size
int interpolation
int mask_interpolation
}
class Resize {
int height
int width
int interpolation
int mask_interpolation
}
class Rotate {
SymmetricRangeType limit
int interpolation
int mask_interpolation
}
class SafeRotate {
int mask_interpolation
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ternaus - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ternaus - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 2 issues found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Fixes:
#1344
#850
#1145
#233
Summary by Sourcery
Introduce a 'mask_interpolation' parameter to allow specifying interpolation methods for masks in geometric transformations, addressing several related issues. Update tests to ensure the correct application of this new parameter.
Bug Fixes:
Enhancements:
Tests: