Skip to content

n0lean/PSPNet-Keras-tensorflow

 
 

Repository files navigation

Keras implementation of PSPNet(caffe)

Implemented Architecture of Pyramid Scene Parsing Network in Keras.

Converted trained weights are needed to run the network.

Weights of the original caffemodel can be converted with weight_converter.py as follows:

python weight_converter.py <path to .prototxt> <path to .caffemodel>

Running this needs the compiled original PSPNet caffe code and pycaffe. Already converted weights can be downloaded here:

pspnet50_ade20k.npy pspnet101_cityscapes.npy pspnet101_voc2012.npy

npy weights should be placed in the directory weights/npy.

The interpolation layer is implemented as custom layer "Interp"

Important

Results Keras: Original New New New

Original New New New

Original New New New

Pycaffe result

Pycaffe results

Dependencies:

  1. Tensorflow
  2. Keras
  3. numpy
  4. pycaffe(PSPNet)(optional for converting the weights)

Usage:

python pspnet.py
python pspnet.py -m pspnet101_cityscapes -i example_images/cityscapes.png -o example_results/cityscapes.jpg
python pspnet.py -m pspnet101_voc2012 -i example_images/pascal_voc.jpg -o example_results/pascal_voc.jpg

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%