Deformable 可变形的DETR
This repository is an official implementation of the paper Deformable DETR: Deformable Transformers for End-to-End Object Detection.
该存储库是论文《可变形DETR:用于端到端对象检测的可变形变压器》的正式实现。
https://github.com/fundamentalvision/deformable-detr
Introduction
Deformable DETR is an efficient and fast-converging end-to-end object detector. It mitigates the high complexity and slow convergence issues of DETR via a novel sampling-based efficient attention mechanism.
可变形DETR是一种高效且快速收敛的端到端对象检测器。通过一种新颖的基于采样的有效注意力机制,缓解了DETR的高复杂性和缓慢收敛的问题。
Abstract摘要
DETR has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance. However, it suffers from slow convergence and limited feature spatial resolution, due to the limitation of Transformer attention modules in processing image feature maps. To mitigate these issues, we proposed Deformable DETR, whose attention modules only attend to a small set of key sampling points around a reference. Deformable DETR can achieve better performance than DETR (especially on small objects) with 10× less training epochs. Extensive experiments on the COCO benchmark demonstrate the effectiveness of our approach.
最近提出了DETR,以消除目标检测中对许多手工设计组件的需求,同时表现出良好的性能。但是,由于Transformer注意模块在处理图像特征图时的局限性,它收敛缓慢且特征空间分辨率有限。为了缓解这些问题,提出了可变形DETR,其关注模块仅关注参考周围的一小部分关键采样点。可变形的DETR可以比DETR(尤其是在小物体上)获得更好的性能,训练时间减少10倍。在COCO Benchmark数据集上进行的大量实验证明了方法的有效性。
License
This project is released under the Apache 2.0 license.
项目是根据Apache 2.0许可发布的。
Changelog
See changelog.md for detailed logs of major changes.
有关主要更改的详细日志,请参见changelog.md。
Citing 引用可变形Deformable DETR
If you find Deformable DETR useful in your research, please consider citing:
如果发现Deformable可变形DETR在研究中很有用,考虑引用以下内容:
@article{zhu2020deformable,
title={Deformable DETR: Deformable Transformers for End-to-End Object Detection},
author={Zhu, Xizhou and Su, Weijie and Lu, Lewei and Li, Bin and Wang, Xiaogang and Dai, Jifeng},
journal={arXiv preprint arXiv:2010.04159},
year={2020}
}
Main Results

Note:

  1. All models of Deformable DETR are trained with total batch size of 32.
  2. Training and inference speed are measured on NVIDIA Tesla V100 GPU.
  3. “Deformable DETR (single scale)” means only using res5 feature map (of stride 32) as input feature maps for Deformable Transformer Encoder.
  4. “DC5” means removing the stride in C5 stage of ResNet and add a dilation of 2 instead.
  5. “DETR-DC5+” indicates DETR-DC5 with some modifications, including using Focal Loss for bounding box classification and increasing number of object queries to 300.
  6. “Batch Infer Speed” refer to inference with batch size = 4 to maximize GPU utilization.
  7. The original implementation is based on our internal codebase. There are slight differences in the final accuracy and running time due to the plenty details in platform switch.
    笔记:
  8. 所有可变形DETR的模型都经过训练,总批次大小为32。
  9. 训练和推理速度是在NVIDIA Tesla V100 GPU上测量的。
  10. “可变形DETR(单比例)”表示仅将(步幅32的)res5特征图用作可变形变压器编码器的输入特征图。
  11. “ DC5”表示消除ResNet的C5阶段的步幅,而改为增加2。
  12. “ DETR-DC5 +”表示对DETR-DC5进行了一些修改,包括使用Focal Loss进行边界框分类以及将目标查询数增加到300。
  13. “批处理推断速度”指的是批处理大小= 4以最大程度地利用GPU的推理。
  14. 原始实现基于内部代码库。由于平台切换器中的大量细节,最终精度和运行时间略有不同。
    Installation
    Requirements
    • Linux, CUDA>=9.2, GCC>=5.4
    • Python>=3.7
    We recommend you to use Anaconda to create a conda environment: 建议使用Anaconda创建一个conda环境:
    conda create -n deformable_detr python=3.7 pip
    Then, activate the environment:
    conda activate deformable_detr
    • PyTorch>=1.5.1, torchvision>=0.6.1
    For example, if your CUDA version is 9.2, you could install pytorch and torchvision as following: 如果CUDA版本是9.2,则可以按以下方式安装pytorch和torchvision:
    conda install pytorch=1.5.1 torchvision=0.6.1 cudatoolkit=9.2 -c pytorch
    • Other requirements
    pip install -r requirements.txt
    Compiling CUDA operators
    cd ./models/ops
    sh ./make.sh

