MCPcopy Index your code
hub / github.com/IDEA-Research/DINO

github.com/IDEA-Research/DINO @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
606 symbols 1,604 edges 59 files 133 documented · 22% updated 1y ago★ 2,822150 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DINO

PWC PWC

This is the official implementation of the paper "DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection". (DINO pronounced `daɪnoʊ' as in dinosaur)

Authors: Hao Zhang*, Feng Li*, Shilong Liu*, Lei Zhang, Hang Su, Jun Zhu, Lionel M. Ni, Heung-Yeung Shum

News

[2023/7/10] We release Semantic-SAM, a universal image segmentation model to enable segment and recognize anything at any desired granularity. Code and checkpoint are available!

[2023/4/28]: We release a strong open-set object detection and segmentation model OpenSeeD that achieves the best results on open-set object segmentation tasks. Code and checkpoints are available here.

[2023/4/26]: DINO is shining again! We release Stable-DINO which is built upon DINO and FocalNet-Huge backbone that achieves 64.8 AP on COCO test-dev.

[2023/4/22]: With better hyper-params, our DINO-4scale model achieves 49.8 AP under 12ep settings, please check detrex: DINO for more details.

[2023/3/13]: We release a strong open-set object detection model Grounding DINO that achieves the best results on open-set object detection tasks. It achieves 52.5 zero-shot AP on COCO detection, without any COCO training data! It achieves 63.0 AP on COCO after fine-tuning. Code and checkpoints will be available here.

[2023/1/23]: DINO has been accepted to ICLR 2023!

[2022/12/02]: Code for Mask DINO is released (also in detrex)! Mask DINO further Achieves 51.7 and 59.0 box AP on COCO with a ResNet-50 and SwinL without extra detection data, outperforming DINO under the same setting!.

[2022/9/22]: We release a toolbox detrex that provides state-of-the-art Transformer-based detection algorithms. It includes DINO with better performance. Welcome to use it!

[2022/9/18]: We organize ECCV Workshop Computer Vision in the Wild (CVinW), where two challenges are hosted to evaluate the zero-shot, few-shot and full-shot performance of pre-trained vision models in downstream tasks:

    [Workshop]         [IC Challenge]         [OD Challenge]

[2022/8/6]: We update Swin-L model results without techniques such as O365 pre-training, large image size, and multi-scale test. We also upload the corresponding checkpoints to Google Drive. Our 5-scale model without any tricks obtains 58.5 AP on COCO val.

[2022/7/14]: We release the code with Swin-L and Convnext backbone.

[2022/7/10]: We release the code and checkpoints with Resnet-50 backbone.

[2022/6/7]: We release a unified detection and segmentation model Mask DINO that achieves the best results on all the three segmentation tasks (54.7 AP on COCO instance leaderboard, 59.5 PQ on COCO panoptic leaderboard, and 60.8 mIoU on ADE20K semantic leaderboard)! Code will be available here.

[2022/5/28] Code for DN-DETR is available here.

[2020/4/10]: Code for DAB-DETR is avaliable here.

[2022/3/8]: We reach the SOTA on MS-COCO leader board with 63.3AP!

[2022/3/9]: We build a repo Awesome Detection Transformer to present papers about transformer for detection and segmenttion. Welcome to your attention!

SOTA results

Introduction

We present DINO (DETR with Improved deNoising anchOr boxes) with:

  1. State-of-the-art & end-to-end: DINO achieves 63.2 AP on COCO Val and 63.3 AP on COCO test-dev with more than ten times smaller model size and data size than previous best models.
  2. Fast-converging: With the ResNet-50 backbone, DINO with 5 scales achieves 49.4 AP in 12 epochs and 51.3 AP in 24 epochs. Our 4-scale model achieves similar performance and runs at 23 FPS.

Methods

method

Model Zoo

We have put our model checkpoints here [model zoo in Google Drive][model zoo in 百度网盘](提取码"DINO"), where checkpoint{x}_{y}scale.pth denotes the checkpoint of y-scale model trained for x epochs. Our training logs are in [Google Drive].

12 epoch setting

name backbone box AP Checkpoint Where in Our Paper
1 DINO-4scale R50 49.0 Google Drive / BaiDu  Table 1
2 DINO-5scale R50 49.4 Google Drive / BaiDu  Table 1
3 DINO-4scale Swin-L 56.8 Google Drive 
4 DINO-5scale Swin-L 57.3 Google Drive 

24 epoch setting

name backbone box AP Checkpoint Where in Our Paper
1 DINO-4scale R50 50.4 Google Drive / BaiDu  Table 2
2 DINO-5scale R50 51.3 Google Drive / BaiDu  Table 2

36 epoch setting

name backbone box AP Checkpoint Where in Our Paper
1 DINO-4scale R50 50.9 Google Drive / BaiDu  Table 2
2 DINO-5scale R50 51.2 Google Drive / BaiDu  Table 2
3 DINO-4scale Swin-L 58.0 Google Drive 
4 DINO-5scale Swin-L 58.5 Google Drive 

Installation

Installation

We use the environment same to DAB-DETR and DN-DETR to run DINO. If you have run DN-DETR or DAB-DETR, you can skip this step. We test our models under python=3.7.3,pytorch=1.9.0,cuda=11.1. Other versions might be available as well. Click the Details below for more details.

  1. Clone this repo sh git clone https://github.com/IDEA-Research/DINO.git cd DINO

  2. Install Pytorch and torchvision

Follow the instruction on https://pytorch.org/get-started/locally/. sh # an example: conda install -c pytorch pytorch torchvision

  1. Install other needed packages sh pip install -r requirements.txt

  2. Compiling CUDA operators sh cd models/dino/ops python setup.py build install # unit test (should see all checking is True) python test.py cd ../../..

Data

Data

Please download COCO 2017 dataset and organize them as following:

COCODIR/
  ├── train2017/
  ├── val2017/
  └── annotations/
    ├── instances_train2017.json
    └── instances_val2017.json

Run

  1. Eval our pretrianed models

Download our DINO model checkpoint "checkpoint0011_4scale.pth" from this link and perform the command below. You can expect to get the final AP about 49.0. sh bash scripts/DINO_eval.sh /path/to/your/COCODIR /path/to/your/checkpoint

  1. Inference and Visualizations

For inference and visualizations, we provide a notebook as an example.

  1. Train a 4-scale model for 12 epochs

We use the DINO 4-scale model trained for 12 epochs as an example to demonstrate how to evaluate and train our model.

You can also train our model on a single process:

bash scripts/DINO_train.sh /path/to/your/COCODIR
  1. Supports for Swin Transformer

To train Swin-L model, you need to first download the checkpoint of Swin-L backbone from [link](https://github.com/SwinTransformer/storag

Core symbols most depended-on inside this repo

Shape

Method 349
Function 152
Class 105

Languages

Python99%
C++1%

Modules by API surface

util/misc.py51 symbols
datasets/coco.py47 symbols
util/utils.py46 symbols
datasets/transforms.py42 symbols
util/slconfig.py33 symbols
models/dino/transformer_deformable.py29 symbols
models/dino/deformable_transformer.py28 symbols
models/dino/swin_transformer.py27 symbols
datasets/sltransform.py26 symbols
tools/benchmark.py25 symbols
util/slio.py23 symbols
models/dino/dino.py21 symbols

For agents

$ claude mcp add DINO \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page