MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / __init__

Method __init__

PATH/core/data/transforms/seg_aug_dev.py:399–412  ·  view source on GitHub ↗

Args: prob (float): probability of flip. horizontal (boolean): whether to apply horizontal flipping vertical (boolean): whether to apply vertical flipping

(self, prob=0.5, *, horizontal=True, vertical=False)

Source from the content-addressed store, hash-verified

397 """
398
399 def __init__(self, prob=0.5, *, horizontal=True, vertical=False):
400 """
401 Args:
402 prob (float): probability of flip.
403 horizontal (boolean): whether to apply horizontal flipping
404 vertical (boolean): whether to apply vertical flipping
405 """
406 super().__init__()
407
408 if horizontal and vertical:
409 raise ValueError("Cannot do both horiz and vert. Please use two Flip instead.")
410 if not horizontal and not vertical:
411 raise ValueError("At least one of horiz or vert has to be True!")
412 self._init(locals())
413
414 def get_transform(self, image):
415 h, w = image.shape[:2]

Callers 9

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

_initMethod · 0.45

Tested by

no test coverage detected