YukangWang / IFVD

Intra-class Feature Variation Distillation for Semantic Segmentation (ECCV 2020)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intra-class Feature Variation Distillation for Semantic Segmentation

Introduction

This repository contains the PyTorch implementation of:

Intra-class Feature Variation Distillation for Semantic Segmentation, ECCV 2020 [Paper]

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

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

Usage

1. Trainning with evaluation

python train.py --data-dir /path/to/cityscapes --save-name /path/to/save --gpu /device/id

2. Inference with evaluation

python val.py --data-dir /path/to/cityscapes --restore-from /path/to/pth --gpu /device/id

3. Inference only

python test.py --data-dir /path/to/cityscapes --restore-from /path/to/pth --gpu /device/id

Citation

Please consider citing this work if it helps your research:


@inproceedings{wang2020ifvd,
  title={Intra-class Feature Variation Distillation for Semantic Segmentation},
  author={Wang, Yukang and Zhou, Wei and Jiang, Tao and Bai, Xiang and Xu, Yongchao},
  booktitle={Proceedings of the European Conference on Computer Vision},
  year={2020}
}

Acknowledgment

This codebase is heavily borrowed from pytorch-segmentation-toolbox and structure_knowledge_distillation. Thanks for their excellent works.

About

Intra-class Feature Variation Distillation for Semantic Segmentation (ECCV 2020)

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 78.4%Language:Cuda 11.3%Language:C++ 7.6%Language:C 2.4%Language:Shell 0.3%