docstr: Sets the underlying YoloNas model.
  Args:
      model: Any
          A YoloNas model
docstr_tok: ["Sets","the","underlying","YoloNas","model",".","Args",":","model",":","Any","A","YoloNas","model"]
code: def set_model(self, model: Any):
      """
      Sets the underlying YoloNas model.
      Args:
          model: Any
              A YoloNas model
      """
      from super_gradients.training.processing.processing import (
          get_pretrained_processing_params,
      )
  
      if (
          model.__class__.__module__.split(".")[-1]
          != "yolo_nas_variants"
      ):
          raise Exception(f"Not a YoloNas model: {type(model)}")
  
      # set default processing params for yolo_nas model
      processing_params = get_pretrained_processing_params(
          model_name=self.model_name, pretrained_weights="coco"
      )
      processing_params["conf"] = self.confidence_threshold
      if (
          self.class_names
      ):  # override class names for custom trained models
          processing_params["class_names"] = self.class_names
      model.set_dataset_processing_params(**processing_params)
      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/yolonas.py
imports: import logging
  from typing import Any, Dict, List, Optional
  import numpy
  from yaml import safe_load
  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 YoloNasDetectionModel obj's underlying member method code with example usage: obj.set_model(model) without return types