albumentations
albumentations copied to clipboard
Allow to set a custom mask interpolation method
This is POC to fix an issue in #850. It supports two styles for setting mask interpolation.
Option 1. Set a global value for mask interpolation through Compose:
t = A.Compose([
A.Resize(128, 128),
], mask_interpolation=cv2.INTER_NEAREST)
Option 2. Override a value for mask interpolation for a single transform:
t = A.Compose([
A.Resize(128, 128).set_mask_interpolation(cv2.INTER_NEAREST_EXACT),
])
Or as an alternative for Option 2, maybe it is better to an explicit argument for all DualTransform subclasses, such as
t = A.Compose([
A.Resize(128, 128, mask_interpolation=cv2.INTER_NEAREST_EXACT)
])
What do you think?
Or as an alternative for Option 2, maybe it is better to an explicit argument for all
DualTransformsubclasses, such ast = A.Compose([ A.Resize(128, 128, mask_interpolation=cv2.INTER_NEAREST_EXACT) ])What do you think?
I think approach better, but it is need to change __init__ method for all transforms. If we will do this, we must to add **kwargs as an argument for all transforms to have possibility to add new features simpler
please
@LucaBonfiglioli Will look into this.