SparseR-CNN - 具有可学习提议的端到端对象检测,CVPR2021

Created at: 2020-11-19 15:37:38
Language: Python
License: MIT

稀疏 R-CNN:具有可学习建议的端到端对象检测

许可证: MIT

论文(CVPR 2021)

稀疏 R-CNN:具有可学习建议的端到端对象检测

更新

  • (02/03/2021) 使用更强的主干模型PVT报告了更高的性能。
  • (23/02/2021) 使用更强的预训练模型DetCo报告了更高的性能。
  • (02/12/2020) 提供模型和日志(R101_100pro_3x 和 R101_300pro_3x)。
  • (26/11/2020) 提供模型和日志(R50_100pro_3x 和 R50_300pro_3x)。
  • (26/11/2020) 通过将丢失率设置为 0.0,报告了 Sparse R-CNN 的更高性能。

楷模

方法 inf_time 火车时间 盒子AP 下载
R50_100pro_3x 23 帧/秒 19h 42.8 模型| 日志
R50_300pro_3x 22 帧/秒 24小时 45.0 模型| 日志
R101_100pro_3x 19 帧/秒 25小时 44.1 模型| 日志
R101_300pro_3x 18 帧/秒 29 小时 46.4 模型| 日志

模型和日志可以通过代码wt9n在百度驱动中获得。

笔记

  • 我们观察到大约 0.3 个 AP 噪声。
  • 训练时间在 8 个 GPU 上,batchsize 为 16。推理时间在单个 GPU 上。所有 GPU 都是 NVIDIA V100。
  • 我们使用使用 torchvision 在 imagenet 上预训练的模型。我们提供了torchvision 的 ResNet-101.pkl模型。可以在转换脚本中找到更多详细信息。
方法 inf_time 火车时间 盒子AP 代码库
R50_300pro_3x 22 帧/秒 24小时 45.0 检测器2
R50_300pro_3x.detco 22 帧/秒 28 小时 46.5 检测器2
PVTSmall_300pro_3x 13 帧/秒 50h 45.7 毫米检测
PVV2-b2_300pro_3x 11 帧每秒 76h 50.1 毫米检测

安装

代码库建立在Detectron2DETR之上。

要求

  • 使用 Python ≥ 3.6 的 Linux 或 macOS
  • PyTorch≥1.5和torchvision的PyTorch安装相匹配。你可以在pytorch.org 上将它们安装在一起以确保这一点
  • OpenCV 是可选的,演示和可视化需要

脚步

  1. 安装和构建库
git clone https://github.com/PeizeSun/SparseR-CNN.git
cd SparseR-CNN
python setup.py build develop
  1. 将 coco 数据集路径链接到 SparseR-CNN/datasets/coco
mkdir -p datasets/coco
ln -s /path_to_coco_dataset/annotations datasets/coco/annotations
ln -s /path_to_coco_dataset/train2017 datasets/coco/train2017
ln -s /path_to_coco_dataset/val2017 datasets/coco/val2017
  1. 训练 SparseR-CNN
python projects/SparseRCNN/train_net.py --num-gpus 8 \
    --config-file projects/SparseRCNN/configs/sparsercnn.res50.100pro.3x.yaml
  1. 评估 SparseR-CNN
python projects/SparseRCNN/train_net.py --num-gpus 8 \
    --config-file projects/SparseRCNN/configs/sparsercnn.res50.100pro.3x.yaml \
    --eval-only MODEL.WEIGHTS path/to/model.pth
  1. 可视化 SparseR-CNN
python demo/demo.py\
    --config-file projects/SparseRCNN/configs/sparsercnn.res50.100pro.3x.yaml \
    --input path/to/images --output path/to/save_images --confidence-threshold 0.4 \
    --opts MODEL.WEIGHTS path/to/model.pth

第三方资源

授权协议

SparseR-CNN 是在 MIT 许可下发布的。

引用

如果你在研究中使用 SparseR-CNN 或希望参考此处发布的基线结果,请使用以下 BibTeX 条目:

@article{peize2020sparse,
  title   =  {{SparseR-CNN}: End-to-End Object Detection with Learnable Proposals},
  author  =  {Peize Sun and Rufeng Zhang and Yi Jiang and Tao Kong and Chenfeng Xu and Wei Zhan and Masayoshi Tomizuka and Lei Li and Zehuan Yuan and Changhu Wang and Ping Luo},
  journal =  {arXiv preprint arXiv:2011.12450},
  year    =  {2020}
}