unit test (should see all checking is True)

python test.py
Usage
Dataset preparation
Please download COCO 2017 dataset and organize them as following: 请下载COCO 2017数据集并按以下方式组织它们:
code_root/
└── data/
└── coco/
├── train2017/
├── val2017/
└── annotations/
├── instances_train2017.json
└── instances_val2017.json
Training
Training on single node
For example, the command for training Deformable DETR on 8 GPUs is as following: 例如,用于在8个GPU上训练可变形DETR的命令如下:
GPUS_PER_NODE=8 ./tools/run_dist_launch.sh 8 ./configs/r50_deformable_detr.sh
Training on multiple nodes
For example, the command for training Deformable DETR on 2 nodes of each with 8 GPUs is as following: 例如,用于在每个具有8个GPU的2个节点上训练Deformable DETR的命令如下:
On node 1:
MASTER_ADDR=<IP address of node 1> NODE_RANK=0 GPUS_PER_NODE=8 ./tools/run_dist_launch.sh 16 ./configs/r50_deformable_detr.sh
On node 2:
MASTER_ADDR=<IP address of node 1> NODE_RANK=1 GPUS_PER_NODE=8 ./tools/run_dist_launch.sh 16 ./configs/r50_deformable_detr.sh
Training on slurm cluster
If you are using slurm cluster, you can simply run the following command to train on 1 node with 8 GPUs: 如果使用的是Slurm集群,只需运行以下命令即可在具有8个GPU的1个节点上进行训练:
GPUS_PER_NODE=8 ./tools/run_dist_slurm.sh deformable_detr 8 configs/r50_deformable_detr.sh
Or 2 nodes of each with 8 GPUs:
GPUS_PER_NODE=8 ./tools/run_dist_slurm.sh deformable_detr 16 configs/r50_deformable_detr.sh
Some tips to speed-up training
• If your file system is slow to read images, you may consider enabling ‘–cache_mode’ option to load whole dataset into memory at the beginning of training.
• You may increase the batch size to maximize the GPU utilization, according to GPU memory of yours, e.g., set ‘–batch_size 3’ or ‘–batch_size 4’.
• 如果文件系统读取图像的速度较慢,则可以考虑在训练开始时启用’–cache_mode’选项以将整个数据集加载到内存中。
• 可以根据自己的GPU内存来增加批处理大小以最大程度地利用GPU,例如,设置’–batch_size 3’或’–batch_size 4’。
Evaluation
You can get the config file and pretrained model of Deformable DETR (the link is in “Main Results” session), then run following command to evaluate it on COCO 2017 validation set:
可以获取可变形DETR的配置文件和预训练模型(链接在“主要结果”会话中),然后运行以下命令在COCO 2017验证集中对其进行评估:
--resume --eval
You can also run distributed evaluation by using ./tools/run_dist_launch.sh or ./tools/run_dist_slurm.sh.

