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

Method _augment

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

Source from the content-addressed store, hash-verified

150 self._init(locals())
151
152 def _augment(self, img, _):
153 img = img.astype('float32')
154 if self.all_channel:
155 mean = np.mean(img)
156 std = np.std(img)
157 else:
158 mean = np.mean(img, axis=(0, 1), keepdims=True)
159 std = np.std(img, axis=(0, 1), keepdims=True)
160 std = np.maximum(std, 1.0 / np.sqrt(np.prod(img.shape)))
161 img = (img - mean) / std
162 return img
163
164
165class GaussianBlur(PhotometricAugmentor):

Callers

nothing calls this directly

Calls 2

meanMethod · 0.80
stdMethod · 0.80

Tested by

no test coverage detected