Semantic Segmentation in PyTorch

Charmve
2 min readOct 29, 2020

--

https://github.com/Charmve/Semantic-Segmentation-PyTorch

This repository contains some models for semantic segmentation and the pipeline of training and testing models, implemented in PyTorch

Models

  1. Vanilla FCN: FCN32, FCN16, FCN8, in the versions of VGG, ResNet and DenseNet respectively (Fully convolutional networks for semantic segmentation)
  2. U-Net (U-net: Convolutional networks for biomedical image segmentation)
  3. SegNet (Segnet: A deep convolutional encoder-decoder architecture for image segmentation)
  4. PSPNet (Pyramid scene parsing network)
  5. GCN (Large Kernel Matters)
  6. DUC, HDC (understanding convolution for semantic segmentation)
  7. Mask-RCNN (paper, code from FAIR, code PyTorch)
models with PyTorch

Dataset

PASCAL VOC 2012

  1. Visit this, download SBD and PASCAL VOC 2012
  2. Extract them, you will get benchmark_RELEASE and VOCdevkit folders.
  3. Add file seg11valid.txt (download) into VOCdevkit/VOC2012/ImageSets/Segmentation
  4. Put the benchmark_RELEASE and VOCdevkit folders in a folder called VOC
  5. Set the path (root) of VOC folder in the last step in voc.py

Cityscapes

  1. Download leftImg8bit_trainvaltest, gtFine_trainvaltest, leftImg8bit_trainextra, and gtCoarse from the cityscapes website
  2. Extract and put them in a folder called cityscapes
  3. Set the path (root) of cityscapes folder in the last step in cityscapes.py

Requirement

  1. PyTorch 0.2.0
  2. TensorBoard for PyTorch. Here to install
  3. Some other libraries (find what you miss when running the code :-P)

Preparation

  1. Go to models directory and set the path of pretrained models in config.py
  2. Go to datasets directory and do following the README

TODO

I’m going to implement The Image Segmentation Paper Top10 Net in PyTorch firstly.

  • DeepLab v3
  • RefineNet
  • ImageNet
  • GoogleNet
  • More dataset (e.g. ADE)

--

--

Charmve
Charmve

Written by Charmve

https://github.com/Charmve Machine learning, semantic segmentation, computer vision

No responses yet