Pytorch for Segmentation

Overview

Pytorch for Semantic Segmentation

This repo has been deprecated currently and I will not maintain it. Meanwhile, I strongly recommend you can refer to my new repo: TorchSeg, which offers fast, modular reference implementation and easy training of semantic segmentation algorithms in PyTorch.


A repository contains some exiting networks and some experimental networks for semantic segmentation.

  • ResNet(FCN)
    • ResNet-50
    • ResNet-101
    • Wide-ResNet
  • DUC(Understanding Convolution for Semantic Segmentation)[pdf]
  • GCN(Large Kernel Matters -- Improve Semantic Segmentation by Global Convolutional Network)[pdf]
Comments
  • About GCN

    About GCN

    Hi 师兄 ^_^, I have some questions, some of which may not be related to your code directly. Look forward to your answers.

    1. The GCN paper shows that the larger kernel size of GCN is, the better segmentation result is. I see your default kernel size is 7 (not the largest one 15 in the paper). What is your consideration?
    2. The paper seems not to do ablation experiment on the kernel size setting of GCN in intermediate layers of resnet. In intermediate layers, the size of feature map is larger than 16*16, do you have any idea about the kernel size setting in intermediate layers?
    3. How about combining GCN with dilation?

    Thanks for your sharing of the nice code!

    opened by zijundeng 5
  • weight init

    weight init

    For resnet and other architectures in general, the weight init has to be done separately right? The default init for nn modules of pytorch is uniform? From my understanding, there are better inits like glorot uniform, he init etc which we explicitly need to do. Because other libraries like Keras, Lasagne has the best init as the default, unlike PyTorch.

    References: [1] - ResNet official: https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py#L113-L119 [2] - VGG official: https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py#L46-L59

    [3] - Conv2D nn module: https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/conv.py#L40-L47

    opened by skrish13 3
  • Status Check

    Status Check

    Hi @ycszen

    Thank you for the repo! I was wondering what is the status of the repo - were you able to test the models and see if implementation accuracy matches Arxiv papers?

    There is an official implementation of DenseNet now, which can be used to write DenseNet-FCN.
    https://github.com/pytorch/vision/tree/master/torchvision/models

    Thanks!

    opened by FuriouslyCurious 1
  • The output shape is not correct

    The output shape is not correct

    When I test picture from VOC2017,I get the wrong message :1234: Ucat Traceback (most recent call last): File "tester.py", line 46, in output = Colorize()(output) File "/home/xiangjie/Documents/master_thesis/segmentation/pytorch-seg/transform.py", line 150, in call color_image[0][mask] = self.cmap[label][0] RuntimeError: inconsistent tensor size, expected tensor [256 x 256] and mask [256] to have the same number of elements, but got 65536 and 256 elements respectively at /pytorch/torch/lib/TH/generic/THTensorMath.c:138

    I try to fix it.But did not work ,so ,someone can tell me how to fix this bug???? Thank you!!!!

    opened by Paranoidv 0
  • About upsample.py

    About upsample.py

    In the code of upsample.py, you create FCN structure. But, the structure of your implementation seems to be slightly different from original FCN. Do you have any reference paper of your code ?

    Thanks !

    opened by ksaito-ut 0
  • gcn problem

    gcn problem


    TypeError Traceback (most recent call last) in () 1 if torch.cuda.is_available(): 2 #model = torch.nn.DataParallel(FCN(22)) ----> 3 model=FCN(22) 4 model.cuda()

    in init(self, num_classes) 81 self.refine10 = Refine(self.num_classes) 82 ---> 83 self.out0 = self._classifier(2048) 84 self.out1 = self._classifier(1024) 85 self.out2 = self._classifier(512)

    in _classifier(self, inplanes) 95 96 nn.Conv2d(inplanes, inplanes, 3, padding=1, bias=False), ---> 97 nn.BatchNorm2d(inplanes/2), 98 nn.ReLU(inplace=True), 99 nn.Dropout(.1),

    /home/omnisky/anaconda3/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py in init(self, num_features, eps, momentum, affine) 16 self.momentum = momentum 17 if self.affine: ---> 18 self.weight = Parameter(torch.Tensor(num_features)) 19 self.bias = Parameter(torch.Tensor(num_features)) 20 else:

    TypeError: torch.FloatTensor constructor received an invalid combination of arguments - got (float), but expected one of:

    • no arguments
    • (int ...) didn't match because some of the arguments have invalid types: (float)
    • (torch.FloatTensor viewed_tensor) didn't match because some of the arguments have invalid types: (float)
    • (torch.Size size) didn't match because some of the arguments have invalid types: (float)
    • (torch.FloatStorage data) didn't match because some of the arguments have invalid types: (float)
    • (Sequence data) didn't match because some of the arguments have invalid types: (float)
    opened by foxet 0
  • perfomance_result

    perfomance_result

    Hi @ycszen , thanks for sharing the nice codes. I have a question about the performance on cityscape of the models, such as DUC, fcn, etc. Could you please tell me your performance result?

    opened by liu666666 4
Owner
ycszen
ycszen
Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP

Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP Abstract: We introduce a method that allows to automatically se

