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

Method _augment

tensorpack/dataflow/imgaug/imgproc.py:322–331  ·  view source on GitHub ↗
(self, img, _)

Source from the content-addressed store, hash-verified

320 self._init(locals())
321
322 def _augment(self, img, _):
323 img = img.astype('float32')
324 if self.all_channel:
325 minimum = np.min(img)
326 maximum = np.max(img)
327 else:
328 minimum = np.min(img, axis=(0, 1), keepdims=True)
329 maximum = np.max(img, axis=(0, 1), keepdims=True)
330 img = (self.max - self.min) * (img - minimum) / (maximum - minimum) + self.min
331 return img

Callers

nothing calls this directly

Calls 2

minMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected