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

Method augment

tensorpack/dataflow/imgaug/base.py:183–200  ·  view source on GitHub ↗

Create a transform, and apply it to augment the input image. This can save you one line of code, when you only care the augmentation of "one image". It will not return the :class:`Transform` object to you so you won't be able to apply the same transformation on

(self, img)

Source from the content-addressed store, hash-verified

181 apply_coords=lambda coords: legacy_augment_coords(self, coords, p))
182
183 def augment(self, img):
184 """
185 Create a transform, and apply it to augment the input image.
186
187 This can save you one line of code, when you only care the augmentation of "one image".
188 It will not return the :class:`Transform` object to you
189 so you won't be able to apply the same transformation on
190 other data associated with the image.
191
192 Args:
193 img (ndarray): see notes of this class on the requirements.
194
195 Returns:
196 img: augmented image.
197 """
198 check_dtype(img)
199 t = self.get_transform(img)
200 return t.apply_image(img)
201
202 # ###########################
203 # Legacy interfaces:

Callers 11

_aug_mapperMethod · 0.80
run_testFunction · 0.80
mapfFunction · 0.80
mapfFunction · 0.80
applyFunction · 0.80
__iter__Method · 0.80
predict_imageFunction · 0.80
mapfFunction · 0.80
run_imageFunction · 0.80
mapfFunction · 0.80
run_imageFunction · 0.80

Calls 3

get_transformMethod · 0.95
check_dtypeFunction · 0.85
apply_imageMethod · 0.45

Tested by

no test coverage detected