Skip to content

Easy to use pytorch-implementation of DDRNet on Cityscapes dataset

License

Notifications You must be signed in to change notification settings

pyradd/DDRNet-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorch Implementation of Deep Dual-resolution Networks DDRNet for Real-time and Accurate Semantic Segmentation

python-image pytorch-image lic-image

This project aims at providing a concise, simple, easy-to-use reference implementation for DDRNet semantic segmentation models on Cityscapes using PyTorch.

Installation

# 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

Usage

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.

Dataset

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

Train


  • 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!

Evaluation


  • 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!

Support

Model

.{SEG_ROOT}
├── models
|   ├── DDRNet_23_slim.py
|   ├── DDRNet_23.py
│   ├── DDRNet_39.py

Result

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 -- -- -- -- --

To Do

  • add multi-gpu support
  • add tensorboard logging
  • make syncbn dynamic

References