code: def example2():
      """Example 2: Applying all transforms in one is very FAST !"""
      st = time.time()
      for _ in range(
          100
      ):  # Repeat 100 times and compute the averaged speed
          transform_matrix = create_transformation_matrix()
          result = tl.prepro.affine_transform_cv2(
              image, transform_matrix, border_mode="replicate"
          )  # Transform the image using a single operation
          tl.vis.save_image(result, "_result_fast_{}.png".format(_))
      print(
          "apply all transforms once took %fs for each image"
          % ((time.time() - st) / 100)
      )  # usually 50x faster
      tl.vis.save_image(result, "_result_fast.png")
  
file_path: TensorLayer/examples/data_process/tutorial_fast_affine_transform.py
imports: import multiprocessing
  import time
  import numpy
  import cv2
  import tensorflow
  import tensorlayer
label_desc: Use image node_id 3 for calling a global function with example usage: example2() without return types