All Projects → harsh-99 → Scl

harsh-99 / Scl

Implementation of "SCL: Towards Accurate Domain Adaptive Object Detection via Gradient Detach Based Stacked Complementary Losses"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Scl

Domain Adaptive Faster Rcnn Pytorch
Domain Adaptive Faster R-CNN in PyTorch
Stars: ✭ 135 (+107.69%)
Mutual labels:  object-detection, domain-adaptation
Detectron Self Train
A PyTorch Detectron codebase for domain adaptation of object detectors.
Stars: ✭ 99 (+52.31%)
Mutual labels:  object-detection, domain-adaptation
Htcn
Implementation of "Harmonizing Transferability and Discriminability for Adapting Object Detectors" (CVPR 2020)
Stars: ✭ 82 (+26.15%)
Mutual labels:  object-detection, domain-adaptation
Cross Domain Detection
Cross-Domain Weakly-Supervised Object Detection through Progressive Domain Adaptation [Inoue+, CVPR2018].
Stars: ✭ 320 (+392.31%)
Mutual labels:  object-detection, domain-adaptation
Ssd keras
Port of Single Shot MultiBox Detector to Keras
Stars: ✭ 1,101 (+1593.85%)
Mutual labels:  object-detection
Mask rcnn ros
The ROS Package of Mask R-CNN for Object Detection and Segmentation
Stars: ✭ 53 (-18.46%)
Mutual labels:  object-detection
Math object detection
An image recognition/object detection model that detects handwritten digits and simple math operators. The output of the predicted objects (numbers & math operators) is then evaluated and solved.
Stars: ✭ 52 (-20%)
Mutual labels:  object-detection
Lfip
Efficient Featurized Image Pyramid Network for Single Shot Detector, CVPR, 2019
Stars: ✭ 52 (-20%)
Mutual labels:  object-detection
Artos
Adaptive Real-Time Object Detection System with HOG and CNN Features
Stars: ✭ 64 (-1.54%)
Mutual labels:  object-detection
Taggerine
Annotation tool for images
Stars: ✭ 61 (-6.15%)
Mutual labels:  object-detection
Logo Detection Yolov2
Stars: ✭ 57 (-12.31%)
Mutual labels:  object-detection
Wheat
Wheat Detection challenge on Kaggle
Stars: ✭ 54 (-16.92%)
Mutual labels:  object-detection
Darknet ros
YOLO ROS: Real-Time Object Detection for ROS
Stars: ✭ 1,101 (+1593.85%)
Mutual labels:  object-detection
Hsd
Hierarchical Shot Detector (ICCV2019)
Stars: ✭ 53 (-18.46%)
Mutual labels:  object-detection
Ya mxdet
Yet Another MXnet DETection
Stars: ✭ 61 (-6.15%)
Mutual labels:  object-detection
Trafficvision
MIVisionX toolkit is a comprehensive computer vision and machine intelligence libraries, utilities and applications bundled into a single toolkit.
Stars: ✭ 52 (-20%)
Mutual labels:  object-detection
Rrpn
Code for 'RRPN: Radar Region Proposal Network for Object Detection in Autonomous Vehicles' (ICIP 2019)
Stars: ✭ 57 (-12.31%)
Mutual labels:  object-detection
Physim Dataset Generator
generate physically realistic synthetic dataset of cluttered scenes using 3D CAD models to train CNN based object detectors
Stars: ✭ 59 (-9.23%)
Mutual labels:  object-detection
Mmdetection object detection demo
How to train an object detection model with mmdetection
Stars: ✭ 55 (-15.38%)
Mutual labels:  object-detection
Yolov4 Pytorch
This is a pytorch repository of YOLOv4, attentive YOLOv4 and mobilenet YOLOv4 with PASCAL VOC and COCO
Stars: ✭ 1,070 (+1546.15%)
Mutual labels:  object-detection

Pytorch implementation of SCL-Domain-Adaptive-Object-Detection

Introduction

Please follow faster-rcnn repository to setup the environment. This code is based on the implemenatation of Strong-Weak Distribution Alignment for Adaptive Object Detection. 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.
For convenience, this repository contains implementation of:

  • SCL: Towards Accurate Domain Adaptive Object Detection via Gradient Detach Based Stacked Complementary Losses (link)
  • Strong-Weak Distribution Alignment for Adaptive Object Detection, CVPR'19 (link)
  • Domain Adaptive Faster R-CNN for Object Detection in the Wild, CVPR'18 (Our re-implementation) (link)

Data preparation

We have included the following set of datasets for our implementation:

It is important to note that we have written all the codes for Pascal VOC format. For example the dataset cityscape is stored as:

$ cd cityscape/VOC2012 
$ ls
Annotations  ImageSets  JPEGImages
$ cd ImageSets/Main
$ ls
train.txt val.txt trainval.txt test.txt

Note: 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 and lib/model/utils/parser_func_multi.py.

Note: Kindly note that currently our code support only batch size = 1. batch size>1 may cause some errors.

Data path

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

for example

__D.CLIPART = "./clipart"
__D.WATER = "./watercolor"
__D.SIM10K = "Sim10k/VOC2012"
__D.SIM10K_CYCLE = "Sim10k_cycle/VOC2012"
__D.CITYSCAPE_CAR = "./cityscape/VOC2007"
__D.CITYSCAPE = "../DA_Detection/cityscape/VOC2007"
__D.FOGGYCITY = "../DA_Detection/foggy/VOC2007"

__D.INIT_SUNNY = "./init_sunny"
__D.INIT_NIGHT = "./init_night"

Pre-trained model

We used two pre-trained models on ImageNet as backbone for our experiments, VGG16 and ResNet101. You can download these two models from:

To provide their path in the code check __C.VGG_PATH and __C.RESNET_PATH at lib/model/utils/config.py.

Our trained model
We are providing our models for foggycityscapes, watercolor and clipart.

  1. Adaptation form cityscapes to foggycityscapes:
  1. Adaptation from pascal voc to watercolor:
  1. Adaptation from pascal voc to clipart:

Train

We have provided sample training commands in train_scripts folder. However they are only for implementing our model.
I am providing commands for implementing all three models below. For SCL: Towards Accurate Domain Adaptive Object Detection via Gradient Detach Based Stacked Complementary Losses -:

CUDA_VISIBLE_DEVICES=$1 python trainval_net_SCL.py --cuda --net vgg16 --dataset cityscape --dataset_t foggy_cityscape --save_dir $2

For Domain Adaptive Faster R-CNN for Object Detection in the Wild -:

CUDA_VISIBLE_DEVICES=$1 python trainval_net_dfrcnn.py --cuda --net vgg16 --dataset cityscape --dataset_t foggy_cityscape --save_dir $2

For Strong-Weak Distribution Alignment for Adaptive Object Detection -:

CUDA_VISIBLE_DEVICES=$1 python trainval_net_global_local.py --cuda --net vgg16 --dataset cityscape --dataset_t foggy_cityscape --gc --lc --save_dir $2

Test

We have provided sample testing commands in test_scripts folder for our model. For others please take a reference of above training scripts.

Citation

If you use our code or find this helps your research, please cite:

@article{shen2019SCL,
  title={SCL: Towards Accurate Domain Adaptive Object Detection via
Gradient Detach Based Stacked Complementary Losses},
  author={Zhiqiang Shen and Harsh Maheshwari and Weichen Yao and Marios Savvides},
  journal={arXiv preprint arXiv:1911.02559},
  year={2019}
}

Examples

Figure 1: Detection Results from Pascal VOC to Clipart.
Figure 2: Detection Results from Pascal VOC to Watercolor.
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].