code: def get_preprocesser(model_width, model_height):
      def preprocess(image):
          global device
          device = torch.device("cuda")
          image = cv2.cvtColor(
              cv2.resize(image, (model_width, model_height)),
              cv2.COLOR_BGR2RGB,
          )
          image = PIL.Image.fromarray(image)
          image = transforms.functional.to_tensor(image).to(device)
          image.sub_(mean[:, None, None]).div_(std[:, None, None])
          return image[None, ...]
  
      return preprocess
  
file_path: norfair/demos/profiling/src/utils.py
imports: import json
  import cv2
  import numpy
  import PIL.Image
  import torch
  import torch2trt
  import torchvision.transforms
  import trt_pose.coco
  import trt_pose.models
  from torch2trt import TRTModule
  from trt_pose.parse_objects import ParseObjects
  from norfair import Detection
  from norfair.distances import create_keypoints_voting_distance, create_normalized_mean_euclidean_distance
  from norfair.filter import FilterPyKalmanFilterFactory, NoFilterFactory, OptimizedKalmanFilterFactory
label_desc: Use image node_id 1 for calling a global function with example usage: get_preprocesser(model_width, model_height) and returns: preprocess, image