def __init__( self, brightness_std: float = 0.5, contrast_std: float = 0.5, channels: Optional[Sequence[int]] = None, prob: float = 1.0, ): if not channels: # Support empty sequences as an alias for None channels = None self.channels = channels self.prob = prob self.brightness_gen = Normal(mean=0.0, sigma=brightness_std) self.contrast_gen = Normal(mean=1.0, sigma=contrast_std)
def __init__(self, sigma: float = 0.1, channels: Optional[Sequence[int]] = None, prob: float = 1.0, rng: Optional[np.random.RandomState] = None): self.channels = channels self.prob = prob self.rng = np.random.RandomState() if rng is None else rng self.noise_generator = Normal(mean=0, sigma=sigma, rng=rng)
def __init__( self, sigma: float = 0.1, channels: Optional[Sequence[int]] = None, prob: float = 1.0, ): self.channels = channels self.prob = prob self.noise_generator = Normal(mean=0, sigma=sigma)
def __init__( self, gamma_std: float = 0.5, gamma_min: float = 0.25, # Prevent gamma <= 0 (0 causes zero division) channels: Optional[Sequence[int]] = None, prob: float = 1.0, ): if not channels: # Support empty sequences as an alias for None channels = None self.channels = channels self.prob = prob self.gamma_generator = Normal( mean=1.0, sigma=gamma_std, bounds=(gamma_min, np.inf) )
def __init__( self, gamma_std: float = 0.5, gamma_min: float = 0.25, # Prevent gamma <= 0 (0 causes zero division) channels: Optional[Sequence[int]] = None, prob: float = 1.0, rng: Optional[np.random.RandomState] = None): self.channels = channels self.prob = prob self.rng = np.random.RandomState() if rng is None else rng self.gamma_generator = Normal(mean=1.0, sigma=gamma_std, bounds=(gamma_min, np.inf), rng=rng)