MCPcopy Create free account
hub / github.com/NVIDIA/FastPhotoStyle / __replication_padding

Method __replication_padding

photo_smooth.py:89–94  ·  view source on GitHub ↗
(self, arr,pad)

Source from the content-addressed store, hash-verified

87 return L
88
89 def __replication_padding(self, arr,pad):
90 h,w,c = arr.shape
91 ans = np.zeros((h+pad*2,w+pad*2,c))
92 for i in range(c):
93 ans[:,:,i] = np.pad(arr[:,:,i],pad_width=(pad,pad),mode='edge')
94 return ans
95
96 def __rolling_block(self, A, block=(3, 3)):
97 shape = (A.shape[0] - block[0] + 1, A.shape[1] - block[1] + 1) + block

Callers 1

processMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected