code: def __init__(
      self,
      model_name: str,
      model_path: Optional[str] = None,
      class_names_yaml_path: Optional[List[str]] = None,
      **kwargs,
  ):
      if model_name is not None and not isinstance(model_name, str):
          raise TypeError(
              f"model_name should be a string, got {model_name} with type of '{model_name.__class__.__name__}'"
          )
      if model_name not in ["yolo_nas_s", "yolo_nas_m", "yolo_nas_l"]:
          raise ValueError(f"Unsupported model type {model_name}")
      if (
          not model_path
      ):  # use pretrained models downloaded from Deci-AI remote client
          self.pretrained_weights = "coco"
          self.class_names = None
          self.num_classes = None
      else:  # use local / custom trained models
          self.pretrained_weights = None
          if not class_names_yaml_path:
              raise ValueError(
                  "'class_names_yaml_path' should be provided for the models that have custom class mapping"
              )
          with open(class_names_yaml_path, "r") as fs:
              yaml_content = safe_load(fs)
              if not isinstance(yaml_content, list):
                  raise ValueError(
                      "Invalid yaml file format, make sure your class names are given in list format in yaml"
                  )
              self.class_names = yaml_content
          self.num_classes = len(self.class_names)
      self.model_name = model_name
      super().__init__(model_path=model_path, **kwargs)
  
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 1 to create a new YoloNasDetectionModel object from inherited base classes: DetectionModel with example: obj = YoloNasDetectionModel(model_name, model_path, class_names_yaml_path)