Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions photo_smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
return as_strided(A, shape=shape, strides=strides)