【发布时间】:2020-06-25 17:13:09
【问题描述】:
我正在扩充我的图像数据集,其中还包含关键点。出于这个原因,我正在使用imgaug 库。以下是扩充代码:
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)
但在查看增强图像时,我发现了以下问题:
- 有些图像没有任何关键点。
- 在一些增强图像中,关键点超出了图像之外,尽管我一直在检查以阻止将这些增强输出保存在关键点不在图像内部的位置。
但奇怪的是,当我在我的 PC 上运行相同的代码时,它运行完全正常。但是当我在 Google-Colab 上运行它时,它会创建这些不需要的输出。为什么会这样?
【问题讨论】:
标签: computer-vision google-colaboratory object-detection data-augmentation keypoint