This is the official PyTorch implementation of the ICML 2024 paper Hyperbolic Active Learning for Semantic Segmentation under Domain Shift.
Luca Franco † 1, Paolo Mandica † 2, Konstantinos Kallidromitis 3, Devin Guillory4, Yu-Teng Li4, Trevor Darrell4, Fabio Galasso1,2
1 ItalAI,2 Sapienza University of Rome, 3 Panasonic North America, 4 UC Berkeley
† Equal contribution
[arXiv
][BibTeX
][OpenReview
]
You can choose to run the code in a conda environment or in a docker container. Follow the instructions below to set up your preferred environment.
conda create --name halo -y python=3.9
conda activate halo
pip install -r requirements.txt
Modify the docker-compose.yml
file to set the correct number of available GPUs. Then set your correct path for the DATA_VOLUME
and run the following commands:
export UID=$(id -u)
export GID=$(id -g)
export DATA_VOLUME="YOUR_PATH_TO_DATA_FOLDER"
docker compose build
docker compose up -d
-
Download the Cityscapes Dataset, GTAV Dataset, SYNTHIA Dataset, ACDC Dataset and extract them.
-
If you downloaded the datasets in a different folder, symlink them to the
datasets
directory:ln -s /path_to_cityscapes_dataset datasets/cityscapes ln -s /path_to_gtav_dataset datasets/gtav ln -s /path_to_synthia_dataset datasets/synthia ln -s /path_to_acdc_dataset datasets/acdc
-
Generate the label static files for GTAV/SYNTHIA Datasets by running
python datasets/generate_gtav_label_info.py -d datasets/gtav -o datasets/gtav/ python datasets/generate_synthia_label_info.py -d datasets/synthia -o datasets/synthia/
The datasets
directory tree should be structured as follows:
├── datasets/
│ ├── cityscapes/
| | ├── gtFine/
| | ├── leftImg8bit/
│ ├── gtav/
| | ├── images/
| | ├── labels/
| | ├── gtav_label_info.p
│ └── synthia
| | ├── RAND_CITYSCAPES/
| | ├── synthia_label_info.p
│ └── acdc
| | ├── images/
| | ├── gt/
The config files for the different training protocols can be found in the configs
directory.
Before running the training/testing scripts, make sure to set the correct paths in the config files.
python train.py -cfg CONFIG_PATH
python test.py -cfg CONFIG_PATH
To train with the ACDC dataset or the SegFormer architecture, you need to switch to the corresponding branch:
git checkout acdc
or
git checkout segformer
The two branches will be merged into the main branch soon.
This project is based on the RIPU open-source project, with our re-implementation in PyTorch Lightning for multi-gpu active learning. We thank the authors for making the source code publically available.
This project is licensed under the terms of the MIT license.
If you find this repository useful, please consider giving a star ⭐ and citation:
@inproceedings{
franco2024hyperbolic,
title={Hyperbolic Active Learning for Semantic Segmentation under Domain Shift},
author={Luca Franco and Paolo Mandica and Konstantinos Kallidromitis and Devin Guillory and Yu-Teng Li and Trevor Darrell and Fabio Galasso},
booktitle={Forty-first International Conference on Machine Learning},
year={2024},
url={https://openreview.net/forum?id=hKdJPMQvew}
}