facebookresearch / facebookresearch/detectron2
meet a bug when run demo with video
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
## Instructions To Reproduce the 🐛 Bug:
1. Full runnable code or full changes you made:
runnable code, just the demo
If making changes to the project itself, please use output of the following command:
git rev-parse HEAD; git diff
```
2. What exact command you run:
python demo/demo.py --config-file configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml --video-input input/1.mp4 --output output/ --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
3. __Full logs__ or other relevant observations:
```
[12/10 22:54:34 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml', input=None, opts=['MODEL.WEIGHTS', 'detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl'], output='output/', video_input='input/1.mp4', webcam=False)
[12/10 22:54:38 fvcore.common.checkpoint]: [Checkpointer] Loading from detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl ...
[12/10 22:54:38 fvcore.common.checkpoint]: Reading a file from 'Detectron2 Model Zoo'
WARNING [12/10 22:54:38 fvcore.common.checkpoint]: The checkpoint state_dict contains keys that are not used by the model:
roi_heads.mask_head.mask_fcn1.{bias, weight}
roi_heads.mask_head.mask_fcn2.{bias, weight}
roi_heads.mask_head.mask_fcn3.{bias, weight}
roi_heads.mask_head.mask_fcn4.{bias, weight}
roi_heads.mask_head.deconv.{bias, weight}
roi_heads.mask_head.predictor.{bias, weight}
OpenH264 Video Codec provided by Cisco Systems, Inc.
0%| | 0/7957 [00:02
for vis_frame in tqdm.tqdm(demo.run_on_video(video), total=num_frames):
File "D:\anaconda\envs\detectron2_env\lib\site-packages\tqdm-4.62.3-py3.7.egg\tqdm\std.py", line 1180, in
__iter__
for obj in iterable:
File "D:\pytorch_file\detectron2\demo\predictor.py", line 129, in run_on_video
yield process_predictions(frame, self.predictor(frame))
File "D:\pytorch_file\detectron2\demo\predictor.py", line 98, in process_predictions
vis_frame = video_visualizer.draw_instance_predictions(frame, predictions)
File "d:\pytorch_file\detectron2\detectron2\utils\video_visualizer.py", line 111, in draw_instance_predictions
else [y[0] for y in filter(lambda x: x[1], zip(labels, visibilities))]
```
this only happened when i use video as the input, when i simply use image, the demo works will.
4. please simplify the steps as much as possible so they do not require additional resources to
run, such as a private dataset.
## Expected behavior:
If there are no obvious error in "full logs" provided above,
please tell us the expected behavior.
## Environment: win10, cuda11.1, torch1.8.0
Provide your environment information using the following command:
```
wget -nc -q https://github.com/facebookresearch/detectron2/raw/main/detectron2/utils/collect_env.py && python collect_env.py
```
If your issue looks like an installation issue / environment issue,
please first try to solve it yourself with the instructions in
https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues
Contributor guide
Assessment
This issue has not been assessed yet.