• Stars
    star
    140
  • Rank 261,473 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created over 4 years ago
  • Updated about 4 years ago

Reviews

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

Repository Details

(ECCV 2020) Classes Matter: A Fine-grained Adversarial Approach to Cross-domain Semantic Segmentation

Classes Matter: A Fine-grained Adversarial Approach to Cross-domain Semantic Segmentation (ECCV 2020)

This is a pytorch implementation of FADA.

Prerequisites

  • Python 3.6
  • Pytorch 1.2.0
  • torchvision from master
  • yacs
  • matplotlib
  • GCC >= 4.9
  • OpenCV
  • CUDA >= 9.0

Step-by-step installation

conda create --name fada -y python=3.6
conda activate fada

# this installs the right pip and dependencies for the fresh python
conda install -y ipython pip

pip install ninja yacs cython matplotlib tqdm opencv-python imageio mmcv

# follow PyTorch installation in https://pytorch.org/get-started/locally/
# we give the instructions for CUDA 9.2
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=9.2 -c pytorch

Getting started

ln -s /path_to_gta5_dataset datasets/gta5
ln -s /path_to_synthia_dataset datasets/synthia
ln -s /path_to_cityscapes_dataset datasets/cityscapes
  • Generate the label statics file for GTA5 and SYNTHIA Datasets by running
python datasets/generate_gta5_label_info.py -d datasets/gta5 -o datasets/gta5/
python datasets/generate_synthia_label_info.py -d datasets/synthia -o datasets/synthia/

The data folder should be structured as follows:

β”œβ”€β”€ datasets/
β”‚   β”œβ”€β”€ cityscapes/     
|   |   β”œβ”€β”€ gtFine/
|   |   β”œβ”€β”€ leftImg8bit/
β”‚   β”œβ”€β”€ gta5/
|   |   β”œβ”€β”€ images/
|   |   β”œβ”€β”€ labels/
|   |   β”œβ”€β”€ gtav_label_info.p
β”‚   β”œβ”€β”€ synthia/
|   |   β”œβ”€β”€ RAND_CITYSCAPES/
|   |   β”œβ”€β”€ synthia_label_info.p
β”‚   └── 			
...

Train

We provide the training script using 4 Tesla P40 GPUs. Note that when generating pseudo labels for self distillation, the link to the pseudo label directory should be updated here.

bash train_with_sd.sh

Evaluate

python test.py -cfg configs/deeplabv2_r101_tgt_self_distill.yaml resume g2c_sd.pth

Tip: For those who are interested in how performance change during the process of adversarial training, test.py also accepts directory as the input and the results will be stored in a csv file.

Pretrained weights

Our pretrained models for Synthia -> CityScapes task(s2c) and GTA5 -> CityScapes task(g2c) are available via Google Drive.

Visualization results

Visualization

Acknowledge

Some codes are adapted from maskrcnn-benchmark and semseg. We thank them for their excellent projects.

Citation

If you find this code useful please consider citing

@InProceedings{Haoran_2020_ECCV,
  author = {Wang, Haoran and Shen, Tong and Zhang, Wei and Duan, Lingyu and Mei, Tao},
  title = {Classes Matter: A Fine-grained Adversarial Approach to Cross-domain Semantic Segmentation},
  booktitle = {The European Conference on Computer Vision (ECCV)},
  month = {August},
  year = {2020}
} 

More Repositories

1

fast-reid

SOTA Re-identification Methods and Toolbox
Python
3,377
star
2

FaceX-Zoo

A PyTorch Toolbox for Face Recognition
Python
1,863
star
3

dabnn

dabnn is an accelerated binary neural networks inference framework for mobile platform
C++
767
star
4

DCL

Destruction and Construction Learning for Fine-grained Image Recognition
Python
585
star
5

centerX

This repo is implemented based on detectron2 and centernet
Python
554
star
6

CoTNet

This is an official implementation for "Contextual Transformer Networks for Visual Recognition".
Python
512
star
7

VeRidataset

This is the project page for veri dataset which is a large scale image dataset for vehicle re-identification in urban traffic surveillance.
MATLAB
397
star
8

DNNLibrary

Daquexian's NNAPI Library. ONNX + Android NNAPI
C++
346
star
9

image-captioning

Implementation of 'X-Linear Attention Networks for Image Captioning' [CVPR 2020]
Python
269
star
10

lapa-dataset

A large-scale dataset for face parsing (AAAI2020)
258
star
11

Down-to-the-Last-Detail-Virtual-Try-on-with-Detail-Carving

Virtural try-on under arbitrary poses
Python
217
star
12

Partial-Person-ReID

Python
168
star
13

DSD-SATN

ICCV19: Official code of Human Mesh Recovery from Monocular Images via a Skeleton-disentangled Representation
Python
133
star
14

LIO

Look-into-Object: Self-supervised Structure Modeling for Object Recognition (CVPR 2020)
Jupyter Notebook
113
star
15

PGPT

Implementation of β€˜Pose-Guided Tracking-by-Detection: Robust Multi-Person Pose Tracking’ [TMM 2020]
Python
47
star
16

CM-NAS

CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification (ICCV2021)
Python
46
star
17

CoTNet-ObjectDetection-InstanceSegmentation

Python
33
star
18

dabnn-example

Android demo for dabnn
Java
19
star
19

atlasWrapper

C++
8
star