All Projects → kevinhkhsu → Da_detection

kevinhkhsu / Da_detection

Licence: mit
Progressive Domain Adaptation for Object Detection

Projects that are alternatives of or similar to Da detection

Ga in python
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Ds Python Data Analysis
Data manipulation, analysis and visualisation in Python - specialist course Doctoral schools of Ghent University
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Github Paper
Plos in Computational Biology paper related with github for researchers, code, source and document
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Ct lung segmentation
Robust segmentation of lung and airway in CT scans
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Pythondataanalysis
The data and code that used in my book.
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Very Deep Convolutional Networks For Natural Language Processing In Tensorflow
implement the paper" Very Deep Convolutional Networks for Natural Language Processing"(https://arxiv.org/abs/1606.01781 ) in tensorflow
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Style Transfer Colab
Google Colab Notebook for Image and Video Style Transfer Using TensorFlow
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Vietnamese Electra
Electra pre-trained model using Vietnamese corpus
Stars: ✭ 55 (+0%)
Mutual labels:  jupyter-notebook
Telepyth
Telegram notification with IPython magics.
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Emotion Detector
A python code to detect emotions from text
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Reducingbias
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Deep3d
Automatic 2D-to-3D Video Conversion with CNNs
Stars: ✭ 1,075 (+1854.55%)
Mutual labels:  jupyter-notebook
Modernai
Materials for Modern AI Course / Cloud Day 2.0
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Cometts
Comet Time Series Toolset for working with a time-series of remote sensing imagery and user defined polygons
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Whitehat
Information about my experiences on ethical hacking 💀
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Tulingxueyuan
python笔记
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Pythonprojects
A Portfolio of Python Projects
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Graph Pointer Network
Stars: ✭ 55 (+0%)
Mutual labels:  jupyter-notebook
Ipython Notebooks
Some iPython Notebooks I have created for personal learning
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook
Blog
Read and Write
Stars: ✭ 54 (-1.82%)
Mutual labels:  jupyter-notebook

Progressive Domain Adaptation for Object Detection

Implementation of our paper Progressive Domain Adaptation for Object Detection, based on pytorch-faster-rcnn and PyTorch-CycleGAN.

Paper

Progressive Domain Adaptation for Object Detection Han-Kai Hsu, Chun-Han Yao, Yi-Hsuan Tsai, Wei-Chih Hung, Hung-Yu Tseng, Maneesh Singh and Ming-Hsuan Yang IEEE Winter Conference on Applications of Computer Vision (WACV), 2020.

Please cite our paper if you find it useful for your research.

@inproceedings{hsu2020progressivedet,
  author = {Han-Kai Hsu and Chun-Han Yao and Yi-Hsuan Tsai and Wei-Chih Hung and Hung-Yu Tseng and Maneesh Singh and Ming-Hsuan Yang},
  booktitle = {IEEE Winter Conference on Applications of Computer Vision (WACV)},
  title = {Progressive Domain Adaptation for Object Detection},
  year = {2020}
}

Dependencies

This code is tested with Pytorch 0.4.1 and CUDA 9.0

# Pytorch via pip: Download and install Pytorch 0.4.1 wheel for CUDA 9.0
#                  from https://download.pytorch.org/whl/cu90/torch_stable.html
# Pytorch via conda: 
conda install pytorch=0.4.1 cuda90 -c pytorch
# Other dependencies:
pip install -r requirements.txt
sh ./lib/make.sh

Data Preparation

KITTI

  • Download the data from here.
  • Extract the files under data/KITTI/

Cityscapes

  • Download the data from here.
  • Extract the files under data/CityScapes/

Foggy Cityscapes

  • Follow the instructions here to request for the dataset download.
  • Locate the data under data/CityScapes/leftImg8bit/ as foggytrain and foggyval.

BDD100k

  • Download the data from here.
  • Extract the files under data/bdd100k/

Generate synthetic data with CycleGAN

Generate the synthetic data with the PyTorch-CycleGAN implementation.

git clone https://github.com/aitorzip/PyTorch-CycleGAN

Dataset loader code

Import the dataset loader code in ./cycleGAN_dataset_loader/ to train/test the CycleGAN on corresponding image translation task.

Generate from pre-trained weight:

Follow the testing instructions on PyTorch-CycleGAN and download the weight below to generate synthetic images. (Remember to change to the corresponding output image size)

  • KITTI with Cityscapes style (KITTI->Cityscapes): size=(376,1244) Locate the generated data under data/KITTI/training/synthCity_image_2/ with same naming and folder structure as original KITTI data.
  • Cityscapes with FoggyCityscapes style (Cityscapes->FoggyCityscapes): size=(1024,2048) Locate the generated data under data/CityScapes/leftImg8bit/synthFoggytrain with same naming and folder structure as original Cityscapes data.
  • Cityscapes with BDD style (Cityscpaes->BDD100k): size=(1024,1280) Locate the generated data under data/CityScapes/leftImg8bit/synthBDDdaytrain and data/CityScapes/leftImg8bit/synthBDDdayval with same naming and folder structure as original Cityscapes data.

Train your own CycleGAN:

Please follow the training instructions on PyTorch-CycleGAN.

Test the adaptation model

Download the following adapted weights to ./trained_weights/adapt_weight/

./experiments/scripts/test_adapt_faster_rcnn_stage1.sh [GPU_ID] [Adapt_mode] vgg16
# Specify the GPU_ID you want to use
# Adapt_mode selection:
#   'K2C': KITTI->Cityscapes
#   'C2F': Cityscapes->Foggy Cityscapes
#   'C2BDD': Cityscapes->BDD100k_day
# Example:
./experiments/scripts/test_adapt_faster_rcnn_stage2.sh 0 K2C vgg16

Train your own model

Stage one

./experiments/scripts/train_adapt_faster_rcnn_stage1.sh [GPU_ID] [Adapt_mode] vgg16
# Specify the GPU_ID you want to use
# Adapt_mode selection:
#   'K2C': KITTI->Cityscapes
#   'C2F': Cityscapes->Foggy Cityscapes
#   'C2BDD': Cityscapes->BDD100k_day
# Example:
./experiments/scripts/train_adapt_faster_rcnn_stage1.sh 0 K2C vgg16

Download the following pretrained detector weights to ./trained_weights/pretrained_detector/

Stage two

./experiments/scripts/train_adapt_faster_rcnn_stage2.sh 0 K2C vgg16

Discriminator score files:

  • netD_synthC_score.json
  • netD_CsynthFoggyC_score.json
  • netD_CsynthBDDday_score.json

Extract the pretrained CycleGAN discriminator scores to ./trained_weights/ or Save a dictionary of CycleGAN discriminator scores with image name as key and score as value Ex: {'jena_000074_000019_leftImg8bit.png': 0.64}

Detection results

Adaptation results

Acknowledgement

Thanks to the awesome implementations from pytorch-faster-rcnn and PyTorch-CycleGAN.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].