docstr: Returns number of categories
docstr_tok: ["Returns","number","of","categories"]
code: def num_categories(self):
      """
      Returns number of categories
      """
      num_categories = len(self.category_mapping)
      return num_categories
  
file_path: sahi/sahi/models/detectron2.py
imports: import logging
  from typing import List, Optional
  import numpy
  from sahi.models.base import DetectionModel
  from sahi.prediction import ObjectPrediction
  from sahi.utils.cv import get_bbox_from_bool_mask
  from sahi.utils.import_utils import check_requirements
label_desc: Use image node_id 4 for calling the Detectron2DetectionModel obj's underlying member method code with example usage: obj.num_categories() and returns: num_categories