如何在Google Colab上使用DentectRon2启动网络摄像头检测?

发布于 2025-02-07 11:10:48 字数 788 浏览 2 评论 0原文

我正在使用DentectRon2来实现实时细分。训练了模型后,我尝试使用此脚本对网络摄像头视频进行推断:

!git clone https://github.com/facebookresearch/detectron2

%run detectron2/deco. demo.py -config-file/content/config.yml--webcam --confidence-threshold 0.6 -opts model.weights.weaters/content/content/output/model_final.pth.pth

输出是:

[06/15 12:33:39 detectron2]: Arguments: Namespace(confidence_threshold=0.6, config_file='/content/config.yml', input=None, opts=['MODEL.WEIGHTS', '/content/output/model_final.pth'], output=None, video_input=None, webcam=True)
[06/15 12:33:40 fvcore.common.checkpoint]: [Checkpointer] Loading from /content/output/model_final.pth ...
0it [00:00, ?it/s]

但是,网络摄像头确实可以不起作用。

谁能帮助我解决问题?

提前致谢。

I'm using Detectron2 to implement real time segmentation. After training my model, I tried to perform the inference on my webcam video, using this script:

!git clone https://github.com/facebookresearch/detectron2

%run detectron2/demo/demo.py --config-file /content/config.yml --webcam --confidence-threshold 0.6 --opts MODEL.WEIGHTS /content/output/model_final.pth

The output was:

[06/15 12:33:39 detectron2]: Arguments: Namespace(confidence_threshold=0.6, config_file='/content/config.yml', input=None, opts=['MODEL.WEIGHTS', '/content/output/model_final.pth'], output=None, video_input=None, webcam=True)
[06/15 12:33:40 fvcore.common.checkpoint]: [Checkpointer] Loading from /content/output/model_final.pth ...
0it [00:00, ?it/s]

However, the webcam does not work.

Can anyone help me to solve the problem?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乞讨 2025-02-14 11:10:48

Yuxin Wu(detectron2的创建者)注释在此github问题上供人们构建代码的占位符功能,“ - webcam”输入不能保存输出:

按预期工作为- 网络摄像头当前不保存输出。
您可以以脚本为例来实现新功能。

Yuxin Wu (The creator of detectron2) commented on this github issue that this is more of a placeholder feature for people to build code off of, and the "--webcam" input does not save outputs:

Working as expected as --webcam does not currently save outputs.
You can take the script as an example to implement new functionalities.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文