This is a Caffe2 implementation of 'Domain Adaptive Faster R-CNN for Object Detection in the Wild', implemented by Haoran Wang(haowang@student.ethz.ch). The original paper can be found here. This implementation is built on Detectron @ 5ed75f9.
If you find this repository useful, please cite the oringinal paper:
@inproceedings{chen2018domain,
title={Domain Adaptive Faster R-CNN for Object Detection in the Wild},
author = {Chen, Yuhua and Li, Wen and Sakaridis, Christos and Dai, Dengxin and Van Gool, Luc},
booktitle = {Computer Vision and Pattern Recognition (CVPR)},
year = {2018}
}
and Detectron:
@misc{Detectron2018,
author = {Ross Girshick and Ilija Radosavovic and Georgia Gkioxari and
Piotr Doll\'{a}r and Kaiming He},
title = {Detectron},
howpublished = {\url{https://github.com/facebookresearch/detectron}},
year = {2018}
}
Please follow the instruction in Detectron to install and use Detectron-DomainAdaptive-Faster-RCNN.
An example of adapting from Sim10k dataset to Cityscapes dataset is provided:
-
Download the Cityscapes datasets from here and Sim10k datasets from here.
-
Convert the labels of Cityscapes datasets and labels of Sim10k datasets to coco format using the scripts 'tools/convert_cityscapes_to_caronly_coco.py' and 'tools/convert_sim10k_to_coco.py'.
-
Convert ImageNet-pretrained VGG16 Caffe model to Detectron format with 'tools/pickle_caffe_blobs.py' or use my converted VGG16 model in here
-
Train the Domain Adaptive Faster R-CNN:
cd $DETECTRON python2 tools/train_net.py --cfg configs/da_faster_rcnn_baselines/e2e_da_faster_rcnn_vgg16-sim10k.yaml
-
Test the trained model:
cd $DETECTRON python2 tools/test_net.py --cfg configs/da_faster_rcnn_baselines/e2e_da_faster_rcnn_vgg16-sim10k.yaml TEST.WEIGHTS /<path_to_trained_model>/model_final.pkl NUM_GPUS 1
Pretrained model with image+instance+consistency domain adaptation for Sim10k->Cityscapes task.
image | instsnace | consistency | car AP | |
---|---|---|---|---|
Faster R-CNN | 32.58 | |||
DA Faster R-CNN | 36.13 | |||
DA Faster R-CNN | 36.73 | |||
DA Faster R-CNN | 37.39 | |||
DA Faster R-CNN | 38.28 |
da-faster-rcnn based on Caffe. (original code by paper authors)