SysCV / transfiner

Mask Transfiner for High-Quality Instance Segmentation, CVPR 2022
https://www.vis.xyz/pub/transfiner
Apache License 2.0
534 stars 61 forks source link

input images can work very well by "--input", but web camera can`t work by “--webcam ” #33

Open hanjianwei92 opened 2 years ago

hanjianwei92 commented 2 years ago

i run python demo/demo.py --config-file configs/transfiner/mask_rcnn_R_50_FPN_1x.yaml --webcam --opts MODEL.WEIGHTS ./pretrained_model/output_1x_transfiner_r50.pth , but many errors occurred.

[07/20 21:26:09 fvcore.common.checkpoint]: [Checkpointer] Loading from ./pretrained_model/output_1x_transfiner_r50.pth ... 0it [00:00, ?it/s]C:\software\Miniconda3\envs\transfiner\lib\site-packages\detectron2-0.5-py3.7-win-amd64.egg\detectron2\modeling\roi_heads\fast_rcnn.py:154: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at ..\torch\csrc\utils\python_arg_parser.cpp:882.) filter_inds = filter_mask.nonzero() C:\software\Miniconda3\envs\transfiner\lib\site-packages\torch\nn\functional.py:3063: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) C:\software\Miniconda3\envs\transfiner\lib\site-packages\detectron2-0.5-py3.7-win-amd64.egg\detectron2\utils\videovisualizer.py:190: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool` here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations is_crowd = np.zeros((len(instances),), dtype=np.bool) 0it [00:04, ?it/s] Traceback (most recent call last): File "demo/demo.py", line 143, in for vis in tqdm.tqdm(demo.run_on_video(cam)): File "C:\software\Miniconda3\envs\transfiner\lib\site-packages\tqdm\std.py", line 1195, in iter for obj in iterable: File "C:\Users\hanji\Downloads\transfiner-main\demo\predictor.py", line 129, in run_on_video yield process_predictions(frame, self.predictor(frame)) File "C:\Users\hanji\Downloads\transfiner-main\demo\predictor.py", line 98, in process_predictions vis_frame = video_visualizer.draw_instance_predictions(frame, predictions) File "C:\software\Miniconda3\envs\transfiner\lib\site-packages\detectron2-0.5-py3.7-win-amd64.egg\detectron2\utils\video_visualizer.py", line 88, in draw_instance_predictions colors = self._assign_colors(detected) File "C:\software\Miniconda3\envs\transfiner\lib\site-packages\detectron2-0.5-py3.7-win-amd64.egg\detectron2\utils\video_visualizer.py", line 233, in _assign_colors inst.color = random_color(rgb=True, maximum=1) TypeError: random_color() missing 1 required positional argument: 'ii'

after fix random_color() , other errors still occurred.

lkeab commented 2 years ago

"after fix random_color() , other errors still occurred." What are the other errors that you met?

hanjianwei92 commented 2 years ago

"after fix random_color() , other errors still occurred." What are the other errors that you met?

can you run demo with "--webcam" normally?