docstr: Detection model is initialized and set to self.model.
docstr_tok: ["Detection","model","is","initialized","and","set","to","self.model","."]
code: def load_model(self):
      """
      Detection model is initialized and set to self.model.
      """
  
      from ultralytics import YOLO
  
      try:
          model = YOLO(self.model_path)
          model.to(self.device)
          self.set_model(model)
      except Exception as e:
          raise TypeError(
              "model_path is not a valid yolov8 model path: ", e
          )
  
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 2 for calling the Yolov8DetectionModel obj's underlying member method code with example usage: obj.load_model() without return types