Home

Awesome

Plain-Det

The official PyTorch implementation of the "Plain-Det: A Plain Multi-Dataset Object Detector".

LicensePaper Plain_det

By Cheng Shi*, Yuchen Zhu* and Sibei Yang†

*Equal contribution; †Corresponding Author

Highlights

To-do:

Main results

Table 1

METHODCOCOLVISO365OIDmAPPaper PositionCFGCKPT
L37.233.313.435.329.8Tab1 line3cfgckpt
CL46.033.214.235.732.3Tab1 line4cfgckpt
CLO51.839.933.241.741.7Tab1 line5cfgckpt
CLOD51.940.933.363.447.4Tab1 line6cfgckpt

Note:

Installation

Conda

# create conda environment
conda create -n plaindet python=3.10.11 -y
conda activate plaindet

# install pytorch (other versions may also work)
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1

# other requirements
git clone https://github.com/ChengShiest/Plain-Det.git
cd Plain-Det

# install packages
pip install -r requirements.txt

# setup detectron2
python -m pip install -e detectron2

# setup detrex
python setup.py build develop

Prepare datasets for Plain-Det

You can follow detectron2 or detic to download and prepare the dataset.

We place the datasets in the following directory structure:

# Plain-Det datasets structure
├── datasets/
│   ├── coco/
│       ├── annotations/
│       ├── train2017/
│       ├── val2017/
│   ├── lvis
│       ├── lvis_v1_train.json
│       ├── lvis_v1_val.json
│   ├── objects365v2
│       ├── annotations/
│           ├── modified_zhiyuan_objv2_train.json 
│           ├── modified_zhiyuan_objv2_val.json 
│       ├── images/
│           ├── train/
│               ├── patch0/
│               ├── ...
│               ├── patch50/
│           ├── val/
│               ├── patch0/
│               ├── ...
│               ├── patch43/
│   ├── oid
│       ├── annotations/
│           ├── bbox_labels_600_hierarchy-list.json      
│           ├── openimages_v4_train_bbox.json              
│           ├── openimages_v4_val_bbox.json              
│       ├── images/
│           ├── train_0/
│           ├── ...
│           ├── train_f/
│           ├── validation/
│              

Usage

Training

Attention! In our experiments, we use 8/16 A100 GPUs for training. You should modify the num_gpus in the config file to match your own setting. Other numbers may also work, but we haven't tested them. When reading the dataset, due to the large size of the annotation file, memory explosion issues often occur. We have resolved this issue by storing the annotations for each image as a txt file and dynamically loading them. You can process the data yourself or contact us(you can find our code about this in dataset register and mapper).


# You should change the dataset config in \
# ./projects/deformable_detr/configs/deformable_detr_r50_two_stage_800k_clod.py \

# Training
bash scripts/run_CLOD.sh

Evaluation


# You should change the dataset config in \
# ./projects/deformable_detr/configs/deformable_detr_r50_two_stage_800k_clod.py \
# to evaluate different datasets.

# run evaluation
bash scripts/eval.sh

Citing Plain-Det

If you find Plain-Det useful in your research, please consider citing:

inproceedings{
  shi2024plain,
  title={Plain-Det: A Plain Multi-Dataset Object Detector},
}

Acknowledgement

This code is based on detrex and detectron2. Some code are brought from Detic and UniDet. Thanks for their awesome works.