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

Method random_brightness

PATH/core/augmentation.py:486–494  ·  view source on GitHub ↗
(self, img, binary_mask=None)

Source from the content-addressed store, hash-verified

484 return crop
485
486 def random_brightness(self, img, binary_mask=None):
487 if np.random.rand() <= 0.5:
488 img=img.astype(np.float32)
489 delta = random.uniform(-self.brightness_delta,
490 self.brightness_delta)
491 if binary_mask is not None:
492 delta = delta * binary_mask
493 img += delta
494 return img
495
496 def random_contrast(self, img, binary_mask=None):
497 if np.random.rand() <= 0.5:

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected