code: def padding_minibatch(
      batch_data, coarsest_stride=0, use_padded_im_info=True
  ):
      max_shape_org = np.array(
          [data["image"].shape for data in batch_data]
      ).max(axis=0)
      if coarsest_stride > 0:
          max_shape = np.zeros((3)).astype("int32")
          max_shape[1] = int(
              np.ceil(max_shape_org[1] / coarsest_stride)
              * coarsest_stride
          )
          max_shape[2] = int(
              np.ceil(max_shape_org[2] / coarsest_stride)
              * coarsest_stride
          )
      else:
          max_shape = max_shape_org.astype("int32")
  
      padding_image = list()
      padding_info = list()
      padding_shape = list()
  
      for data in batch_data:
          im_c, im_h, im_w = data["image"].shape
          # image
          padding_im = np.zeros(
              (im_c, max_shape[1], max_shape[2]), dtype=np.float32
          )
          padding_im[:, 0:im_h, 0:im_w] = data["image"]
          padding_image.append(padding_im)
          # im_info
          data["im_info"][0] = (
              max_shape[1] if use_padded_im_info else max_shape_org[1]
          )
          data["im_info"][1] = (
              max_shape[2] if use_padded_im_info else max_shape_org[2]
          )
          padding_info.append(data["im_info"])
          padding_shape.append(data["im_shape"])
  
      padding_image = np.array(padding_image).astype("float32")
      padding_info = np.array(padding_info).astype("float32")
      padding_shape = np.array(padding_shape).astype("float32")
      return padding_image, padding_info, padding_shape
  
file_path: PaddleHub/modules/image/object_detection/faster_rcnn_resnet50_fpn_venus/data_feed.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os
  from collections import OrderedDict
  import cv2
  import numpy
  from PIL import Image, ImageEnhance
  from paddle import fluid
label_desc: Use image node_id 2 for calling a global function with example usage: padding_minibatch(batch_data, coarsest_stride, use_padded_im_info) and returns: padding_image,  padding_info,  padding_shape