• Stars
    star
    345
  • Rank 122,719 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementation of "Strong-Weak Distribution Alignment for Adaptive Object Detection"

A Pytorch Implementation of Strong-Weak Distribution Alignment for Adaptive Object Detection (CVPR 2019)

Introduction

Follow faster-rcnn repository to setup the environment. When installing pytorch-faster-rcnn, you may encounter some issues. Many issues have been reported there to setup the environment. We used Pytorch 0.4.0 for this project. The different version of pytorch will cause some errors, which have to be handled based on each envirionment.

Data Preparation

  • PASCAL_VOC 07+12: Please follow the instructions in py-faster-rcnn to prepare VOC datasets.
  • Clipart, WaterColor: Dataset preparation instruction link Cross Domain Detection . Images translated by Cyclegan are available in the website.
  • Sim10k: Website Sim10k
  • Cityscape-Translated Sim10k: TBA
  • CitysScape, FoggyCityscape: Download website Cityscape, see dataset preparation code in DA-Faster RCNN

All codes are written to fit for the format of PASCAL_VOC. For example, the dataset Sim10k is stored as follows.

$ cd Sim10k/VOC2012/
$ ls
Annotations  ImageSets  JPEGImages
$ cat ImageSets/Main/val.txt
3384827.jpg
3384828.jpg
3384829.jpg
.
.
.

If you want to test the code on your own dataset, arange 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 Path

Write your dataset directories' paths in lib/datasets/config_dataset.py.

Pretrained Model

We used two models pre-trained on ImageNet in our experiments, VGG and ResNet101. You can 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.

sample model

Global-local alignment model for watercolor dataset.

Train

  • Sample training script is in a folder, train_scripts.
  • With only local alignment loss,
 CUDA_VISIBLE_DEVICES=$GPU_ID python trainval_net_local.py \
                    --dataset source_dataset --dataset_t target_dataset --net vgg16 \
                    --cuda

Add --lc when using context-vector based regularization loss.

  • With only global alignment loss,
 CUDA_VISIBLE_DEVICES=$GPU_ID python trainval_net_global.py \
                    --dataset source_dataset --dataset_t target_dataset --net vgg16 \
                    --cuda

Add --gc when using context-vector based regularization loss.

  • With global and local alignment loss,
 CUDA_VISIBLE_DEVICES=$GPU_ID python trainval_net_global_local.py \
                    --dataset source_dataset --dataset_t target_dataset --net vgg16 \
                    --cuda

Add --lc and --gc when using context-vector based regularization loss.

Test

  • Sample test script is in a folder, test_scripts.
 CUDA_VISIBLE_DEVICES=$GPU_ID python test_net_global_local.py \
                    --dataset target_dataset --net vgg16 \
                    --cuda --lc --gc --load_name path_to_model

Citation

Please cite the following reference if you utilize this repository for your project.

@article{saito2018strong,
  title={Strong-Weak Distribution Alignment for Adaptive Object Detection},
  author={Saito, Kuniaki and Ushiku, Yoshitaka and Harada, Tatsuya and Saenko, Kate},
  journal={arXiv},
  year={2018}
}

More Repositories

1

SSDA_MME

Semi-supervised Domain Adaptation via Minimax Entropy
Python
295
star
2

R-C3D

code for R-C3D
Jupyter Notebook
251
star
3

CORAL

Correlation Alignment for Domain Adaptation
186
star
4

VisionLearningGroup.github.io

CSS
183
star
5

taskcv-2017-public

Python
168
star
6

DAL

Domain agnostic learning with disentangled representations
Python
135
star
7

DANCE

repository for Universal Domain Adaptation through Self-supervision
Python
123
star
8

caption-guided-saliency

Supplementary material to "Top-down Visual Saliency Guided by Captions" (CVPR 2017)
Python
105
star
9

OVANet

Repository for OVANet
Python
82
star
10

visda-2019-public

Python
58
star
11

OP_Match

Python
56
star
12

visda-2018-public

Python
45
star
13

visda21-dev

Python
45
star
14

Text-to-Clip_Retrieval

Implementation for "Multilevel Language and Vision Integration for Text-to-Clip Retrieval"
Jupyter Notebook
44
star
15

CDS

CDS: Cross-Domain Self-supervised Pre-training
Python
26
star
16

Ask_Attend_and_Answer

Ask, Attend and Answer: Exploring Question-Guided Spatial Attention for Visual Question Answering
C++
23
star
17

JEDDi-Net

Implementation for "Joint Event Detection and Description in Continuous Video Streams"
Jupyter Notebook
22
star
18

UDA_PoseEstimation

Python
19
star
19

MULE

Implementation of "MULE: Multimodal Universal Language Embedding"
Python
14
star
20

Benchmark_Domain_Transfer

Python
13
star
21

SND

Python
13
star
22

Domain2Vec

7
star
23

taskcv_2018_public

Python
4
star
24

mind_back

repository for a paper, Mind the Backbone: Minimizing Backbone Distortion for Robust Object Detection
Python
4
star
25

MMVD

Multimodal Video Description
3
star
26

visda-2018

HTML
3
star
27

SANE

Pytorch implementation of our ECCV paper
Python
2
star
28

visda-2019

CSS
1
star
29

Learning-Similarity-Conditions

Python
1
star
30

Ground2Sky

1
star