detectron2使用踩坑记录

配置好detectron2,却不会使用。
网上找了一张街道图01.jpg放入文件夹images。
创建空文件夹results存放输出结果。
在detectron2路径下键入 目标检测

python demo/demo.py   --config-file configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml  --input images/01.jpg   --output results   --opts MODEL.WEIGHTS models/model_final_b275ba.pkl

报错:

File "e:\ruanjian\13_2bao\fvcore-main\fvcore-main\fvcore\common\checkpoint.py", line 153, in load
    assert os.path.isfile(path), "Checkpoint {} not found!".format(path)
AssertionError: Checkpoint models/model_final_b275ba.pkl not found!

在这里插入图片描述

改为:python demo/demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --input images/01.jpg --output results --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
解释:–opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl 会直接从网上下载,我们可以预先下载到本地,然后指定路径即可。参考零基础视角----学习detectron2如何训练自己数据集

model_final_f10217.pkl为实例分割
model_final_b275ba.pkl为目标检测
model_final_cafdb1.pkl为全景分割

webcam 就是开摄像头 实时监测
python demo/demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --webcam --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

除了model_final_f10217.pkl,其他可以参考Detectron2 快速开始,使用 WebCam 测试
去把 model zoo的模型 下载到本地

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

是孑然呀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值