Giter Club home page Giter Club logo

htcn's Introduction

Harmonizing Transferability and Discriminability for Adapting Object Detectors (CVPR 2020)

A Pytorch Implementation of Harmonizing Transferability and Discriminability for Adapting Object Detectors.

Introduction

Please follow faster-rcnn respository to setup the environment. In this project, we use Pytorch 1.0.1 and CUDA version is 10.0.130.

Datasets

Datasets Preparation

  • 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.

Datasets Format

All codes are written to fit for the format of PASCAL_VOC.
If you want to use this code on your own dataset, please arrange the dataset in the format of PASCAL, make dataset class in lib/datasets/, and add it to lib/datasets/factory.py, lib/datasets/config_dataset.py. Then, add the dataset option to lib/model/utils/parser_func.py.

Data Interpolation

You should use CycleGAN to generate the interpolation samples for both source and target domain, and then train the model with original and generated data. This step is important for the adaptation from Cityscape to FoggyCityscape and the adaptation from Sim10k to Cityscape. For the adaptation from PASCAL_VOC 07+12 to Clipart, we empirically found that we can also achieve competitive results without interpolation.

Models

Pre-trained Models

In our experiments, we used two pre-trained models on ImageNet, i.e., VGG16 and ResNet101. Please download these two models from:

Download them and write the path in __C.VGG_PATH and __C.RESNET_PATH at lib/model/utils/config.py.

Train

CUDA_VISIBLE_DEVICES=$GPU_ID \
       python trainval_net_HTCN.py \
       --dataset source_dataset --dataset_t target_dataset \
       --net vgg16/resnet101 

Test

CUDA_VISIBLE_DEVICES=$GPU_ID \
       python test_net_HTCN.py \
       --dataset source_dataset --dataset_t target_dataset \
       --net vgg16/resnet101  \
       --load_name path_to_model

Citation

If you find this repository useful, please cite our paper:

@inproceedings{chen2020htcn,
  title={Harmonizing Transferability and Discriminability for Adapting Object Detectors},
  author={Chen, Chaoqi and Zheng, Zebiao and Ding, Xinghao and Huang, Yue and Dou, Qi},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2020}
}
@article{chen2020harmonizing,
  title={Harmonizing Transferability and Discriminability for Adapting Object Detectors},
  author={Chen, Chaoqi and Zheng, Zebiao and Ding, Xinghao and Huang, Yue and Dou, Qi},
  journal={arXiv preprint arXiv:2003.06297},
  year={2020}
}

htcn's People

Contributors

chaoqichen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.