mirror of
https://github.com/wassname/PSPNet-Keras-tensorflow.git
synced 2026-09-09 11:15:19 +08:00
Added to readme and fixed bugs
This commit is contained in:
@@ -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
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Pycaffe result
|
||||

|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user