Skip to content

DarlingInTheSV/Probabilistic-Prototypical-Pixel-Contrast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reducing Semantic Ambiguity In Domain Adaptive Semantic Segmentation Via Probabilistic Prototypical Pixel Contrast

This is the official implementation of the paper "Reducing Semantic Ambiguity In Domain Adaptive Semantic Segmentation Via Probabilistic Prototypical Pixel Contrast"

Visualization Visualization

Installation

# create conda environment
conda create --name PPPC -y python=3.8
conda activate PPPC
conda install -y ipython pip

# Upgrade pip, otherwise the installation of mmcv-full will be slow. 
pip install --upgrade pip
pip install -r requirements.txt

Data Preparation

Download Datasets

  • GTAV: Download GTAV from here and extract them to data/gta.
  • Synthia: Download Synthia from here and extract it to data/synthia.
  • Cityscapes: Download Cityscapes from here and extract it to data/synthia.
  • Dark Zurich: Download Dark Zurich from here and extract it to data/synthia.

The folder structure should like this:

PPPC
├── ...
├── data
│   ├── cityscapes
│   │   ├── leftImg8bit
│   │   │   ├── train
│   │   │   ├── val
│   │   ├── gtFine
│   │   │   ├── train
│   │   │   ├── val
│   ├── dark_zurich
│   │   ├── gt
│   │   │   ├── val
│   │   ├── rgb_anon
│   │   │   ├── train
│   │   │   ├── val
│   ├── gta
│   │   ├── images
│   │   ├── labels
│   ├── synthia 
│   │   ├── RGB
│   │   ├── GT
│   │   │   ├── LABELS
├── ...

Perform preprocessing to convert label IDs to the train IDs and gather dataset statistics:

python tools/convert_datasets/gta.py data/gta --nproc 20
python tools/convert_datasets/cityscapes.py data/cityscapes --nproc 20

Evaluate

Evaluation on Cityscapes

To evaluate the model on Cityscapes, run:

python -m tools.test /path/to/config /path/to/checkpoint --eval mIoU

Our trained model and config are available via GTAV → Cityscapes, SYNTHIA → Cityscapes.

Evaluation on Dark Zurich

Train

The detail of train configration is at 'experiments.py'.

python run_experiments.py --exp <exp_id>
<exp_id> task
1 GTAV → Cityscapes
2 SYNTHIA → Cityscapes
3 Cityscapes → Dark Zurich

Acknowledgments

This project is based on the following open-source projects. We thank their authors for making the source code publicly available.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published