Detection2(一)安装

Detection2(一)安装

  • 源码下载及编译
    • 下载
    • 编译
  • Demo

源码下载及编译

下载

可以在github上下载或者直接通过命令行下载

  1. 链接下载: https://github.com/facebookresearch/detectron2

  2. 命令下载:

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

编译

python -m pip install -e detectron2

Demo

首先在 model_zoo 里选择一个预训练的 model,这里选择 mask_rcnn_R_50_FPN_3x.yaml.

python demo/demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
 --input input1.jpg \
 --output . \
 --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl 

说明一下:
-config-file configs/COCO-… 读取 model 配置

–input input1.jpg 设置输入。 input1.jpg 位于根目录
–output . |设置输出路径,这里设为根目录

你可能感兴趣的:(目标检测,深度学习,计算机视觉)