Source code which reproduces the results from the paper Efficient Ladder-Style DenseNets for Semantic Segmentation of Large Images (Ivan Krešo, Josip Krapac, Siniša Šegvić) published in IEEE Transactions on Intelligent Transportation Systems (link). Previous work is available on arXiv (link).
Demo video on Cityscapes dataset:
- Python (>= 3.7)
pip install torch pillow numpy tqdm
Download and unzip following dataset files from https://www.cityscapes-dataset.com/downloads/:
- leftImg8bit_trainvaltest.zip
- gtFine_trainvaltest.zip
Place both leftImg8bit
and gtFine
dirs into the same dataset root dir dataset_path
.
Pre-trained Cityscapes models are available here.
- Download and extract the model to
model_path
.
Evaluate the model on Cityscapes validation subset:
python eval.py --model=models/ldn_semseg.py --reader=data/cityscapes/cityscapes_reader.py --dataset=/path/to/cityscapes --weights=/path/to/ldn121_weights_cityscapes_train.pt
Enable multiscale inference with --multiscale-test=1
:
python eval.py --model=models/ldn_semseg.py --reader=data/cityscapes/cityscapes_reader.py --dataset=/path/to/cityscapes --weights=/path/to/ldn121_weights_cityscapes_train.pt --multiscale-test=1
Save color coded segmentations with --save-outputs=1
, the images will be saved in the ./outputs
dir.