Added to readme and fixed bugs

This commit is contained in:
Jeffrey Hu
2017-08-08 15:30:44 -04:00
parent 61cc8492b6
commit 820395bd6a
4 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -6,7 +6,7 @@ Converted trained weights needed to run the network.
Download converted weights here:
[link:pspnet50_ade20k.npy](https://www.dropbox.com/s/2ksp9hvokzk6qc8/pspnet50_ade20k.npy?dl=0)
[link:pspnet50_ade20k.npy](https://www.dropbox.com/s/ms8afun494dlh1t/pspnet50_ade20k.npy?dl=0)
And place in directory with pspnet50_ade20k.npy
@@ -24,6 +24,8 @@ Was repaired some issues. But the result is not as well as expected compared to
![Original](test.jpg)
![Processed](test_seg.jpg)
![Alpha mixed](test_seg_blended.jpg)
![New](out.jpg)
![New](probs.jpg)
## Pycaffe result
![Pycaffe results](test_pycaffe.jpg)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

+3 -3
View File
@@ -1,7 +1,7 @@
import os
import argparse
import numpy as np
from scipy import misc
from scipy import misc, ndimage
from keras import backend as K
import tensorflow as tf
@@ -26,7 +26,7 @@ class PSPNet:
h_ori,w_ori = img.shape[:2]
# Preprocess
img = img.resize((473,473))
img = misc.imresize(img, (473, 473))
img = img - DATA_MEAN
img = img[:,:,::-1] # RGB => BGR
img = img.astype('float32')
@@ -43,7 +43,7 @@ class PSPNet:
assert data.shape == (473,473,3)
data = data[np.newaxis,:,:,:]
utils.debug(self.model, data)
# utils.debug(self.model, data)
pred = self.model.predict(data)
return pred[0]