Git Product home page Git Product logo

gatedscnn's Introduction

Gated-SCNN

A PyTorch implementation of Gated-SCNN based on ICCV 2019 paper Gated-SCNN: Gated Shape CNNs for Semantic Segmentation.

Network Architecture image from the paper

Requirements

conda install pytorch torchvision cudatoolkit=11.0 -c pytorch
  • timm
pip install timm
  • opencv
pip install opencv-python
  • cityscapesScripts
pip install cityscapesscripts

Usage

Train model

python train.py --epochs 175 --backbone_type resnet101
optional arguments:
--data_path                   Data path for cityscapes dataset [default value is 'data']
--backbone_type               Backbone type [default value is 'resnet50'](choices=['resnet50', 'resnet101'])
--crop_h                      Crop height for training images [default value is 512]
--crop_w                      Crop width for training images [default value is 512]
--batch_size                  Number of data for each batch to train [default value is 4]
--epochs                      Number of sweeps over the dataset to train [default value is 60]
--save_path                   Save path for results [default value is 'results']

Eval model

python viewer.py --model_weight resnet101_800_800_model.pth
optional arguments:
--data_path                   Data path for cityscapes dataset [default value is 'data']
--model_weight                Pretrained model weight [default value is 'results/resnet50_512_512_model.pth']
--input_pic                   Path to the input picture [default value is 'test/berlin/berlin_000000_000019_leftImg8bit.png']

Results

The experiment is conducted on one NVIDIA TITAN RTX (24G) GPU, and there are some difference between this implementation and official implementation:

  1. res2/res3/res4 are used in GCLs;
  2. The non-differentiable part of dual task loss is not implemented;
  3. The model is trained for 60 epochs with batch_size 4 on 512x512 images.
BackBone PAval mPAval Class mIOUval Category mIOUval Class mIOUtest Category mIOUtest FPS Download
ResNet50 92.6 62.4 53.1 82.3 53.5 83.3 2 dsjb

The left is the input image, the middle is ground truth segmentation, and the right is model's predicted segmentation.

ResNet50

munster_000105_000019

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.