docstr: Sets the underlying TorchVision model.
  Args:
      model: Any
          A TorchVision model
docstr_tok: ["Sets","the","underlying","TorchVision","model",".","Args",":","model",":","Any","A","TorchVision","model"]
code: def set_model(self, model: Any):
      """
      Sets the underlying TorchVision model.
      Args:
          model: Any
              A TorchVision model
      """
      check_requirements(["torch", "torchvision"])
  
      model.eval()
      self.model = model.to(self.device)
  
      # set category_mapping
      from sahi.utils.torchvision import COCO_CLASSES
  
      if self.category_mapping is None:
          category_names = {
              str(i): COCO_CLASSES[i] for i in range(len(COCO_CLASSES))
          }
          self.category_mapping = category_names
  
file_path: sahi/sahi/models/torchvision.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.import_utils import check_requirements
label_desc: Use image node_id 3 for calling the TorchVisionDetectionModel obj's underlying member method code with example usage: obj.set_model(model) without return types