diff --git a/README.md b/README.md index 57760da..7b44f28 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/out.jpg b/out.jpg new file mode 100644 index 0000000..14c2689 Binary files /dev/null and b/out.jpg differ diff --git a/probs.jpg b/probs.jpg new file mode 100644 index 0000000..9bc9563 Binary files /dev/null and b/probs.jpg differ diff --git a/pspnet.py b/pspnet.py index ef000d7..fa42f64 100644 --- a/pspnet.py +++ b/pspnet.py @@ -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]