title: In detectron2 there are class IDs instead of class names
body: <p><a href="https://i.stack.imgur.com/dI9JA.png" rel="nofollow noreferrer">I finished training model for instance segmentation in detectron2 when I test images in training files there is no problem class names(apple,banana,orange) are written on the image but I downloaded some fruit images from the internet and class names are not written on the photos. There are class ID's.</a></p>
  <pre><code>cfg.MODEL.WEIGHTS = os.path.join(cfg.OUTPUT_DIR, &quot;model_final.pth&quot;)
  cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 
  cfg.DATASETS.TEST = (&quot;fruit_test&quot;, )
  predictor = DefaultPredictor(cfg)
  
  image_path = &quot;/content/detectron2_custom_dataset/testimages/test2.jpg&quot;
  
  def on_image(image_path,predictor):
      im = cv2.imread(image_path)
      outputs = predictor(im)
      v = Visualizer(im[:,:,::-1], metadata = {}, scale=0.5, instance_mode = ColorMode.SEGMENTATION)
      v = v.draw_instance_predictions(outputs[&quot;instances&quot;].to(&quot;cpu&quot;))
      plt.figure(figsize=(14,10))
      plt.imshow(v.get_image())
      plt.show()
  
  on_image(image_path, predictor)
  </code></pre>
  <p><strong>In conclusion, I want test my model with I uploaded now and I don't want to have class id on the images. I want class names like orange,banana,apple on it</strong></p>