Open YJonmo opened 1 year ago
Updates: it appears the issue of this shift is due to the default interpolation method for the alb.Downscale function. If interpolation=cv2.INTER_CUBIC or interpolation=cv2.INTER_LINEAR then the transformed image and mask overlap correctly.
And by the way, how to find out which of the transformations are applied using an instance created by my_instance = alb.Compose(transform_list), if all of the p in the transform_list are 0.5?
And by the way, how to find out which of the transformations are applied using an instance created by my_instance = alb.Compose(transform_list), if all of the p in the transform_list are 0.5?
For this purpose try to use ReplayCompose
🐛 Bug
After applying the transformations (most likely due to random_crop/blur/Downscale), the mask drifts. This drift can be seen in the image_after, particularly around the shoes and head.
To Reproduce
Steps to reproduce the behavior:
to create the masked image: image_before = cv2.bitwise_and(fg_image, fg_image, mask=fg_mask) transformed = aug_transforms(image=fg_image, mask=fg_mask) fg_image = transformed["image"] fg_mask = transformed["mask"] image_after = cv2.bitwise_and(fg_image, fg_image, mask=fg_mask)
Expected behavior
Environment