栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

detectron2使用踩坑记录

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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:ruanjian13_2baofvcore-mainfvcore-mainfvcorecommoncheckpoint.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

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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/971775.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号