code: def expand_crop(images, rect, expand_ratio=0.3):
      imgh, imgw, c = images.shape
      label, conf, xmin, ymin, xmax, ymax = [
          int(x) for x in rect.tolist()
      ]
      if label != 0:
          return None, None, None
      org_rect = [xmin, ymin, xmax, ymax]
      h_half = (ymax - ymin) * (1 + expand_ratio) / 2.0
      w_half = (xmax - xmin) * (1 + expand_ratio) / 2.0
      if h_half > w_half * 4 / 3:
          w_half = h_half * 0.75
      center = [(ymin + ymax) / 2.0, (xmin + xmax) / 2.0]
      ymin = max(0, int(center[0] - h_half))
      ymax = min(imgh - 1, int(center[0] + h_half))
      xmin = max(0, int(center[1] - w_half))
      xmax = min(imgw - 1, int(center[1] + w_half))
      return (
          images[ymin:ymax, xmin:xmax, :],
          [xmin, ymin, xmax, ymax],
          org_rect,
      )
  
file_path: PaddleHub/modules/image/keypoint_detection/pp-tinypose/keypoint_preprocess.py
imports: import cv2
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: expand_crop(images, rect, expand_ratio) and returns: images,  list,  org_rect, None,  None,  None