detectron2的demo运行来生成测试图像的结果

334 阅读1分钟

在detectron2的官网上有代码示例,但是因为有时候登录detectron2特别不稳定,在一定时间间隔内根本登录不上去,所以为了以后使用方便,在这里记录一下demo的具体使用方法。

cd demo/
python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
  --input input1.jpg input2.jpg \
  [--other-options]
  --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

 To save outputs to a directory (for images) or a file (for webcam or video), use --output.