diff --git a/photo_smooth.py b/photo_smooth.py index e1d1bd7..f743579 100644 --- a/photo_smooth.py +++ b/photo_smooth.py @@ -35,7 +35,8 @@ def process(self, initImg, contentImg): h = h1 - 4 w = w1 - 4 B = B[int((h1-h)/2):int((h1-h)/2+h),int((w1-w)/2):int((w1-w)/2+w),:] - content = scipy.misc.imresize(content,(h,w)) + # content = scipy.misc.imresize(content,(h,w)) + content = np.array(content.resize((h,w))) B = self.__replication_padding(B,2) content = self.__replication_padding(content,2) content = content.astype(np.float64)/255 @@ -96,4 +97,4 @@ def __replication_padding(self, arr,pad): def __rolling_block(self, A, block=(3, 3)): shape = (A.shape[0] - block[0] + 1, A.shape[1] - block[1] + 1) + block strides = (A.strides[0], A.strides[1]) + A.strides - return as_strided(A, shape=shape, strides=strides) \ No newline at end of file + return as_strided(A, shape=shape, strides=strides)