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.
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.
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.
Get restore checkpoint from Google Drive and put into model
directory.
To get result on your own images, use the following command:
python inference.py --img-path=./input/test.png
Inference time: ~0.6s
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
Input image | Output image |
---|---|