MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / CropMultiple16

Class CropMultiple16

examples/HED/hed.py:192–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 ds = dataset.BSDS500(name, shuffle=True)
191
192 class CropMultiple16(imgaug.ImageAugmentor):
193 def get_transform(self, img):
194 newh = img.shape[0] // 16 * 16
195 neww = img.shape[1] // 16 * 16
196 assert newh > 0 and neww > 0
197 diffh = img.shape[0] - newh
198 h0 = 0 if diffh == 0 else self.rng.randint(diffh)
199 diffw = img.shape[1] - neww
200 w0 = 0 if diffw == 0 else self.rng.randint(diffw)
201 return imgaug.CropTransform(h0, w0, newh, neww)
202
203 if isTrain:
204 shape_aug = [

Callers 1

get_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected