日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發(fā)布時(shí)間:2025/3/21 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CV之detectron2:detectron2的简介、安装、使用方法之详细攻略 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

CV之detectron2:detectron2的簡(jiǎn)介、安裝、使用方法之詳細(xì)攻略

?

?

目錄

detectron2的簡(jiǎn)介

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的簡(jiǎn)介

? ? ? ? ?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人工智能研究的軟件系統(tǒng),它實(shí)現(xiàn)了最先進(jìn)的目標(biāo)檢測(cè)算法,包括Mask R-CNN。它是用Python編寫的,由Caffe2深度學(xué)習(xí)框架提供支持。
? ? ? ? ?在Facebook人工智能研究中,Detectron已經(jīng)啟動(dòng)了許多研究項(xiàng)目,包括:用于物體檢測(cè)的特征金字塔網(wǎng)絡(luò)、掩模R-CNN、檢測(cè)和識(shí)別人類與物體的相互作用、用于密集物體檢測(cè)的焦距損失、非局部神經(jīng)網(wǎng)絡(luò)、學(xué)習(xí)分割每件事物、數(shù)據(jù)蒸餾:朝向全監(jiān)督學(xué)習(xí),DensePose:在野外進(jìn)行密集的人體姿勢(shì)估計(jì),并進(jìn)行組規(guī)范化。
? ? ? ? ?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人工智能研究的下一代軟件系統(tǒng),實(shí)現(xiàn)了最先進(jìn)的目標(biāo)檢測(cè)算法。它是對(duì)先前版本Detectron的一次徹底重寫,它源于maskrcnn基準(zhǔn)測(cè)試。

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

? ? ? ?Detectron的目的是為目標(biāo)檢測(cè)研究提供高質(zhì)量、高性能的codebase。它的設(shè)計(jì)是靈活的,以支持快速實(shí)施和評(píng)估的新研究。Detectron包括以下對(duì)象檢測(cè)算法的實(shí)現(xiàn):

  • 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

? ? ? ?采用下列主干網(wǎng)絡(luò)架構(gòu):

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

? ? ? ?附加的主干架構(gòu)可能很容易實(shí)現(xiàn)。有關(guān)這些模型的詳細(xì)信息,請(qǐng)參閱下面的參考資料。

?

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

相關(guān)文章: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 iddownload
R50-C41x0.5510.1104.835.7137257644model?|?metrics
R50-DC51x0.3800.0685.037.3137847829model?|?metrics
R50-FPN1x0.2100.0553.037.9137257794model?|?metrics
R50-C43x0.5430.1104.838.4137849393model?|?metrics
R50-DC53x0.3780.0735.039.0137849425model?|?metrics
R50-FPN3x0.2090.0473.040.2137849458model?|?metrics
R101-C43x0.6190.1495.941.1138204752model?|?metrics
R101-DC53x0.4520.0826.140.6138204841model?|?metrics
R101-FPN3x0.2860.0634.142.0137851257model?|?metrics
X101-FPN3x0.6380.1206.743.0139173657model?|?metrics

RetinaNet:

Namelr
schedtrain
time
(s/iter)inference
time
(s/im)train
mem
(GB)box
APmodel iddownload
R501x0.2000.0623.936.5137593951model?|?metrics
R503x0.2010.0633.937.9137849486model?|?metrics
R1013x0.2800.0805.139.9138363263model?|?metrics

RPN & Fast R-CNN:

Namelr
schedtrain
time
(s/iter)inference
time
(s/im)train
mem
(GB)box
APprop.
ARmodel iddownload
RPN R50-C41x0.1300.0511.5?51.6137258005model?|?metrics
RPN R50-FPN1x0.1860.0452.7?58.0137258492model?|?metrics
Fast 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 iddownload
R50-C41x0.5840.1175.236.832.2137259246model?|?metrics
R50-DC51x0.4710.0746.538.334.2137260150model?|?metrics
R50-FPN1x0.2610.0533.438.635.2137260431model?|?metrics
R50-C43x0.5750.1185.239.834.4137849525model?|?metrics
R50-DC53x0.4700.0756.540.035.9137849551model?|?metrics
R50-FPN3x0.2610.0553.441.037.2137849600model?|?metrics
R101-C43x0.6520.1556.342.636.7138363239model?|?metrics
R101-DC53x0.5450.1557.641.937.3138363294model?|?metrics
R101-FPN3x0.3400.0704.642.938.6138205316model?|?metrics
X101-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 iddownload
R50-FPN1x0.3150.0835.053.664.0137261548model?|?metrics
R50-FPN3x0.3160.0765.055.465.5137849621model?|?metrics
R101-FPN3x0.3900.0906.156.466.1138363331model?|?metrics
X101-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 iddownload
R50-FPN1x0.3040.0634.837.634.739.4139514544model?|?metrics
R50-FPN3x0.3020.0634.840.036.541.5139514569model?|?metrics
R101-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 iddownload
R50-FPN1x0.2920.1277.123.624.4144219072model?|?metrics
R101-FPN1x0.3710.1247.825.625.9144219035model?|?metrics
X101-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 iddownload
R50-FPN, Cityscapes0.2400.0924.4??36.5142423278model?|?metrics
R50-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 iddownload
Baseline R50-FPN1x0.2610.0533.438.635.2137260431model?|?metrics
Deformable Conv1x0.3420.0613.541.537.5138602867model?|?metrics
Cascade R-CNN1x0.3170.0664.042.136.4138602847model?|?metrics
Baseline R50-FPN3x0.2610.0553.441.037.2137849600model?|?metrics
Deformable Conv3x0.3490.0663.542.738.5144998336model?|?metrics
Cascade 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 iddownload
Baseline R50-FPN3x0.2610.0553.441.037.2137849600model?|?metrics
SyncBN3x0.4640.0635.642.037.8143915318model?|?metrics
GN3x0.3560.0777.342.638.6138602888model?|?metrics
GN (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 iddownload
Panoptic FPN R1010.12311.447.441.346.1139797668model?|?metrics
Mask R-CNN X1520.28115.150.244.0?18131413model?|?metrics
above + test-time aug.??51.945.9??

?

?

detectron2的使用方法

1、demo測(cè)試

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

?

?

?

?

?

?

總結(jié)

以上是生活随笔為你收集整理的CV之detectron2:detectron2的简介、安装、使用方法之详细攻略的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。