docstr: Sets the underlying YOLOv5 model.
  Args:
      model: Any
          A YOLOv5 model
docstr_tok: ["Sets","the","underlying","YOLOv5","model",".","Args",":","model",":","Any","A","YOLOv5","model"]
code: def set_model(self, model: Any):
      """
      Sets the underlying YOLOv5 model.
      Args:
          model: Any
              A YOLOv5 model
      """
  
      if model.__class__.__module__ not in [
          "yolov5.models.common",
          "models.common",
      ]:
          raise Exception(f"Not a yolov5 model: {type(model)}")
  
      model.conf = self.confidence_threshold
      self.model = model
  
      # set category_mapping
      if not self.category_mapping:
          category_mapping = {
              str(ind): category_name
              for ind, category_name in enumerate(self.category_names)
          }
          self.category_mapping = category_mapping
  
file_path: sahi/sahi/models/yolov5.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_package_minimum_version, check_requirements
label_desc: Use image node_id 3 for calling the Yolov5DetectionModel obj's underlying member method code with example usage: obj.set_model(model) without return types