您当前的位置: 首页 > 
  • 0浏览

    0关注

    2393博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

CV之detectron2:detectron2的简介、安装、使用方法之详细攻略

一个处女座的程序猿 发布时间:2019-11-19 20:54:31 ,浏览量:0

CV之detectron2:detectron2的简介、安装、使用方法之详细攻略

 

 

目录

detectron2的简介

1、Detectron2—What's New

detectron2的安装

1、Requirements

2、Build and Install Detectron2

1、官方安装

2、Windows下安装

3、Detectron2 Model Zoo and Baselines

COCO Object Detection Baselines

COCO Instance Segmentation Baselines with Mask R-CNN

COCO Person Keypoint Detection Baselines with Keypoint R-CNN

COCO Panoptic Segmentation Baselines with Panoptic FPN

LVIS Instance Segmentation Baselines with Mask R-CNN

Cityscapes & Pascal VOC Baselines

Other Settings

detectron2的使用方法

 

 

detectron2的简介

         Detectron is Facebook AI Research's software system that implements state-of-the-art object detection algorithms, including Mask R-CNN. It is written in Python and powered by the Caffe2 deep learning framework.          At FAIR, Detectron has enabled numerous research projects, including: Feature Pyramid Networks for Object Detection, Mask R-CNN, Detecting and Recognizing Human-Object Interactions, Focal Loss for Dense Object Detection, Non-local Neural Networks, Learning to Segment Every Thing, Data Distillation: Towards Omni-Supervised Learning, DensePose: Dense Human Pose Estimation In The Wild, and Group Normalization.         Detectron是Facebook人工智能研究的软件系统,它实现了最先进的目标检测算法,包括Mask R-CNN。它是用Python编写的,由Caffe2深度学习框架提供支持。          在Facebook人工智能研究中,Detectron已经启动了许多研究项目,包括:用于物体检测的特征金字塔网络、掩模R-CNN、检测和识别人类与物体的相互作用、用于密集物体检测的焦距损失、非局部神经网络、学习分割每件事物、数据蒸馏:朝向全监督学习,DensePose:在野外进行密集的人体姿势估计,并进行组规范化。         Detectron2 is Facebook AI Research's next generation software system that implements state-of-the-art object detection algorithms. It is a ground-up rewrite of the previous version, Detectron, and it originates from maskrcnn-benchmark.Detectron2是Facebook人工智能研究的下一代软件系统,实现了最先进的目标检测算法。它是对先前版本Detectron的一次彻底重写,它源于maskrcnn基准测试。

GitHub: Detectron,https://github.com/facebookresearch/Detectron/ Detectron2,https://github.com/facebookresearch/detectron2

       Detectron的目的是为目标检测研究提供高质量、高性能的codebase。它的设计是灵活的,以支持快速实施和评估的新研究。Detectron包括以下对象检测算法的实现:

  • Mask R-CNN -- Marr Prize at ICCV 2017
  • RetinaNet -- Best Student Paper Award at ICCV 2017
  • Faster R-CNN
  • RPN
  • Fast R-CNN
  • R-FCN

       采用下列主干网络架构:

  • ResNeXt{50,101,152}
  • ResNet{50,101,152}
  • Feature Pyramid Networks (with ResNet/ResNeXt)
  • VGG16

       附加的主干架构可能很容易实现。有关这些模型的详细信息,请参阅下面的参考资料。

 

1、Detectron2—What's New
  • It is powered by the PyTorch deep learning framework.
  • Includes more features such as panoptic segmentation, densepose, Cascade R-CNN, rotated bounding boxes, etc.
  • Can be used as a library to support different projects on top of it. We'll open source more research projects in this way.
  • It trains much faster.

 

 

detectron2的安装 1、Requirements
  • Linux or macOS
  • Python ≥ 3.6
  • PyTorch ≥ 1.3
  • torchvision that matches the PyTorch installation. You can install them together at pytorch.org to make sure of this.
  • OpenCV, needed by demo and visualization
  • pycocotools: pip install cython; pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
  • GCC ≥ 4.9
2、Build and Install Detectron2 1、官方安装
git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
pip install -e .
# (add --user if you don't have permission)

# or if you are on macOS
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ pip install -e .
2、Windows下安装
git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
python setup.py build develop

相关文章:CV之detectron2:detectron2安装过程记录

 

 

3、Detectron2 Model Zoo and Baselines COCO Object Detection Baselines

Faster R-CNN:

Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APmodel iddownloadR50-C41x0.5510.1104.835.7137257644model | metricsR50-DC51x0.3800.0685.037.3137847829model | metricsR50-FPN1x0.2100.0553.037.9137257794model | metricsR50-C43x0.5430.1104.838.4137849393model | metricsR50-DC53x0.3780.0735.039.0137849425model | metricsR50-FPN3x0.2090.0473.040.2137849458model | metricsR101-C43x0.6190.1495.941.1138204752model | metricsR101-DC53x0.4520.0826.140.6138204841model | metricsR101-FPN3x0.2860.0634.142.0137851257model | metricsX101-FPN3x0.6380.1206.743.0139173657model | metrics

