• Stars
    star
    386
  • Rank 111,213 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 11 months ago

Reviews

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

Repository Details

IJCAI2020 & IJCV2021 πŸŒ‡ Unsupervised Scene Adaptation with Memory Regularization in vivo

Seg_Uncertainty

Python 3.6 License: MIT

Zhedong Zheng, Yi Yang

In this repo, we provide the code for the two papers, i.e.,

Initial Model

The original DeepLab link of ucmerced is failed. Please use the following link.

[Google Drive] https://drive.google.com/file/d/1BMTTMCNkV98pjZh_rU0Pp47zeVqF3MEc/view?usp=share_link

[One Drive] https://1drv.ms/u/s!Avx-MJllNj5b3SqR7yurCxTgIUOK?e=A1dq3m

or use

pip install gdown
pip install --upgrade gdown
gdown 1BMTTMCNkV98pjZh_rU0Pp47zeVqF3MEc

Table of contents

News

  • [27 Jan 2023] You are welcomed to check our new transformer-based work PiPa, which achieves 75.6 mIoU on GTA5->Cityscapes.

  • [5 Sep 2021] Zheng etal. apply the Uncertainty to domain adaptive reid, and also achieve good performance. "Exploiting Sample Uncertainty for Domain Adaptive Person Re-Identification" Kecheng Zheng, Cuiling Lan, Wenjun Zeng, Zhizheng Zhang, and Zheng-Jun Zha. AAAI 2021

  • [13 Aug 2021] We release one new method by Adaptive Boosting (AdaBoost) for Domain Adaptation. You may check the project at https://github.com/layumi/AdaBoost_Seg

Common Q&A

  1. Why KLDivergence is always non-negative (>=0)?

