Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hanjianwei92 opened this issue Jul 20, 2022 · 2 comments

Comments

@hanjianwei92
Copy link

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\video_visualizer.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
Copy link
Collaborator

lkeab commented Jul 21, 2022

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

@hanjianwei92
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants