code: def image_preprocess(img_path, target_shape):
      """
      image_preprocess func
      """
      img = cv2.imread(img_path)
      im_scale_y, im_scale_x = generate_scale(
          img, target_shape, keep_ratio=False
      )
      img = cv2.resize(
          img,
          (target_shape[0], target_shape[0]),
          interpolation=cv2.INTER_LANCZOS4,
      )
      img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
      img = np.transpose(img, [2, 0, 1]) / 255
      img = np.expand_dims(img, 0)
      img_mean = np.array([0.485, 0.456, 0.406]).reshape((3, 1, 1))
      img_std = np.array([0.229, 0.224, 0.225]).reshape((3, 1, 1))
      img -= img_mean
      img /= img_std
      scale_factor = np.array([[im_scale_y, im_scale_x]])
      return img.astype(np.float32), scale_factor.astype(np.float32)
  
imports: import os
  import argparse
  import time
  import sys
  import cv2
  import numpy
  import paddle
  from paddle.inference import Config
  from paddle.inference import create_predictor
  from ppdet.core.workspace import load_config, create
  from ppdet.metrics import COCOMetric
  from post_process import PPYOLOEPostProcess
label_desc: Use image node_id 3 for calling a global function with example usage: image_preprocess(img_path, target_shape) and returns: img,  scale_factor