Wuyang Chen, Xinyu Gong, Xianming Liu, Qian Zhang, Yuan Li, Zhangyang Wang
In ICLR 2020.
Our predictions on Cityscapes Stuttgart demo video #0
We present FasterSeg, an automatically designed semantic segmentation network with not only state-of-the-art performance but also faster speed than current methods.
Highlights:
This repository has been tested on GTX 1080Ti. Configurations (e.g batch size, image patch size) may need to be changed on different platforms.
git clone https://github.com/chenwydj/FasterSeg.git
cd FasterSeg
pip install -r requirements.txt
C.dataset_path
in the config
files mentioned below.cd search
We first pretrain the supernet without updating the architecture parameter for 20 epochs.
C.pretrain = True
in config_search.py
.CUDA_VISIBLE_DEVICES=0 python train_search.py
FasterSeg/search/search-pretrain-256x512_F12.L16_batch3-20200101-012345
.We start the architecture searching for 30 epochs.
C.pretrain = "search-pretrain-256x512_F12.L16_batch3-20200101-012345"
in config_search.py
.CUDA_VISIBLE_DEVICES=0 python train_search.py
FasterSeg/search/search-224x448_F12.L16_batch2-20200102-123456
.arch_0
and arch_1
contains architectures for teacher and student networks, respectively.cd FasterSeg/train
FasterSeg/train/
or create a symlink via ln -s ../search/search-224x448_F12.L16_batch2-20200102-123456 ./
C.mode = "teacher"
in config_train.py
.
C.load_path = "search-224x448_F12.L16_batch2-20200102-123456"
in config_train.py
. This folder contains arch_0.pt
and arch_1.pth
for teacher and student's architectures.CUDA_VISIBLE_DEVICES=0 python train.py
train-512x1024_teacher_batch12-20200103-234501
C.mode = "student"
in config_train.py
.
C.load_path = "search-224x448_F12.L16_batch2-20200102-123456"
in config_train.py
. This folder contains arch_0.pt
and arch_1.pth
for teacher and student's architectures.C.teacher_path = "train-512x1024_teacher_batch12-20200103-234501"
in config_train.py
. This folder contains the weights0.pt
which is teacher's pretrained weights.CUDA_VISIBLE_DEVICES=0 python train.py
Here we use our pretrained FasterSeg as an example for the evaluation.
cd train
C.is_eval = True
in config_train.py
.C.load_path = "fasterseg"
in config_train.py
.train/fasterseg
.
CUDA_VISIBLE_DEVICES=0 python train.py
C.mode
in config_train.py
.
We support generating prediction files (masks as images) during training.
C.is_test = True
in config_train.py
.train-512x1024_student_batch12-20200104-012345/test_1_#epoch
.CUDA_VISIBLE_DEVICES=0 python run_latency.py
cd FasterSeg/latency
CUDA_VISIBLE_DEVICES=0 python latency_lookup_table.py
which will generate an .npy
file. Be careful not to overwrite the provided latency_lookup_table.npy
in this repo.
.npy
contains a python dictionary mapping from an operator to its latency (in ms) under specific conditions (input size, stride, channel number etc.)@inproceedings{chen2020fasterseg,
title={FasterSeg: Searching for Faster Real-time Semantic Segmentation},
author={Chen, Wuyang and Gong, Xinyu and Liu, Xianming and Zhang, Qian and Li, Yuan and Wang, Zhangyang},
booktitle={International Conference on Learning Representations},
year={2020}
}