This repository is the official PyTorch implementation of paper FLDMN: Feature and Label Distributions Matching Networks for Cross-domain Object Detection. (The work has been submitted to AAAI2021)
- torch == 1.0.0
- torchvision == 0.2.0
- Python 3
This repository is developed using python 3.7.6 on Ubuntu 16.04.5 LTS. The CUDA nad CUDNN version is 9.0 and 7.4.1 respectively. We use one NVIDIA 1080ti GPU card for training and testing. Other platforms or GPU cards are not fully tested.
Please follow faster-rcnn respository to setup the environment.
- Cityscape and FoggyCityscape: Download the Cityscape dataset, see dataset preparation code in DA-Faster RCNN.
- PASCAL_VOC 07+12: Please follow the instruction to prepare VOC dataset.
- Clipart: Please follow the instruction to prepare Clipart dataset.
- Sim10k: Download the dataset from this website.
All codes are written to fit for the format of PASCAL_VOC.
We use CycleGAN to generate the transferred samples for both source and target domains, and then train the model with original and transferred images.
Due to the size limitation of uploaded data, we will release the data before and after augmentation upon acceptance.
In our experiments, we used two pre-trained models on ImageNet, i.e., VGG16 and ResNet101. Please download these two models from:
Due to the size limitation of uploaded data, we will release the pre-trained FLDMN models upon acceptance.
CUDA_VISIBLE_DEVICES=$GPU_ID \
python da_trainval_net.py \
--dataset source_dataset/target_dataset \
--net vgg16/resnet101 \
--pretrained_path path_to_pre-trained-model \
--save_dir path_to_save-model
CUDA_VISIBLE_DEVICES=$GPU_ID \
python test_net.py \
--dataset source_dataset/target_dataset \
--net vgg16/resnet101 \
--model_prefix path_to_model