code: def test_perspective_keep_size():
      h, w = 100, 100
      img = np.zeros([h, w, 3], dtype=np.uint8)
      h, w = img.shape[:2]
      bboxes = []
      for _ in range(10):
          x1 = np.random.randint(0, w - 1)
          y1 = np.random.randint(0, h - 1)
          x2 = np.random.randint(x1 + 1, w)
          y2 = np.random.randint(y1 + 1, h)
          bboxes.append([x1, y1, x2, y2])
      keypoints = [
          (
              np.random.randint(0, w),
              np.random.randint(0, h),
              np.random.random(),
          )
          for _ in range(10)
      ]
  
      transform_1 = A.Compose(
          [A.Perspective(keep_size=True, p=1)],
          keypoint_params=A.KeypointParams("xys"),
          bbox_params=A.BboxParams(
              "pascal_voc", label_fields=["labels"]
          ),
      )
      transform_2 = A.Compose(
          [A.Perspective(keep_size=False, p=1), A.Resize(h, w)],
          keypoint_params=A.KeypointParams("xys"),
          bbox_params=A.BboxParams(
              "pascal_voc", label_fields=["labels"]
          ),
      )
  
      set_seed()
      res_1 = transform_1(
          image=img,
          bboxes=bboxes,
          keypoints=keypoints,
          labels=[0] * len(bboxes),
      )
      set_seed()
      res_2 = transform_2(
          image=img,
          bboxes=bboxes,
          keypoints=keypoints,
          labels=[0] * len(bboxes),
      )
  
      assert np.allclose(res_1["bboxes"], res_2["bboxes"])
      assert np.allclose(res_1["keypoints"], res_2["keypoints"])
  
imports: import random
  from functools import partial
  import cv2
  import numpy
  import pytest
  import albumentations
  import albumentations.augmentations.functional
  import albumentations.augmentations.geometric.functional
  from albumentations.augmentations.blur.functional import gaussian_blur
  from .utils import get_dual_transforms, get_image_only_transforms, get_transforms
label_desc: Use image node_id 39 for calling a global function with example usage: test_perspective_keep_size() without return types