Please check the wikipedia at (https://en.wikipedia.org/wiki/Kullback–Leibler_divergence#Properties) . It provides one good demonstration.

  1. Why both log_sm and sm are used?

You may check the pytorch doc at https://pytorch.org/docs/stable/generated/torch.nn.KLDivLoss.html?highlight=nn%20kldivloss#torch.nn.KLDivLoss. I follow the discussion at https://discuss.pytorch.org/t/kl-divergence-loss/65393

The Core Code

Core code is relatively simple, and could be directly applied to other works.

Prerequisites

  • Python 3.6
  • GPU Memory >= 11G (e.g., GTX2080Ti or GTX1080Ti)
  • Pytorch or Paddlepaddle

Prepare Data

Download [GTA5] and [Cityscapes] to run the basic code. Alternatively, you could download extra two datasets from [SYNTHIA] and [OxfordRobotCar].

The data folder is structured as follows:

β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ Cityscapes/  
|   |   β”œβ”€β”€ data/
|   |       β”œβ”€β”€ gtFine/
|   |       β”œβ”€β”€ leftImg8bit/
β”‚   β”œβ”€β”€ GTA5/
|   |   β”œβ”€β”€ images/
|   |   β”œβ”€β”€ labels/
|   |   β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ synthia/ 
|   |   β”œβ”€β”€ RGB/
|   |   β”œβ”€β”€ GT/
|   |   β”œβ”€β”€ Depth/
|   |   β”œβ”€β”€ ...
β”‚   └── Oxford_Robot_ICCV19
|   |   β”œβ”€β”€ train/
|   |   β”œβ”€β”€ ...

Training

Stage-I:

python train_ms.py --snapshot-dir ./snapshots/SE_GN_batchsize2_1024x512_pp_ms_me0_classbalance7_kl0.1_lr2_drop0.1_seg0.5  --drop 0.1 --warm-up 5000 --batch-size 2 --learning-rate 2e-4 --crop-size 1024,512 --lambda-seg 0.5  --lambda-adv-target1 0.0002 --lambda-adv-target2 0.001   --lambda-me-target 0  --lambda-kl-target 0.1  --norm-style gn  --class-balance  --only-hard-label 80  --max-value 7  --gpu-ids 0,1  --often-balance  --use-se  

Generate Pseudo Label:

python generate_plabel_cityscapes.py  --restore-from ./snapshots/SE_GN_batchsize2_1024x512_pp_ms_me0_classbalance7_kl0.1_lr2_drop0.1_seg0.5/GTA5_25000.pth

Stage-II (with recitfying pseudo label):

python train_ft.py --snapshot-dir ./snapshots/1280x640_restore_ft_GN_batchsize9_512x256_pp_ms_me0_classbalance7_kl0_lr1_drop0.2_seg0.5_BN_80_255_0.8_Noaug --restore-from ./snapshots/SE_GN_batchsize2_1024x512_pp_ms_me0_classbalance7_kl0.1_lr2_drop0.1_seg0.5/GTA5_25000.pth --drop 0.2 --warm-up 5000 --batch-size 9 --learning-rate 1e-4 --crop-size 512,256 --lambda-seg 0.5 --lambda-adv-target1 0 --lambda-adv-target2 0 --lambda-me-target 0 --lambda-kl-target 0 --norm-style gn --class-balance --only-hard-label 80 --max-value 7 --gpu-ids 0,1,2 --often-balance  --use-se  --input-size 1280,640  --train_bn  --autoaug False

*** If you want to run the code without rectifying pseudo label, please change [this line] to 'from trainer_ms import AD_Trainer', which would apply the conventional pseudo label learning. ***

Testing

python evaluate_cityscapes.py --restore-from ./snapshots/1280x640_restore_ft_GN_batchsize9_512x256_pp_ms_me0_classbalance7_kl0_lr1_drop0.2_seg0.5_BN_80_255_0.8_Noaug/GTA5_25000.pth

Trained Model

The trained model is available at https://drive.google.com/file/d/1smh1sbOutJwhrfK8dk-tNvonc0HLaSsw/view?usp=sharing

  • The folder with SY in name is for SYNTHIA-to-Cityscapes
  • The folder with RB in name is for Cityscapes-to-Robot Car

One Note for SYNTHIA-to-Cityscapes

Note that the evaluation code I provided for SYNTHIA-to-Cityscapes is still average the IoU by divide 19. Actually, you need to re-calculate the value by divide 16. There are only 16 shared classes for SYNTHIA-to-Cityscapes. In this way, the result is same as the value reported in paper.

Related Works

We also would like to thank great works as follows:

Citation

@inproceedings{zheng2020unsupervised,
  title={Unsupervised Scene Adaptation with Memory Regularization in vivo},
  author={Zheng, Zhedong and Yang, Yi},
  booktitle={IJCAI},
  year={2020}
}
@article{zheng2021rectifying,
  title={Rectifying Pseudo Label Learning via Uncertainty Estimation for Domain Adaptive Semantic Segmentation },
  author={Zheng, Zhedong and Yang, Yi},
  journal={International Journal of Computer Vision (IJCV)},
  doi={10.1007/s11263-020-01395-y},
  note={\mbox{doi}:\url{10.1007/s11263-020-01395-y}},
  year={2021}
}

More Repositories

1

Person_reID_baseline_pytorch

⛹️ Pytorch ReID: A tiny, friendly, strong pytorch implement of person re-id / vehicle re-id baseline. Tutorial πŸ‘‰https://github.com/layumi/Person_reID_baseline_pytorch/tree/master/tutorial
Python
4,058
star
2

Vehicle_reID-Collection

πŸš— the collection of vehicle re-ID papers, datasets. πŸš—
453
star
3

University1652-Baseline

ACM Multimedia2020 University-1652: A Multi-view Multi-source Benchmark for Drone-based Geo-localization 🚁 annotates 1652 buildings in 72 universities around the world.
Python
452
star
4

AICIty-reID-2020

πŸš— The 1st Place Submission to AICity Challenge 2020 re-id track (Baidu-UTS submission)
Python
449
star
5

Person-reID_GAN

ICCV2017 Unlabeled Samples Generated by GAN Improve the Person Re-identification Baseline in vitro
Cuda
317
star
6

Image-Text-Embedding

TOMM2020 Dual-Path Convolutional Image-Text Embedding 🐾 https://arxiv.org/abs/1711.05535
MATLAB
280
star
7

2016_person_re-ID

TOMM2017 A Discriminatively Learned CNN Embedding for Person Re-identification
C
265
star
8

person-reid-3d

TNNLS'22 πŸ—½ Parameter-Efficient Person Re-identification in the 3D Space πŸ—½
Python
262
star
9

Pedestrian_Alignment

TCSVT2018 Pedestrian Alignment Network for Large-scale Person Re-identification
Cuda
237
star
10

Person-reID-triplet-loss

Person re-ID baseline with triplet loss
Python
189
star
11

2015_Face_Detection

CVPR2015 Cascade CNNs for Face Detection
HTML
136
star
12

Person-reID-verification

🐨 (pytorch version) TOMM2017 A Discriminatively Learned CNN Embedding for Person Re-identification 🐨
Python
100
star
13

2016_super_resolution

ICCV2015 Image Super-Resolution Using Deep Convolutional Networks
Cuda
86
star
14

Awesome-Fools

πŸ’€ A collection of methods to fool the deep neural network πŸ’€
76
star
15

3D-Magic-Mirror

πŸ‘—3D Magic Mirror: Clothing Reconstruction from a Single Image via a Causal PerspectiveπŸ‘— Single-View 3D Reconstruction
Python
72
star
16

U_turn

IJCV22 πŸ™ˆ Attack your retrieval model via Query! They are not robust as you expected! πŸ™‰
Python
47
star
17

AdaBoost_Seg

TIP2022 Adaptive Boosting (AdaBoost) for Domain Adaptation ? πŸ€·β€β™€οΈ Why not ! πŸ™†β€β™€οΈ
Python
45
star
18

visualize_matconvnet

A simple code to visualize net for matconvnet.
MATLAB
35
star
19

2016_GAN_Matlab

Generative Adversarial Nets for Matlab
HTML
35
star
20

2016_Artist_Style

Using CNN to create 'famous painting' with Matlab code
HTML
19
star
21

DukeMTMC-reID_baseline

DukeMTMC-reID_baseline (Matlab)
Cuda
18
star
22

UTS-Person-reID-Practical

UTS Person-reID Practical By Zhedong Zheng
18
star
23

HQ-Market

Market-1501 dataset with super-resolution quality
Python
18
star
24

Image-Retrieval-by-Finetuning-CNN

Code for project
Python
17
star
25

Awesome-Text2Motion-Generation

Awesome-Text2Motion-Generation
16
star
26

ACMMM2023Workshop

UAVM @ ACM MM2023 Workshop on UAVs in Multimedia: Capturing the World from a New Perspective
16
star
27

NLP-AICity2021

The 1st Place Submission to AICity Track5 - Natural Language-based Vehicle Retrieval.
Python
15
star
28

UAVM2023

ACM MM Workshop on UAVs in Multimedia: Capturing the World from a New Perspective (UAVM 2023)
12
star
29

Person_reID_baseline_matconvnet

Matconvnet implement of Person re-identification baseline. We arrived Rank@1=87.74% mAP=69.46% only with softmax loss.
Cuda
12
star
30

matlab_email_demo

a easy solution for baby sitting program!!! (MATLAB)
M
11
star
31

ICME2022SS

ICME2022 Special Session β€œBeyond Accuracy: Responsible, Responsive, and Robust Multimedia Retrieval ”
11
star
32

To-Academic-Newcomers

10
star
33

DCGAN-pytorch

Pytorch implement of DCGAN and LSGAN
Python
8
star
34

University1652-triplet-loss

triplet loss with hard negative / soft margin for the University-1652 dataset.
Python
8
star
35

2016_Class_Activation_Mapping

semantic segmentation in MATLAB
HTML
7
star
36

Robust-GPUs

Python
7
star
37

layumi.github.io

UTS Group Seminar http://www.zdzheng.xyz
HTML
6
star
38

market1501_body_point

MATLAB
6
star
39

Cifar10-Adaboost

Python
6
star
40

2016_Center_Loss

Matlab_ECCV16_Center_Loss
HTML
4
star
41

google_scholar_scrapy

extract data from google scholar
Python
4
star
42

Oxford-Paris-Attack

πŸ™ˆ We added our attacking method ODFA (https://arxiv.org/abs/1809.02681). The performance drops from 88.2% to 2.24% on Oxford. πŸ™‰
Python
4
star
43

visualize_face_detection_net

MATLAB
3
star
44

SOTA-semi

3
star
45

Matlab_TripletLoss

Matlab_TripletLoss
MATLAB
3
star
46

Batch-Normal-For-Caffe

Extend batch normalization layer for caffe
C++
3
star
47

pytorch-mnist

Draw mnist
Python
3
star
48

Awesome-Sign-Language

awesome list for sign language
3
star
49

2015_speech

word audio recognition
HTML
2
star
50

layumi

2
star
51

pkl2mat

a tool for transfer pkl file to mat file
Python
2
star
52

ACMMM2024Workshop-UAV

2
star
53

ComputerVisionAwardPapers

1
star
54

2016_FlowNet

Cuda
1
star
55

Zhedong-Zheng-blog

zhedong zheng's blog
CSS
1
star
56

2016_Video_Stabilization

A project @Fudan for 2016 Digital Image Processing
C
1
star
57

empty

1
star
58

Workshop-Proposal-DDL

1
star
59

WordNet_Matlab

a simple api for matlab to search semantic synonym
MATLAB
1
star
60

MORE2024

Multimedia Object Re-identification Workshop (MORE) @ ICMR2024
1
star