Coder Social home page Coder Social logo

peterzs / dupsampling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haochange/dupsampling

0.0 0.0 0.0 9.26 MB

This repo is an unofficial pytorch implementation of CVPR2019 paper: Decoders Matter for Semantic Segmentation: Data-Dependent Decoding Enables Flexible Feature Aggregation

Python 84.49% Shell 0.46% Cuda 7.98% C 1.68% C++ 5.40%

dupsampling's Introduction

DUpsampling

This repo is an unofficial pytorch implementation of CVPR19 paper: Decoders Matter for Semantic Segmentation: Data-Dependent Decoding Enables Flexible Feature Aggregation: https://arxiv.org/abs/1903.02120

Most recurrent update:

2019.03.14 - Add Synchronous BN operation and gradient accumulate to save gpu memory.

2019.03.13 - Add Weight pre-compute process.

2019.03.12 - Add softmax with temperature.

Installation

  • pytorch==0.4.1
  • python==3.5
  • numpy
  • torchvision
  • matplotlib
  • opencv-python
  • dominate
  • random
  • collections
  • shutil

Dataset and pretrained model

Plesae download VOC12_aug dataset and unzip the dataset into data folder.

Please download imagenet pretrained resnet50-imagenet.pth, and put it into checkpoints folder.

Please modify your configuration in options/base options.py.

Usage

if you want to use the model with normal batch norm operation:

python train.py \
--name dunet \
--gpu_ids 0,1 \
--model DUNet \
--pretrained_model ./checkpoints/resnet50-imagenet.pth \
--batchSize 16 \
--dataroot ./data/voc_12aug \
--train_list_path ./data/train_aug.txt \
--val_list_path ./data/val.txt \
--accum_steps 1 \
--nepochs 100 \
--tf_log --verbose

if you want to use Synchronous BN operation with CUDA implementation, which must be compiled with the following commands:

cd libs
sh build.sh
python build.py

The build.sh script assumes that the nvcc compiler is available in the current system search path. The CUDA kernels are compiled for sm_50, sm_52 and sm_61 by default. To change this (e.g. if you are using a Kepler GPU), please edit the CUDA_GENCODE variable in build.sh.

Run the following command to run:

python train.py \
--name dunet_sybn \
--gpu_ids 0,1 \
--model DUNet_sybn \
--pretrained_model ./checkpoints/resnet50-imagenet.pth \
--batchSize 16 \
--dataroot ./data/voc_12aug \
--train_list_path ./data/train_aug.txt \
--val_list_path ./data/val.txt \
--accum_steps 1 \
--nepochs 100 \
--tf_log --verbose

Segmentation results on val set

To do

  • Add softmax function with temperature

  • Modify the network and improve the accuracy.

  • Add Synchronous BN.

  • Debug and report the performance.

  • Improve code style and show more details.

under construction...

If you have any question, feel free to contact me or submit issue.

Thanks to the Third Party Libs

inplace_abn - Pytorch-Deeplab - PyTorch-Encoding- pix2pix- Pytorch-segmentation-toolbox

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.