DPT for Object Detection

August 13, 2021 ยท View on GitHub

Here is our code for ImageNet classification. Please check our paper for detailed information.

Instructions

Preparations

First, install pytorch as for classification.

conda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=10.1 -c pytorch
pip install timm==0.3.2

We develop our method under environment mmcv==1.2.7 and mmdet==2.8.0. We recommand you this document for detailed instructions.

Evaluation

To evaluate RetinaNet on COCO val2017 with 8 gpus run:

./dist_test.sh /path/to/config/file /path/to/checkpoint_file 8 --eval bbox

For example, to evaluate RetinaNet with DPT-Tiny:

./dist_test.sh configs/retinanet_dpt_t_fpn_1x_coco.py pretrained/detection/retinanet_dpt_t_1x.pth 8 --eval bbox

To evaluate Mask R-CNN on COCO val2017 with 8 gpus run:

./dist_test.sh /path/to/config/file /path/to/checkpoint_file 8 --eval bbox segm

For example, to evaluate Mask R-CNN with DPT-Tiny:

./dist_test.sh configs/mask_rcnn_dpt_t_fpn_1x_coco.py pretrained/detection/mrcnn_dpt_t_1x.pth 8 --eval bbox segm

Training

Train with certain config file:

dist_train.sh /path/to/config/file $NUM_GPUS

For example, to train DPT-Small + Mask R-CNN on COCO train2017 for 12 epochs with 8 gpus:

dist_train.sh configs/mask_rcnn_dpt_s_fpn_1x_coco.py 8

Results and Models

RetinaNet Results

Method#Params (M)SchedulemAPAP50AP75APsAPmAPlDownload
DPT-Tiny24.91x39.560.441.823.743.252.2Google Drive
DPT-Tiny24.9MS+3x41.262.044.025.744.653.9Google Drive
DPT-Small36.11x42.563.645.326.245.756.9Google Drive
DPT-Small36.1MS+3x43.364.046.527.846.358.5Google Drive
DPT-Medium55.91x43.364.645.927.246.758.6Google Drive
DPT-Medium55.9MS+3x43.764.646.427.247.058.4Google Drive

Mask R-CNN Results

Method#Params (M)Schedulebox mAPbox AP50box AP75mask mAPmask AP50mask AP75Download
DPT-Tiny34.81x40.262.843.837.759.840.4Google Drive
DPT-Tiny34.8MS+3x42.264.446.139.461.542.3Google Drive
DPT-Small46.11x43.165.747.239.962.943.0Google Drive
DPT-Small46.1MS+3x44.466.548.941.063.644.2Google Drive
DPT-Medium65.81x43.866.248.340.363.143.4Google Drive
DPT-Medium65.8MS+3x44.365.648.840.763.144.1Google Drive

These models can also be obtained from BaiduNetdisk. Password for extraction is DPTs. Our result is pretrained on the ImageNet1k dataset. ImageNet1k-pretrained models can be found here.