0dea0d6035a4623f46723379a9944ec50e4322ae,imgaug/augmenters/arithmetic.py,Add,__init__,#Add#Any#Any#Any#Any#Any#,96
Before Change
deterministic=False, random_state=None):
super(Add, self).__init__(name=name, deterministic=deterministic, random_state=random_state)
if ia.is_single_integer(value):
ia.do_assert(-255 <= value <= 255, "Expected value to have range [-255, 255], got value %d." % (value,))
self.value = Deterministic(value)
elif ia.is_iterable(value):
ia.do_assert(len(value) == 2, "Expected tuple/list with 2 entries, got %d entries." % (len(value),))
self.value = DiscreteUniform(value[0], value[1])
elif isinstance(value, StochasticParameter):
self.value = value
else:
raise Exception("Expected float or int, tuple/list with 2 entries or StochasticParameter. Got %s." % (type(value),))
if per_channel in [True, False, 0, 1, 0.0, 1.0]:
self.per_channel = Deterministic(int(per_channel))
elif ia.is_single_number(per_channel):
ia.do_assert(0 <= per_channel <= 1.0, "Expected bool, or number in range [0, 1.0] for per_channel, got %s." % (type(per_channel),))
self.per_channel = Binomial(per_channel)
else:
raise Exception("Expected per_channel to be boolean or number or StochasticParameter")
After Change
deterministic=False, random_state=None):
super(Add, self).__init__(name=name, deterministic=deterministic, random_state=random_state)
self.value = iap.handle_discrete_param(value, "value", value_range=(-255, 255), tuple_to_uniform=True, list_to_choice=True, allow_floats=False)
self.per_channel = iap.handle_probability_param(per_channel, "per_channel")
def _augment_images(self, images, random_state, parents, hooks):
input_dtypes = meta.copy_dtypes_for_restore(images, force_list=True)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 21
Instances
Project Name: aleju/imgaug
Commit Name: 0dea0d6035a4623f46723379a9944ec50e4322ae
Time: 2018-08-30
Author: kontakt@ajung.name
File Name: imgaug/augmenters/arithmetic.py
Class Name: Add
Method Name: __init__
Project Name: aleju/imgaug
Commit Name: fe4e8ad9ba8e1e9d44b972802a97d62997dddbf3
Time: 2018-09-01
Author: kontakt@ajung.name
File Name: imgaug/augmenters/size.py
Class Name: CropAndPad
Method Name: __init__
Project Name: aleju/imgaug
Commit Name: 0dea0d6035a4623f46723379a9944ec50e4322ae
Time: 2018-08-30
Author: kontakt@ajung.name
File Name: imgaug/augmenters/arithmetic.py
Class Name: Add
Method Name: __init__
Project Name: aleju/imgaug
Commit Name: f417d3d3d16d9d1f5c535be9baa5363913c4c09a
Time: 2018-08-30
Author: kontakt@ajung.name
File Name: imgaug/augmenters/arithmetic.py
Class Name: AddElementwise
Method Name: __init__