配置好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



