DAOD

July 5, 2022 · View on GitHub

In this part, we give the tutorial about domain adaptive object detection (DAOD).

Dataset

TasksC2FC2BK2CS2C
Source(Labeled)CityscapesCityscapesKITTISim10k
Target(Unlabeled)Foggy-CityscapesBDD100k-DaytimeCityscapesCityscapes

Usage

Training

1. Use labeled data to train a baseline (aka "source only" model)

Before training,please download the pretrained backbone (vgg) to pretrained_model/backbone.

# |---------------------|--------|---------|
# | xonsh train_gpu2.sh | config | dataset |
# |---------------------|--------|---------|
# there are three dataset for DAOD baseline: C2F, K2C, S2C
# Note that C2B share the same "source only" model with C2F
cd examples/train/xonsh
xonsh train_gpu2.sh ./configs/baseline/baseline_uda.py C2F
  • In our implementation, we use 2-gpus to train.

  • You can also run bash train_baseline_uda.sh in examples/train/bash

  • After training, we organize the pretrained baseline to pretrained_model/baseline as follows:

    pretrained_model/
    	└── baseline/
            ├── C2F.pth
            ├── K2C.pth
            └── S2C.pth
    

2. Use labeled data + unlabeled data to train detector

## there are four adaptation tasks: C2F, C2B, K2C, S2C
## C2F and C2B share the same "source only" model
cd examples/train/xonsh
xonsh train_gpu8.sh ./configs/labelmatch/labelmatch_uda.py C2F
  • In our implementation, we use 8-gpus to train.
  • You can also run bash train_uda.sh in examples/train/bash

Evaluation

# change "data_name" and "checkpoint" in scripts to support different dataset and trained model
cd examples/eval
xonsh eval_uda.sh

Performance

  • \dagger is an ideal setting, using the label distribution from unlabeled data annotations.
  • mAP: AP50

Normal-to-foggy weather adaptation

C2FmAPtruckcarriderpersontrainmotorbicyclebus
source only30.919.247.940.834.87.824.236.036.4
LabelMatch52.442.062.255.445.355.143.551.564.1

Small-to-large scale dataset adaptation

C2BmAPtruckcarriderpersontrainmotorbicyclebus
source only28.718.350.033.335.8/18.427.617.0
LabelMatch38.839.454.637.442.9/25.729.841.7
LabelMatch^\dagger44.539.855.444.544.8/38.641.547.1

Cross-Camera adaptation & Synthetic-to-Real adaptation

K2CAPS2CAP
source only42.2source only36.5
LabelMatch51.0LabelMatch52.7
LabelMatch^{\dagger}52.2LabelMatch^{\dagger}53.8