Deformable 可变形的DETR相关推荐

  1. 论文阅读:DEFORMABLE DETR:DEFORMABLE DETR: DEFORMABLE TRANSFORMERSFOR END-TO-END OBJECT DETECTION

    题目:DEFORMABLE DETR:DEFORMABLE DETR: DEFORMABLE TRANSFORMERSFOR END-TO-END OBJECT DETECTION 来源:ICLA 是 ...

  2. Deformable DETR论文翻译

    Deformable DETR论文翻译 摘要 1.介绍 2.相关工作 3. 回顾transformer和DETR 4.方法 4.1 端到端目标检测中的可形变transformer 4.2 DEFORM ...

  3. Deformable DETR要点解读

    最近整理Transformer和set prediction相关的检测&实例分割文章,感兴趣的可以跟一下: DETR: End-to-End Object Detection with Tra ...

  4. DEFORMABLE DETR学习笔记

    DEFORMABLE DETR学习笔记 DEFORMABLE DETR: DEFORMABLE TRANSFORMERS FOR END-TO-END OBJECT DETECTION ABSTRAC ...

  5. DEFORMABLE DETR详解

    1.解决问题 DETR需要比现有的目标检测器更长的训练时间来收敛. DETR在检测小物体方面的性能相对较低,并且无法从高分辨率特征地图中检测到小物体. 可变形卷积可以识别重要特征,但是无法学习重要特征 ...

  6. DN-DETR: Accelerate DETR Training by Introducing Query DeNoising

    文章目录 DN-DETR: Accelerate DETR Training by Introducing Query DeNoising Abstract 1.Introduction 2. Rel ...

  7. Dynamic Head: Unifying Object Detection Heads with Attentions 阅读

    Abstract 这里就是说在目标检测领域,很多工作都想提高检测头的性能,这篇文章提出了动态头,也就是Dynamic Head,来将检测头和注意力(Attention)结合.在尺度(scale-awa ...

  8. 常用的表格检测识别方法-表格区域检测方法(上)

    常用的表格检测识别方法 表格检测识别一般分为三个子任务:表格区域检测.表格结构识别和表格内容识别.本章将围绕这三个表格识别子任务,从传统方法.深度学习方法等方面,综述该领域国内国外的发展历史和最新进展 ...

  9. 论文阅读:BEVSegFormer: Bird’s Eye View Semantic Segmentation FromArbitrary Camera Rigs

    题目:BEVSegFormer: Bird's Eye View Semantic Segmentation FromArbitrary Camera Rigs 中文:BEVSegFormer基于任意 ...

最新文章

  1. 【php】 PHP 支持 9 种原始数据类型
  2. 2016 实习招聘面试经历 - 3
  3. 实践,用tornado实现自定义协议server
  4. JDK/Java 14 正式发布!然而我还在用 Java 8...
  5. 笔记-信息化与系统集成技术-人工智能基础知识
  6. 解决设备行业尾款回收问题-深思精锐5时钟锁
  7. Java自动化测试框架-11 - TestNG之annotation与并发测试篇 (详细教程)
  8. 关于使用MYSQL出现的内存泄漏问题
  9. 顺势而为,戴尔加速流动文件系统进化
  10. 合并照片到word中
  11. android_x86安装arm转译
  12. jquery $.fn 是什么意思
  13. 如何招聘软件测试,ÈçºÎÕÐƸµ½µÄÈí¼þ²âÊÔ¹¤³Ìʦ£¿
  14. UTC时间 GMT时间 本地时间 北京时间 时区 夏令时简要说明
  15. 正大国际期货:做期货交易,怎么样才能成功?
  16. 【c语言】 有一函数: 写程序,输入x的值,输出y相应的值。用scanf函数输入x的值,求y值
  17. 机器学习:单词拼写纠正器python实现
  18. (五)Android资源访问
  19. 百度AI攻略:行驶证识别
  20. 小龙虾炒菜机器人_5分钟一盘小龙虾,8分钟一份红烧肉,幕后高手原来是“她”…...

热门文章

  1. 使用Maven打包生成的-SNAPSHOT.jar与-RELEASE.jar分别代表什么?SNAPSHOT是什么意思?RELEASE是什么意思?
  2. 2022-2028年中国离心机行业市场研究及前瞻分析报告
  3. 2022-2028年中国物联网金融产业深度调研及投资前景预测报告
  4. java action dao_java中Action层、Service层和Dao层的功能区分
  5. 奇异值分解与最小二乘问题 线性回归
  6. LeetCode简单题之最长回文串
  7. AIFramework框架Jittor特性(下)
  8. 3层-CNN卷积神经网络预测MNIST数字
  9. MindSpore接口mindspore::api
  10. 中文版证书_CIA考试多久后才可以领取证书?领取的方式是什么?