This repository contains the code of our paper: Weakly-supervised continual learning for class-incremental segmentation.
conda create -n ICSS python gdal=2.4.4 shapely rtree -c 'conda-forge'
conda activate ICSS
pip install -r requirements.txt
The training datasets should be stored in a folder MyDataset organized as follows:
- a folder named
imgs
containing the RGB images. - a folder named
gts
containing the ground-truths.
Example for ISPRS Potsdam dataset.
cd <PotsdamDataset>
sudo apt install rename
cd gts; rename 's/_label//' *; cd ../imgs; rename 's/_RGB//' *
The ground-truth maps have to be one-hot encoded (i.e. not in a RGB format):
cd ICSS
python preprocess/format_gt.py -n 6 -d <PathToMyDataset>/gts
To create a sub-folder with only roads and buildings:
python preprocess/roads_buildings.py -d <PathToMyDataset>
ln -s <PathToMyDataset>/imgs <PathToMyDataset>/buildings_cars/imgs
python -m src.train -d /data/gaston/Potsdam/roads_buildings -c configs/some_config.yml
python -m src.increment_class -d /data/gaston/Potsdam/roads_buildings -c configs/some_config.yml -p data/models/LinkNet34_Potsdam__template.pt
python -m src.infer -c configs/some_config.yml -o ~/preds -i ~/data/Potsdam/imgs/top_potsdam_7_12.tif -p data/models/LinkNet34_roads_buildings_template.pt
Code is released under the MIT license for non-commercial and research purposes only. For commercial purposes, please contact the authors.
See LICENSE for more details.
This work has been jointly conducted at Alteia and ONERA-DTIS.