Daniil Pakhomov 134 Dec 19, 2022
nnFormer: Interleaved Transformer for Volumetric Segmentation Code for paper "nnFormer: Interleaved Transformer for Volumetric Segmentation "

nnFormer: Interleaved Transformer for Volumetric Segmentation Code for paper "nnFormer: Interleaved Transformer for Volumetric Segmentation ". Please

jsguo 610 Dec 28, 2022
Realtime segmentation with ENet, the fast and accurate segmentation net.

Enet This is a realtime segmentation net with almost 22 fps on GTX1080 ti, and the model size is very small with only 28M. This repo contains the infe

JinTian 14 Aug 30, 2022
Mae segmentation - Reproduction of semantic segmentation using masked autoencoder (mae)

ADE20k Semantic segmentation with MAE Getting started Install the mmsegmentation

null 97 Dec 17, 2022
Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation

Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation. Generally, MAS methods register multiple atlases, i.e., medical images with corresponding labels, to a target image;

NanYoMy 13 Oct 9, 2022
This repository is an unoffical PyTorch implementation of Medical segmentation in 3D and 2D.

Pytorch Medical Segmentation Read Chinese Introduction:Here! Recent Updates 2021.1.8 The train and test codes are released. 2021.2.6 A bug in dice was

EasyCV-Ellis 618 Dec 27, 2022
Pytorch Code for "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation"

Medical-Transformer Pytorch Code for the paper "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation" About this repo: This repo

Jeya Maria Jose 615 Dec 25, 2022
Official PyTorch Implementation of Hypercorrelation Squeeze for Few-Shot Segmentation, arXiv 2021

Hypercorrelation Squeeze for Few-Shot Segmentation This is the implementation of the paper "Hypercorrelation Squeeze for Few-Shot Segmentation" by Juh

Juhong Min 165 Dec 28, 2022
Implementation of DropLoss for Long-Tail Instance Segmentation in Pytorch

[AAAI 2021]DropLoss for Long-Tail Instance Segmentation [AAAI 2021] DropLoss for Long-Tail Instance Segmentation Ting-I Hsieh*, Esther Robb*, Hwann-Tz

Tim 37 Dec 2, 2022
PyTorch for Semantic Segmentation

PyTorch for Semantic Segmentation This repository contains some models for semantic segmentation and the pipeline of training and testing models, impl

Zijun Deng 1.7k Jan 6, 2023
Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.

Faster R-CNN and Mask R-CNN in PyTorch 1.0 maskrcnn-benchmark has been deprecated. Please see detectron2, which includes implementations for all model

Facebook Research 9k Jan 4, 2023
A semantic segmentation toolbox based on PyTorch

Introduction vedaseg is an open source semantic segmentation toolbox based on PyTorch. Features Modular Design We decompose the semantic segmentation

null 407 Dec 15, 2022
HyperSeg: Patch-wise Hypernetwork for Real-time Semantic Segmentation Official PyTorch Implementation

: We present a novel, real-time, semantic segmentation network in which the encoder both encodes and generates the parameters (weights) of the decoder. Furthermore, to allow maximal adaptivity, the weights at each decoder block vary spatially. For this purpose, we design a new type of hypernetwork, composed of a nested U-Net for drawing higher level context features

Yuval Nirkin 182 Dec 14, 2022
Pytorch Implementation of LNSNet for Superpixel Segmentation

LNSNet Overview Official implementation of Learning the Superpixel in a Non-iterative and Lifelong Manner (CVPR'21) Learning Strategy The proposed LNS

null 42 Oct 11, 2022
PyTorch code for the paper "FIERY: Future Instance Segmentation in Bird's-Eye view from Surround Monocular Cameras"

FIERY This is the PyTorch implementation for inference and training of the future prediction bird's-eye view network as described in: FIERY: Future In

Wayve 406 Dec 24, 2022
Pytorch codes for "Self-supervised Multi-view Stereo via Effective Co-Segmentation and Data-Augmentation"

Self-Supervised-MVS This repository is the official PyTorch implementation of our AAAI 2021 paper: "Self-supervised Multi-view Stereo via Effective Co

hongbin_xu 127 Jan 4, 2023
PyTorch implementation of: Michieli U. and Zanuttigh P., "Continual Semantic Segmentation via Repulsion-Attraction of Sparse and Disentangled Latent Representations", CVPR 2021.

Continual Semantic Segmentation via Repulsion-Attraction of Sparse and Disentangled Latent Representations This is the official PyTorch implementation

Multimedia Technology and Telecommunication Lab 42 Nov 9, 2022
This is the official Pytorch implementation of "Lung Segmentation from Chest X-rays using Variational Data Imputation", Raghavendra Selvan et al. 2020

README This is the official Pytorch implementation of "Lung Segmentation from Chest X-rays using Variational Data Imputation", Raghavendra Selvan et a

Raghav 42 Dec 15, 2022
Implementation of Segformer, Attention + MLP neural network for segmentation, in Pytorch

Segformer - Pytorch Implementation of Segformer, Attention + MLP neural network for segmentation, in Pytorch. Install $ pip install segformer-pytorch

Phil Wang 208 Dec 25, 2022