I am augmenting my image data-set which also contains key-points. For this reason I am using imgaug
library. Following is the augmentation code:
kps = KeypointsOnImage(__keypoints, shape=_image.shape)
seq = iaa.Sequential([
iaa.Affine(
scale={"x": (0.8, 1.2), "y": (0.8, 1.2)}, # scale images to 80-120% of their size, individually per axis
translate_percent={"x": (-0.2, 0.2), "y": (-0.2, 0.2)}, # translate by -20 to +20 percent (per axis)
rotate=(-90, 90), # rotate by -45 to +45 degrees
order=[0, 1], # use nearest neighbour or bilinear interpolation (fast)
cval=(0, 255),
),
iaa.Fliplr(0.5),
], random_order=True)
# Augment keypoints and images.
image_aug, kps_aug = seq(image = _image, keypoints=kps)
But while reviewing the augmented images I found following problems:
- Some of the images doesn't come with any key-points.
- In some augmented images key-points are going outside of images although I kept checks to block those augmented outputs to be saved where the key-points are not inside the images.
But the weird thing is that the same code when I run it on my PC it runs completely okay. But when I run it on Google-Colab it creates these unwanted outputs. Why this is happening?