code: def test_many_augmenters(self):
      keypoints = []
      for y in sm.xrange(40 // 5):
          for x in sm.xrange(60 // 5):
              keypoints.append(ia.Keypoint(y=y * 5, x=x * 5))
  
      keypoints_oi = ia.KeypointsOnImage(keypoints, shape=(40, 60, 3))
      keypoints_oi_empty = ia.KeypointsOnImage([], shape=(40, 60, 3))
  
      augs = [
          iaa.Add((-5, 5), name="Add"),
          iaa.AddElementwise((-5, 5), name="AddElementwise"),
          iaa.AdditiveGaussianNoise(
              0.01 * 255, name="AdditiveGaussianNoise"
          ),
          iaa.Multiply((0.95, 1.05), name="Multiply"),
          iaa.Dropout(0.01, name="Dropout"),
          iaa.CoarseDropout(0.01, size_px=6, name="CoarseDropout"),
          iaa.Invert(0.01, per_channel=True, name="Invert"),
          iaa.GaussianBlur(sigma=(0.95, 1.05), name="GaussianBlur"),
          iaa.AverageBlur((3, 5), name="AverageBlur"),
          iaa.MedianBlur((3, 5), name="MedianBlur"),
          iaa.Sharpen((0.0, 0.1), lightness=(1.0, 1.2), name="Sharpen"),
          iaa.Emboss(
              alpha=(0.0, 0.1), strength=(0.5, 1.5), name="Emboss"
          ),
          iaa.EdgeDetect(alpha=(0.0, 0.1), name="EdgeDetect"),
          iaa.DirectedEdgeDetect(
              alpha=(0.0, 0.1), direction=0, name="DirectedEdgeDetect"
          ),
          iaa.Fliplr(0.5, name="Fliplr"),
          iaa.Flipud(0.5, name="Flipud"),
          iaa.Affine(translate_px=(-5, 5), name="Affine-translate-px"),
          iaa.Affine(
              translate_percent=(-0.05, 0.05),
              name="Affine-translate-percent",
          ),
          iaa.Affine(rotate=(-20, 20), name="Affine-rotate"),
          iaa.Affine(shear=(-20, 20), name="Affine-shear"),
          iaa.Affine(scale=(0.9, 1.1), name="Affine-scale"),
          iaa.PiecewiseAffine(
              scale=(0.001, 0.005), name="PiecewiseAffine"
          ),
          iaa.ElasticTransformation(
              alpha=(0.1, 0.2),
              sigma=(0.1, 0.2),
              name="ElasticTransformation",
          ),
          iaa.BlendAlpha((0.0, 0.1), iaa.Add(10), name="BlendAlpha"),
          iaa.BlendAlphaElementwise(
              (0.0, 0.1), iaa.Add(10), name="BlendAlphaElementwise"
          ),
          iaa.BlendAlphaSimplexNoise(
              iaa.Add(10), name="BlendAlphaSimplexNoise"
          ),
          iaa.BlendAlphaFrequencyNoise(
              exponent=(-2, 2),
              foreground=iaa.Add(10),
              name="BlendAlphaSimplexNoise",
          ),
          iaa.Superpixels(p_replace=0.01, n_segments=64),
          iaa.Resize(0.5, name="Resize"),
          iaa.CropAndPad(px=(-10, 10), name="CropAndPad"),
          iaa.Pad(px=(0, 10), name="Pad"),
          iaa.Crop(px=(0, 10), name="Crop"),
      ]
  
      for aug in augs:
          dss = []
          for i in sm.xrange(10):
              aug_det = aug.to_deterministic()
  
              kp_fully_empty_aug = aug_det.augment_keypoints([])
              assert kp_fully_empty_aug == []
  
              kp_first_empty_aug = aug_det.augment_keypoints(
                  keypoints_oi_empty
              )
              assert len(kp_first_empty_aug.keypoints) == 0
  
              kp_image = keypoints_oi.to_keypoint_image(size=5)
              with assertWarns(
                  self, iaa.SuspiciousSingleImageShapeWarning
              ):
                  kp_image_aug = aug_det.augment_image(kp_image)
              kp_image_aug_rev = (
                  ia.KeypointsOnImage.from_keypoint_image(
                      kp_image_aug,
                      if_not_found_coords={"x": -9999, "y": -9999},
                      nb_channels=1,
                  )
              )
              kp_aug = aug_det.augment_keypoints([keypoints_oi])[0]
              ds = []
              assert len(kp_image_aug_rev.keypoints) == len(
                  kp_aug.keypoints
              ), "Lost keypoints for '%s' (%d vs expected %d)" % (
                  aug.name,
                  len(kp_aug.keypoints),
                  len(kp_image_aug_rev.keypoints),
              )
  
              gen = zip(kp_aug.keypoints, kp_image_aug_rev.keypoints)
              for kp_pred, kp_pred_img in gen:
                  kp_pred_lost = (
                      kp_pred.x == -9999 and kp_pred.y == -9999
                  )
                  kp_pred_img_lost = (
                      kp_pred_img.x == -9999 and kp_pred_img.y == -9999
                  )
  
                  if not kp_pred_lost and not kp_pred_img_lost:
                      d = np.sqrt(
                          (kp_pred.x - kp_pred_img.x) ** 2
                          + (kp_pred.y - kp_pred_img.y) ** 2
                      )
                      ds.append(d)
              dss.extend(ds)
              if len(ds) == 0:
                  print(
                      "[INFO] No valid keypoints found for '%s' "
                      "in test_keypoint_augmentation()" % (str(aug),)
                  )
          assert (
              np.average(dss) < 5.0
          ), "Average distance too high (%.2f, with ds: %s)" % (
              np.average(dss),
              str(dss),
          )
  
file_path: imgaug/test/augmenters/test_mixed_files.py
imports: from __future__ import print_function, division, absolute_import
  import sys
  import numpy
  import skimage
  import skimage.data
  import six.moves
  import imgaug
  from imgaug import augmenters
  from imgaug.testutils import create_random_images, array_equal_lists, keypoints_equal, reseed, assertWarns
label_desc: Use image node_id 2 for calling the TestKeypointAugmentation obj's underlying member method code with example usage: obj.test_many_augmenters() without return types