docstr: Prediction is performed using self.model and the prediction result is set to self._original_predictions.
  Args:
      image: np.ndarray
          A numpy array that contains the image to be predicted. 3 channel image should be in RGB order.
docstr_tok: ["Prediction","is","performed","using","self.model","and","the","prediction","result","is","set","to","self._original_predictions",".","Args",":","image",":","np.ndarray","A","numpy","array","that","contains","the","image","to","be","predicted",".","3","channel","image","should","be","in","RGB","order","."]
code: def perform_inference(self, image: np.ndarray):
      """
      Prediction is performed using self.model and the prediction result is set to self._original_predictions.
      Args:
          image: np.ndarray
              A numpy array that contains the image to be predicted. 3 channel image should be in RGB order.
      """
  
      # Confirm model is loaded
      if self.model is None:
          raise ValueError(
              "Model is not loaded, load it by calling .load_model()"
          )
  
      # Get input/output names shapes
      model_inputs = self.model.get_inputs()
      model_output = self.model.get_outputs()
  
      input_names = [
          model_inputs[i].name for i in range(len(model_inputs))
      ]
      output_names = [
          model_output[i].name for i in range(len(model_output))
      ]
  
      input_shape = model_inputs[0].shape[2:]  # w, h
      image_shape = image.shape[:2]  # h, w
  
      # Prepare image
      image_tensor = self._preprocess_image(image, input_shape)
  
      # Inference
      outputs = self.model.run(
          output_names, {input_names[0]: image_tensor}
      )
  
      # Post-process
      prediction_results = self._post_process(
          outputs, input_shape, image_shape
      )
      self._original_predictions = prediction_results
  
imports: import logging
  from typing import Any, Dict, List, Optional, Tuple
  import cv2
  import numpy
  import torch
  from sahi.models.base import DetectionModel
  from sahi.prediction import ObjectPrediction
  from sahi.utils.compatibility import fix_full_shape_list, fix_shift_amount_list
  from sahi.utils.import_utils import check_requirements
  from sahi.utils.yolov8onnx import non_max_supression, xywh2xyxy
label_desc: Use image node_id 7 for calling the Yolov8OnnxDetectionModel obj's underlying member method code with example usage: obj.perform_inference(image) without return types