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()"
          )
      if (
          self.image_size is not None
      ):  # ADDED IMAGE SIZE OPTION FOR YOLOV8 MODELS:
          prediction_result = self.model(
              image[:, :, ::-1],
              imgsz=self.image_size,
              verbose=False,
              device=self.device,
          )  # YOLOv8 expects numpy arrays to have BGR
      else:
          prediction_result = self.model(
              image[:, :, ::-1], verbose=False, device=self.device
          )  # YOLOv8 expects numpy arrays to have BGR
      prediction_result = [
          result.boxes.data[
              result.boxes.data[:, 4] >= self.confidence_threshold
          ]
          for result in prediction_result
      ]
  
      self._original_predictions = prediction_result
  
file_path: sahi/sahi/models/yolov8.py
imports: import logging
  from typing import Any, Dict, List, Optional
  import numpy
  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
label_desc: Use image node_id 4 for calling the Yolov8DetectionModel obj's underlying member method code with example usage: obj.perform_inference(image) without return types