GithubHelp home page GithubHelp logo

mahlermozart / cwd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drilistbox/cwd

0.0 1.0 0.0 464 KB

Channel-wise Distillation for Semantic Segmentation

License: BSD 2-Clause "Simplified" License

Python 69.08% Shell 1.65% Cuda 15.51% C 3.27% C++ 10.50%

cwd's Introduction

Channel-wise Distillation for Semantic Segmentation

Introduction

This repository contains the PyTorch test implementation of: Channel-wise Distillation for Semantic Segmentation

Requirements

All the codes are tested in the following environment:

  • Linux (tested on Ubuntu 16.04 / CentOS 7.6)
  • Python 3.6.2
  • PyTorch 0.4.1
  • Single TITAN Xp GPU

Installation

  • Install PyTorch: conda install pytorch=0.4.1 cuda90 torchvision -c pytorch
  • Install other dependences: pip install opencv-python scipy
  • Install InPlace-ABN:
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.

Dataset & Models

  • Dataset: [Cityscapes]

  • After distillation: PSPNet (ResNet-18) rn18-cityscape_singleAndWhole_val-75.05_test-73.86.pth [Google Drive] rn18-cityscape_singleAndWhole_val-75.90_test-74.58.pth [Google Drive]

Please create a new folder ckpt and move all downloaded models to it.

Usage

1. Inference with the evaluation dataset

python valandtest.py --data-dir path/to/CITYSCAPES/data/cityscapes  --restore-from ckpt/new_rn18-cityscape_singleAndWhole_val-75.02_test-73.86.pth --gpu 0 --type val  --figsavepath 75.02val

python valandtest.py --data-dir path/to/CITYSCAPES/data/cityscapes  --restore-from ckpt/new_rn18-cityscape_singleAndWhole_val-75.90_test-74.58.pth --gpu 0 --type val  --figsavepath 75.90val

2. Inference on the test dataset

python valandtest.py --data-dir path/to/CITYSCAPES/data/cityscapes  --restore-from ckpt/new_rn18-cityscape_singleAndWhole_val-75.02_test-73.86.pth --gpu 0 --type test --figsavepath 73.86test

python valandtest.py --data-dir path/to/CITYSCAPES/data/cityscapes  --restore-from ckpt/new_rn18-cityscape_singleAndWhole_val-75.90_test-74.58.pth --gpu 0 --type test --figsavepath 74.58test
Model Average roda sidewalk building wall fence pole trafficlight trafficsign vegetation terrain sky person rider car truck bus train motorcycle bicycle
IoU 73.86 97.84 81.01 91.55 48.63 53.18 61.14 70.21 74.20 92.93 70.91 94.84 83.11 62.39 94.74 54.12 66.80 70.91 61.60 73.27
IoU 74.58 97.78 80.56 91.45 52.78 52.91 59.90 70.50 73.13 92.54 70.70 94.57 82.25 63.51 94.76 59.31 73.68 73.00 61.54 72.12

Citation

Please consider citing this work if it helps your research:


@inproceedings{shu2020cwd,
  title={Channel-wise Distillation for Semantic Segmentation},
  author={Shu, Changyong and Liu, Yifan and Gao, Jianfei and Xu, Lin and Shen, Chunhua},
}

cwd's People

Watchers

 avatar

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.