code: def crop_like_SiamFC(
      image,
      bbox,
      context_amount=0.5,
      exemplar_size=127,
      instance_size=255,
      padding=(0, 0, 0),
  ):
      """
      Dataset curation and avoid image resizing during training
      if the tight bounding box has size (w, h) and the context margin is p,
      then the scale factor s is chosen such that the area of the scaled rectangle is equal to a constant
      s(w+2p)×s(h+2p)=A.
  
      Parameters
      ----------
      image: np.array, image
      bbox: list or np.array, bbox
      context_amount: float, the amount of context to be half of the mean dimension
      exemplar_size: int, exemplar_size
      instance_size: int, instance_size
  
      Return:
          crop result exemplar z and instance x
      """
      target_pos = [
          (bbox[2] + bbox[0]) / 2.0,
          (bbox[3] + bbox[1]) / 2.0,
      ]
      target_size = [bbox[2] - bbox[0], bbox[3] - bbox[1]]
      wc_z = target_size[1] + context_amount * sum(target_size)
      hc_z = target_size[0] + context_amount * sum(target_size)
      s_z = np.sqrt(wc_z * hc_z)
      scale_z = exemplar_size / s_z
      d_search = (instance_size - exemplar_size) / 2
      pad = d_search / scale_z
      s_x = s_z + 2 * pad
  
      z = crop_hwc(
          image, pos_s_2_bbox(target_pos, s_z), exemplar_size, padding
      )
      x = crop_hwc(
          image, pos_s_2_bbox(target_pos, s_x), instance_size, padding
      )
      return z, x
  
imports: import numpy
  import sys
  from ..filesystem import try_import_cv2
label_desc: Use image node_id 3 for calling a global function with example usage: crop_like_SiamFC(image, bbox, context_amount, exemplar_size, instance_size, padding) and returns: z,  x