Home

Awesome

AdapNet: Adaptive Semantic Segmentation in Adverse Environmental Conditions

AdapNet is a deep learning model for semantic image segmentation, where the goal is to assign semantic labels (e.g., car, road, tree and so on) to every pixel in the input image. AdapNet is easily trainable on a single GPU with 12 GB of memory and has a fast inference time. AdapNet is benchmarked on Cityscapes, Synthia, ScanNet, SUN RGB-D and Freiburg Forest datasets.

This repository contains our TensorFlow implementation of AdapNet which allows you to train your own model on any dataset and evaluate the results in terms of the mean IoU metric.

Adapnet can further be used with the CMoDE fusion scheme for multimodal semantic segmentation.

If you find the code useful for your research, please consider citing our paper:

@inproceedings{valada2017icra,
  author = {Valada, Abhinav and Vertens, Johan and Dhall, Ankit and Burgard, Wolfram},
  title = {AdapNet: Adaptive Semantic Segmentation in Adverse Environmental Conditions},
  booktitle = {Proceedings of the IEEE International Conference on Robotics and Automation (ICRA)},
  pages={4644--4651},
  year = {2017},
  organization={IEEE}
}

Live Demo

http://deepscene.cs.uni-freiburg.de

Example Segmentation Results

DatasetRGB_ImageSegmented_Image
Cityscapes<img src="images/city.png" width=300><img src="images/city_v1.png" width=300>
Forest<img src="images/forest.png" width=300><img src="images/forest_v1.png" width=300>
Sun RGB-D<img src="images/sun.png" width=300><img src="images/sun_p.png" width=300>
Synthia<img src="images/synthia.png" width=300><img src="images/synthia_v1.png" width=300>
ScanNet v2<img src="images/scannet.png" width=300><img src="images/scannet_pr.png" width=300>

Contacts

System Requirements

Programming Language

Python 2.7

Python Packages

tensorflow-gpu 1.4.0

Configure the Network

Download the resnet_v1_50 tensorflow pre-trained model for network intialization from here.

Data

Training Params

    gpu_id: id of gpu to be used
    model: name of the model
    num_classes: number of classes
    intialize:  path to pre-trained model
    checkpoint: path to save model
    train_data: path to dataset .tfrecords
    batch_size: training batch size
    skip_step: how many steps to print loss 
    height: height of input image
    width: width of input image
    max_iteration: how many iterations to train
    learning_rate: initial learning rate
    save_step: how many steps to save the model
    power: parameter for poly learning rate
    mean: path to mean file 

Evaluation Params

    gpu_id: id of gpu to be used
    model: name of the model
    num_classes: number of classes
    checkpoint: path to saved model
    test_data: path to dataset .tfrecords
    batch_size: evaluation batch size
    skip_step: how many steps to print mIoU
    height: height of input image
    width: width of input image
    mean: path to mean file 

Training and Evaluation

Training Procedure

Edit the config file for training in config folder. Run:

python train.py -c config cityscapes_train.config or python train.py --config cityscapes_train.config

Evaluation Procedure

Select a checkpoint to test/validate your model in terms of the mean IoU metric. Edit the config file for evaluation in config folder. Run:

python evaluate.py -c config cityscapes_test.config or python evaluate.py --config cityscapes_test.config

Additional Notes:

License

For academic usage, the code is released under the GPLv3 license. For any commercial purpose, please contact the authors.