code: def crop_image(all_frames, xxyys, scale_factor=0.25):
      out_frames = []
      for frame, xxyy in zip(all_frames, xxyys):
          h, w = frame.shape[:2]
          xmin, xmax, ymin, ymax = xxyy
          xc, yc = (xmin + xmax) / 2, (ymin + ymax) / 2
          l = max(xmax - xmin, ymax - ymin)
          xmin, xmax = max(0, xc - l / 2), min(w, xc + l / 2)
          ymin, ymax = max(0, yc - l / 2), min(h, yc + l / 2)
          xmin, xmax = int(xmin), int(xmax)
          ymin, ymax = int(ymin), int(ymax)
          frame = frame[ymin:ymax, xmin:xmax, :].copy()
          frame = cv2.resize(
              frame, (int(scale_factor * w), int(scale_factor * h))
          )
          frame = frame[::-1, :, ::-1] / 255
          out_frames.append(frame)
      return out_frames
  
file_path: insightface/body/human_pose/ambiguity_aware/scripts/plot2.py
imports: import os
  import cv2
  import random
  import os.path
  import numpy
  import matplotlib.pyplot
  import matplotlib.animation
  from mpl_toolkits.mplot3d import Axes3D
  import h5py
  from tqdm import trange
  import argparse
label_desc: Use image node_id 3 for calling a global function with example usage: crop_image(all_frames, xxyys, scale_factor) and returns: out_frames