code: def get_prediction(
      image,
      detection_model,
      shift_amount: list = [0, 0],
      full_shape=None,
      postprocess: Optional[PostprocessPredictions] = None,
      verbose: int = 0,
  ) -> PredictionResult:
      """
      Function for performing prediction for given image using given detection_model.
  
      Arguments:
          image: str or np.ndarray
              Location of image or numpy image matrix to slice
          detection_model: model.DetectionMode
          shift_amount: List
              To shift the box and mask predictions from sliced image to full
              sized image, should be in the form of [shift_x, shift_y]
          full_shape: List
              Size of the full image, should be in the form of [height, width]
          postprocess: sahi.postprocess.combine.PostprocessPredictions
          verbose: int
              0: no print (default)
              1: print prediction duration
  
      Returns:
          A dict with fields:
              object_prediction_list: a list of ObjectPrediction
              durations_in_seconds: a dict containing elapsed times for profiling
      """
      durations_in_seconds = dict()
  
      # read image as pil
      image_as_pil = read_image_as_pil(image)
      # get prediction
      time_start = time.time()
      detection_model.perform_inference(
          np.ascontiguousarray(image_as_pil)
      )
      time_end = time.time() - time_start
      durations_in_seconds["prediction"] = time_end
  
      # process prediction
      time_start = time.time()
      # works only with 1 batch
      detection_model.convert_original_predictions(
          shift_amount=shift_amount,
          full_shape=full_shape,
      )
      object_prediction_list: List[
          ObjectPrediction
      ] = detection_model.object_prediction_list
  
      # postprocess matching predictions
      if postprocess is not None:
          object_prediction_list = postprocess(object_prediction_list)
  
      time_end = time.time() - time_start
      durations_in_seconds["postprocess"] = time_end
  
      if verbose == 1:
          print(
              "Prediction performed in",
              durations_in_seconds["prediction"],
              "seconds.",
          )
  
      return PredictionResult(
          image=image,
          object_prediction_list=object_prediction_list,
          durations_in_seconds=durations_in_seconds,
      )
  
imports: import logging
  import os
  import time
  from typing import List, Optional
  from sahi.utils.import_utils import is_available
  from functools import cmp_to_key
  import numpy
  from tqdm import tqdm
  from sahi.auto_model import AutoDetectionModel
  from sahi.models.base import DetectionModel
  from sahi.postprocess.combine import GreedyNMMPostprocess, LSNMSPostprocess, NMMPostprocess, NMSPostprocess, PostprocessPredictions
  from sahi.prediction import ObjectPrediction, PredictionResult
  from sahi.slicing import slice_image
  from sahi.utils.coco import Coco, CocoImage
  from sahi.utils.cv import IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, crop_object_predictions, cv2, get_video_reader, read_image_as_pil, visualize_object_predictions
  from sahi.utils.file import Path, increment_path, list_files, save_json, save_pickle
  from sahi.utils.import_utils import check_requirements
label_desc: Use image node_id 1 for calling a global function with example usage: get_prediction(image, detection_model, shift_amount, full_shape, postprocess, verbose) and returns: PredictionResult