manutdzou / PSPNet-tensorflow

An implementation of PSPNet in tensorflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PSPNet_tensorflow

Introduction

This is an implementation of PSPNet in TensorFlow for semantic segmentation on the cityscapes dataset. We first convert weight from Original Code by using caffe-tensorflow framework.

Update:

2017/11/06:

Support different input size by padding input image to (720, 720) if original size is smaller than it, and get result by cropping image in the end.

2017/10/27:

Change bn layer from tf.nn.batch_normalization into tf.layers.batch_normalization in order to support training phase. Also update initial model in Google Drive.

Install

Get restore checkpoint from Google Drive and put into model directory.

Inference

To get result on your own images, use the following command:

python inference.py --img-path=./input/test.png

Inference time: ~0.6s

Evaluation

Perform in single-scaled model on the cityscapes validation datase.

Method Accuracy
Without flip 76.99%
Flip 77.23%

To get evaluation result, you need to download Cityscape dataset from Official website first. Then change DATA_DIRECTORY to your dataset path in evaluate.py:

DATA_DIRECTORY = /Path/to/dataset

Then run the following command:

python evaluate.py

List of Args:

--flipped-eval  - Using flipped evaluation method
--measure-time  - Calculate inference time

Image Result

Input image Output image

About

An implementation of PSPNet in tensorflow


Languages

Language:Python 100.0%