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

Method __init__

tensorpack/dataflow/imgaug/misc.py:18–30  ·  view source on GitHub ↗

Args: horiz (bool): use horizontal flip. vert (bool): use vertical flip. prob (float): probability of flip.

(self, horiz=False, vert=False, prob=0.5)

Source from the content-addressed store, hash-verified

16 Random flip the image either horizontally or vertically.
17 """
18 def __init__(self, horiz=False, vert=False, prob=0.5):
19 """
20 Args:
21 horiz (bool): use horizontal flip.
22 vert (bool): use vertical flip.
23 prob (float): probability of flip.
24 """
25 super(Flip, self).__init__()
26 if horiz and vert:
27 raise ValueError("Cannot do both horiz and vert. Please use two Flip instead.")
28 if not horiz and not vert:
29 raise ValueError("At least one of horiz or vert has to be True!")
30 self._init(locals())
31
32 def get_transform(self, img):
33 h, w = img.shape[:2]

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 1

_initMethod · 0.45

Tested by

no test coverage detected