facebookresearch / facebookresearch/detectron2
Video inferencing shows category IDs instead of class names
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
I did object detection using detectron2 on a video. The output video does the detection, but it indicates category ids of either 1 or 2. But I want my detection to show the class names of either 'weed' or 'crop' instead.

## Instructions To Reproduce the Issue:
1. Here's the code to do the video inferencing:
```
%run detectron2/demo/demo.py --config-file /content/config2.yaml --video-input /content/crop-weed.mp4 --confidence-threshold 0.6 --output output_colab.mp4 \
--opts MODEL.WEIGHTS /content/output/model_final.pth
```
## Expected behavior:
I expected detectron2 to do the video inference and show the class names of either 'weed' or 'crop' around the bounding box.
## Environment:
- Google Colab
Contributor guide
Research direction
Start by reproducing the command in detectron2/demo/demo.py with the supplied config2.yaml, video, and model weights. Trace how video predictions are rendered and where category IDs are converted to labels; done means the output video displays “weed” or “crop” around each bounding box.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100