code: def scale_coords(coords, input_shape, im_shape, scale_factor):
      im_shape = im_shape.numpy()[0]
      ratio = scale_factor[0][0]
      pad_w = (input_shape[1] - int(im_shape[1])) / 2
      pad_h = (input_shape[0] - int(im_shape[0])) / 2
      coords = paddle.cast(coords, "float32")
      coords[:, 0::2] -= pad_w
      coords[:, 1::2] -= pad_h
      coords[:, 0:4] /= ratio
      coords[:, :4] = paddle.clip(
          coords[:, :4], min=0, max=coords[:, :4].max()
      )
      return coords.round()
  
imports: import os
  import cv2
  import time
  import paddle
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: scale_coords(coords, input_shape, im_shape, scale_factor) and returns: coords