[Paper] [Project Page]
This repository contains the PyTorch implementation for the CVPR 2023 Paper "Continual Detection Transformer for Incremental Object Detection" by Yaoyao Liu, Bernt Schiele, Andrea Vedaldi, and Christian Rupprecht.
This is the preliminary code. If you have any questions on this repository or the related paper, feel free to create an issue or send me an email.
This code is based on Deformable DETR. You may follow the instructions in https://github.com/fundamentalvision/Deformable-DETR to install packages and prepare datasets for this project.
-
Linux, CUDA>=9.2, GCC>=5.4
-
Python>=3.7
We recommend you to use Anaconda to create a conda environment:
conda create -n cl_detr python=3.7 pip
Then, activate the environment:
conda activate cl_detr
-
PyTorch>=1.5.1, torchvision>=0.6.1 (following instructions here)
For example, if your CUDA version is 9.2, you could install pytorch and torchvision as following:
conda install pytorch=1.5.1 torchvision=0.6.1 cudatoolkit=9.2 -c pytorch
-
Other requirements
pip install -r requirements.txt
cd ./models/ops
sh ./make.sh
# unit test (should see all checking is True)
python test.py
Please download COCO 2017 dataset and organize them as following:
code_root/
└── data/
└── coco/
├── train2017/
├── val2017/
└── annotations/
├── instances_train2017.json
└── instances_val2017.json
Incremental object detection results (%) on COCO 2017. In the A+B setup, in the first phase, we observe a fraction
Setting | Detection Baseline | ||||||
---|---|---|---|---|---|---|---|
70+10 | Deformable DETR | 40.1 | 57.8 | 43.7 | 23.2 | 43.2 | 52.1 |
40+40 | Deformable DETR | 37.5 | 55.1 | 40.3 | 20.9 | 40.8 | 50.7 |
You may download the checkpoints here: [link]. The experiment setting is COCO 2017, 70+10. Please put the phase-0 checkpoint, phase_0.pth
, in the base directory before running the code. The current version will automatically load the phase-0 checkpoint to speed up the experiments. This is because phase 0 is not an incremental learning phase. It is the same as the standard Deformable DETR.
Run the following script to start the experiment for COCO 2017, 70+10:
bash run.sh
If you need to run experiments for the 40+40 setting, you may need to change the code in multiple files, e.g., main.py
and datasets/pycocotools.py
. Please refer to this branch for the 40+40 experiments: https://github.com/yaoyao-liu/CL-DETR/tree/40_40
Please cite our paper if it is helpful to your work:
@inproceedings{Liu2023CLDETR,
author = {Yaoyao Liu and
Bernt Schiele and
Andrea Vedaldi and
Christian Rupprecht},
title = {Continual Detection Transformer for Incremental Object Detection},
booktitle = {{IEEE/CVF} Conference on Computer Vision and Pattern Recognition,
{CVPR} 2023, Vancouver, BC, Canada, June 17-24, 2023},
pages = {23799--23808},
publisher = {{IEEE}},
year = {2023}
}
Our implementation uses the source code from the following repository: