Pytorch Implementation of Deep Dual-resolution Networks DDRNet for Real-time and Accurate Semantic Segmentation
This project aims at providing a concise, simple, easy-to-use reference implementation for DDRNet semantic segmentation models on Cityscapes using PyTorch.
# python dependencies can be installed by running
pip install -r requirements.txt
# follow PyTorch installation in https://pytorch.org/get-started/locally/
# for CUDA 10.0 with anaconda
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
The Official implementation provides pretrained models which reproduces the results mentioned in the paper. Please refer to their documentation on how to use their pretrained models. This repository focuses on training DDRNet models locally. Right now, it uses single gpu to train the models but multi-gpu support will be added very soon.
This project uses Cityscapes as the training data for DDRNet models. It requires Cityscapes dataset to be downloaded and stored in the following hierarchical order.
.{DATA_ROOT}
├── leftImg8bit
│ ├── test
│ ├── train
│ └── val
├── gtFine
│ ├── test
│ ├── train
│ └── val
- Single GPU training
# for example, train DDRNet_23:
python train.py --model ddrnet_23 --lr 0.001 --epochs 50 --data-path=/path/to/dataset/root
- Multi-GPU training
Coming Soon!
- Single GPU evaluating
# for example, evaluate DDRNet_23
python eval.py --model ddrnet_23 --data-path=/path/to/dataset/root
- Multi-GPU evaluating
Coming Soon!
.{SEG_ROOT}
├── models
| ├── DDRNet_23_slim.py
| ├── DDRNet_23.py
│ ├── DDRNet_39.py
The models have been trained with a single GeForce RTX 2070 Super gpu
. The results from the original paper can be reproduced by following their specific training settings. It was not possible to follow the authors provided training settings because of resource constraints. However, the results achieved using the following settings-
Models | EvalSet | crops_size | initial lr | batch_size | epochs | MIoU |
---|---|---|---|---|---|---|
DDRNet_23 | val | 1024 | 0.003 | 5 | 250 | 77.382 |
DDRNet_23_slim | val | -- | -- | -- | -- | -- |
DDRNet_39 | val | -- | -- | -- | -- | -- |
- add multi-gpu support
- add tensorboard logging
- make syncbn dynamic