RetinaNet:

Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APmodel iddownloadR501x0.2000.0623.936.5137593951model | metricsR503x0.2010.0633.937.9137849486model | metricsR1013x0.2800.0805.139.9138363263model | metrics

RPN & Fast R-CNN:

Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APprop. ARmodel iddownloadRPN R50-C41x0.1300.0511.5 51.6137258005model | metricsRPN R50-FPN1x0.1860.0452.7 58.0137258492model | metricsFast R-CNN R50-FPN1x0.1400.0352.637.8 137635226model | metrics COCO Instance Segmentation Baselines with Mask R-CNN Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APmask APmodel iddownloadR50-C41x0.5840.1175.236.832.2137259246model | metricsR50-DC51x0.4710.0746.538.334.2137260150model | metricsR50-FPN1x0.2610.0533.438.635.2137260431model | metricsR50-C43x0.5750.1185.239.834.4137849525model | metricsR50-DC53x0.4700.0756.540.035.9137849551model | metricsR50-FPN3x0.2610.0553.441.037.2137849600model | metricsR101-C43x0.6520.1556.342.636.7138363239model | metricsR101-DC53x0.5450.1557.641.937.3138363294model | metricsR101-FPN3x0.3400.0704.642.938.6138205316model | metricsX101-FPN3x0.6900.1297.244.339.5139653917model | metrics COCO Person Keypoint Detection Baselines with Keypoint R-CNN Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APkp. APmodel iddownloadR50-FPN1x0.3150.0835.053.664.0137261548model | metricsR50-FPN3x0.3160.0765.055.465.5137849621model | metricsR101-FPN3x0.3900.0906.156.466.1138363331model | metricsX101-FPN3x0.7380.1428.757.366.0139686956model | metrics COCO Panoptic Segmentation Baselines with Panoptic FPN Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APmask APPQmodel iddownloadR50-FPN1x0.3040.0634.837.634.739.4139514544model | metricsR50-FPN3x0.3020.0634.840.036.541.5139514569model | metricsR101-FPN3x0.3920.0786.042.438.543.0139514519model | metrics LVIS Instance Segmentation Baselines with Mask R-CNN

Mask R-CNN baselines on the LVIS dataset, v0.5. These baselines are described in Table 3(c) of the LVIS paper.

NOTE: the 1x schedule here has the same amount of iterations as the COCO 1x baselines. They are roughly 24 epochs of LVISv0.5 data. The final results of these configs have large variance across different runs.

Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APmask APmodel iddownloadR50-FPN1x0.2920.1277.123.624.4144219072model | metricsR101-FPN1x0.3710.1247.825.625.9144219035model | metricsX101-FPN1x0.7120.16610.226.727.1144219108model | metrics Cityscapes & Pascal VOC Baselines

Simple baselines for

  • Mask R-CNN on Cityscapes instance segmentation (initialized from COCO pre-training, then trained on Cityscapes fine annotations only)
  • Faster R-CNN on PASCAL VOC object detection (trained on VOC 2007 train+val + VOC 2012 train+val, tested on VOC 2007 using 11-point interpolated AP)
Nametrain time (s/iter)inference time (s/im)train mem (GB)box APbox AP50mask APmodel iddownloadR50-FPN, Cityscapes0.2400.0924.4  36.5142423278model | metricsR50-C4, VOC0.5370.0864.851.980.3 142202221model | metrics Other Settings

Ablations for Deformable Conv and Cascade R-CNN:

Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APmask APmodel iddownloadBaseline R50-FPN1x0.2610.0533.438.635.2137260431model | metricsDeformable Conv1x0.3420.0613.541.537.5138602867model | metricsCascade R-CNN1x0.3170.0664.042.136.4138602847model | metricsBaseline R50-FPN3x0.2610.0553.441.037.2137849600model | metricsDeformable Conv3x0.3490.0663.542.738.5144998336model | metricsCascade R-CNN3x0.3280.0754.044.338.5144998488model | metrics

Ablations for normalization methods: (Note: The baseline uses 2fc head while the others use 4conv1fc head. According to the GroupNorm paper, the change in head does not improve the baseline by much)

Namelr schedtrain time (s/iter)inference time (s/im)train mem (GB)box APmask APmodel iddownloadBaseline R50-FPN3x0.2610.0553.441.037.2137849600model | metricsSyncBN3x0.4640.0635.642.037.8143915318model | metricsGN3x0.3560.0777.342.638.6138602888model | metricsGN (scratch)3x0.4000.0779.839.936.6138602908model | metrics

A few very large models trained for a long time, for demo purposes:

Nameinference time (s/im)train mem (GB)box APmask APPQmodel iddownloadPanoptic FPN R1010.12311.447.441.346.1139797668model | metricsMask R-CNN X1520.28115.150.244.0 18131413model | metricsabove + test-time aug.  51.945.9  

 

 

detectron2的使用方法 1、demo测试

python demo/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

 

 

 

 

 

 

关注
打赏
1664196048
查看更多评论
立即登录/注册

微信扫码登录

0.0527s