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

Class TransformFactory

tensorpack/dataflow/imgaug/transform.py:246–266  ·  view source on GitHub ↗

Create a :class:`Transform` from user-provided functions.

Source from the content-addressed store, hash-verified

244
245
246class TransformFactory(Transform):
247 """
248 Create a :class:`Transform` from user-provided functions.
249 """
250 def __init__(self, name=None, **kwargs):
251 """
252 Args:
253 name (str, optional): the name of this transform
254 **kwargs: mapping from `'apply_xxx'` to implementation of such functions.
255 """
256 for k, v in kwargs.items():
257 if k.startswith('apply_'):
258 setattr(self, k, v)
259 else:
260 raise KeyError("Unknown argument '{}' in TransformFactory!".format(k))
261 self._name = name
262
263 def __str__(self):
264 return "imgaug.TransformFactory({})".format(self._name if self._name else "")
265
266 __repr__ = __str__
267
268
269"""

Callers 5

get_transformMethod · 0.85
get_transformMethod · 0.85
get_transformMethod · 0.85
get_transformMethod · 0.85
get_transformMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected