MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / __init__

Method __init__

tensorpack/dataflow/imgaug/imgproc.py:244–254  ·  view source on GitHub ↗

Args: alpha(float): maximum saturation change. rgb (bool): whether input is RGB or BGR. clip (bool): clip results to [0,255] even when data type is not uint8.

(self, alpha=0.4, rgb=True, clip=True)

Source from the content-addressed store, hash-verified

242 """
243
244 def __init__(self, alpha=0.4, rgb=True, clip=True):
245 """
246 Args:
247 alpha(float): maximum saturation change.
248 rgb (bool): whether input is RGB or BGR.
249 clip (bool): clip results to [0,255] even when data type is not uint8.
250 """
251 super().__init__()
252 rgb = bool(rgb)
253 assert alpha < 1
254 self._init(locals())
255
256 def _get_augment_params(self, _):
257 return 1 + self._rand_range(-self.alpha, self.alpha)

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
_initMethod · 0.45

Tested by

no test coverage detected