All Projects → fregu856 → Segmentation

fregu856 / Segmentation

Licence: mit
TensorFlow implementation of ENet, trained on the Cityscapes dataset.

Programming Languages

139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Segmentation

VPGNet: Vanishing Point Guided Network for Lane and Road Marking Detection and Recognition (ICCV 2017)
Stars: ✭ 382 (+57.2%)
Mutual labels:  autonomous-driving, semantic-segmentation
Baidu Lane Segmentation
4th place solution in Baidu Autonomous Driving Lane Segmentation
Stars: ✭ 19 (-92.18%)
Mutual labels:  autonomous-driving, semantic-segmentation
An opensource lib. for vehicle vision applications (written by MATLAB), lane marking detection, road segmentation
Stars: ✭ 120 (-50.62%)
Mutual labels:  autonomous-driving, semantic-segmentation
rail marking
proof-of-concept program that detects rail-track with semantic segmentation for autonomous train system
Stars: ✭ 21 (-91.36%)
Mutual labels:  autonomous-driving, semantic-segmentation
PyTorch implementation of DeepLabV3, trained on the Cityscapes dataset.
Stars: ✭ 511 (+110.29%)
Mutual labels:  autonomous-driving, semantic-segmentation
Keras Icnet
Keras implementation of Real-Time Semantic Segmentation on High-Resolution Images
Stars: ✭ 85 (-65.02%)
Mutual labels:  autonomous-driving, semantic-segmentation
Self Driving Golf Cart
Be Driven 🚘
Stars: ✭ 147 (-39.51%)
Mutual labels:  autonomous-driving, semantic-segmentation
Unofficial PyTorch implementation of "RTM3D: Real-time Monocular 3D Detection from Object Keypoints for Autonomous Driving" (ECCV 2020)
Stars: ✭ 211 (-13.17%)
Mutual labels:  autonomous-driving
Rank 1st in the leaderboard of SemanticKITTI semantic segmentation (both single-scan and multi-scan) (Nov. 2020) (CVPR2021 Oral)
Stars: ✭ 221 (-9.05%)
Mutual labels:  semantic-segmentation
Cagnet Zero Shot Semantic Segmentation
Code for our ACMMM2020 paper "Context-aware Feature Generation for Zero-shot Semantic Segmentation".
Stars: ✭ 208 (-14.4%)
Mutual labels:  semantic-segmentation
Semantic Segmentation Suite
Semantic Segmentation Suite in TensorFlow. Implement, train, and test new Semantic Segmentation models easily!
Stars: ✭ 2,395 (+885.6%)
Mutual labels:  semantic-segmentation
Unsupervised Intra-domain Adaptation for Semantic Segmentation through Self-Supervision (CVPR 2020 Oral)
Stars: ✭ 211 (-13.17%)
Mutual labels:  semantic-segmentation
Deep Learning In Production
Develop production ready deep learning code, deploy it and scale it
Stars: ✭ 216 (-11.11%)
Mutual labels:  semantic-segmentation
Stars: ✭ 207 (-14.81%)
Mutual labels:  semantic-segmentation
Intensity Scan Context based full SLAM implementation for autonomous driving. ICRA 2020
Stars: ✭ 232 (-4.53%)
Mutual labels:  autonomous-driving
Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR 2018).
Stars: ✭ 206 (-15.23%)
Mutual labels:  semantic-segmentation
Adaptive affinity fields
Adaptive Affinity Fields for Semantic Segmentation
Stars: ✭ 240 (-1.23%)
Mutual labels:  semantic-segmentation
Implementation of Our ECCV2020-work: Improving Semantic Segmentation via Decoupled Body and Edge Supervision
Stars: ✭ 232 (-4.53%)
Mutual labels:  semantic-segmentation
Smoothly Blend Image Patches
Using a U-Net for image segmentation, blending predicted patches smoothly is a must to please the human eye.
Stars: ✭ 218 (-10.29%)
Mutual labels:  semantic-segmentation
Tensorflow Deeplab Lfov
DeepLab-LargeFOV implemented in tensorflow
Stars: ✭ 218 (-10.29%)
Mutual labels:  semantic-segmentation


TensorFlow implementation of ENet ( based on the official Torch implementation ( and the Keras implementation by PavlosMelissinos (, trained on the Cityscapes dataset (

  • Youtube video of results (

  • demo video with results

  • The results in the video can obviously be improved, but because of limited computing resources (personally funded Azure VM) I did not perform any further hyperparameter tuning.

You might get the error "No gradient defined for operation 'MaxPoolWithArgmax_1' (op type: MaxPoolWithArgmax)". To fix this, I had to add the following code to the file /usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/

def _MaxPoolGradWithArgmax(op, grad, unused_argmax_grad):  
  return gen_nn_ops._max_pool_grad_with_argmax(op.inputs[0], grad, op.outputs[1], op.get_attr("ksize"), op.get_attr("strides"), padding=op.get_attr("padding"))  


  • ASSUMES: that all Cityscapes training (validation) image directories have been placed in data_dir/cityscapes/leftImg8bit/train (data_dir/cityscapes/leftImg8bit/val) and that all corresponding ground truth directories have been placed in data_dir/cityscapes/gtFine/train (data_dir/cityscapes/gtFine/val).
  • DOES: script for performing all necessary preprocessing of images and labels.

  • ASSUMES: that has already been run.
  • DOES: contains the ENet_model class.

  • ASSUMES: -
  • DOES: contains a number of functions used in different parts of the project.

  • ASSUMES: that has already been run.
  • DOES: script for training the model.

  • ASSUMES: that has already been run.
  • DOES: runs a model checkpoint (set in line 56) on all frames in a Cityscapes demo sequence directory (set in line 30) and creates a video of the result.

Training details:

  • In the paper the authors suggest that you first pretrain the encoder to categorize downsampled regions of the input images, I did however train the entire network from scratch.

  • Batch size: 4.

  • For all other hyperparameters I used the same values as in the paper.

  • Training loss:

  • training loss

  • Validation loss:

  • validation loss

  • The results in the video above was obtained with the model at epoch 23, for which a checkpoint is included in segmentation/training_logs/best_model in the repo.

Training on Microsoft Azure:

To train the model, I used an NC6 virtual machine on Microsoft Azure. Below I have listed what I needed to do in order to get started, and some things I found useful. For reference, my username was 'fregu856':



NV_GPU="$GPUIDS" nvidia-docker run -it --rm \
        -p 5584:5584 \
        --name "$NAME""$GPUIDS" \
        -v /home/fregu856:/root/ \
        tensorflow/tensorflow:latest-gpu bash
  • /root/ will now be mapped to /home/fregu856 (i.e., $ cd -- takes you to the regular home folder).

  • To start the image:

    • $ sudo sh
  • To commit changes to the image:

    • Open a new terminal window.
    • $ sudo docker commit fregu856_GPU0 tensorflow/tensorflow:latest-gpu
  • To stop the image when it’s running:

    • $ sudo docker stop fregu856_GPU0
  • To exit the image without killing running code:

    • Ctrl-P + Q
  • To get back into a running image:

    • $ sudo docker attach fregu856_GPU0
  • To open more than one terminal window at the same time:

    • $ sudo docker exec -it fregu856_GPU0 bash
  • To install the needed software inside the docker image:

    • $ apt-get update
    • $ apt-get install nano
    • $ apt-get install sudo
    • $ apt-get install wget
    • $ sudo apt-get install libopencv-dev python-opencv
    • Commit changes to the image (otherwise, the installed packages will be removed at exit!)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].