cb36b37ffa83ddfa935893ef5e984bc904f839af,imgaug/augmenters/color.py,ChangeColorspace,__init__,#ChangeColorspace#Any#Any#Any#Any#Any#Any#,288
Before Change
def __init__(self, to_colorspace, from_colorspace="RGB", alpha=1.0, name=None, deterministic=False, random_state=None):
super(ChangeColorspace, self).__init__(name=name, deterministic=deterministic, random_state=random_state)
if ia.is_single_number(alpha):
self.alpha = Deterministic(alpha)
elif ia.is_iterable(alpha):
ia.do_assert(len(alpha) == 2, "Expected tuple/list with 2 entries, got %d entries." % (len(alpha),))
self.alpha = Uniform(alpha[0], alpha[1])
elif isinstance(alpha, StochasticParameter):
self.alpha = alpha
else:
raise Exception("Expected alpha to be int or float or tuple/list of ints/floats or StochasticParameter, got %s." % (type(alpha),))
if ia.is_string(to_colorspace):
ia.do_assert(to_colorspace in ChangeColorspace.COLORSPACES)
self.to_colorspace = Deterministic(to_colorspace)
elif ia.is_iterable(to_colorspace):
After Change
super(ChangeColorspace, self).__init__(name=name, deterministic=deterministic, random_state=random_state)
// TODO somehow merge this with Alpha augmenter?
self.alpha = iap.handle_continuous_param(alpha, "alpha", value_range=(0, 1.0), tuple_to_uniform=True, list_to_choice=True)
if ia.is_string(to_colorspace):
ia.do_assert(to_colorspace in ChangeColorspace.COLORSPACES)
self.to_colorspace = Deterministic(to_colorspace)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 26
Instances
Project Name: aleju/imgaug
Commit Name: cb36b37ffa83ddfa935893ef5e984bc904f839af
Time: 2018-09-01
Author: kontakt@ajung.name
File Name: imgaug/augmenters/color.py
Class Name: ChangeColorspace
Method Name: __init__
Project Name: aleju/imgaug
Commit Name: 1a6965f89beeff99abbde39713ebd6a7ca0e2576
Time: 2018-08-31
Author: kontakt@ajung.name
File Name: imgaug/augmenters/arithmetic.py
Class Name: JpegCompression
Method Name: __init__
Project Name: aleju/imgaug
Commit Name: ff97a1402877d0613158b37ca7fc781d1901f951
Time: 2018-09-01
Author: kontakt@ajung.name
File Name: imgaug/augmenters/overlay.py
Class Name: Alpha
Method Name: __init__
Project Name: aleju/imgaug
Commit Name: cb36b37ffa83ddfa935893ef5e984bc904f839af
Time: 2018-09-01
Author: kontakt@ajung.name
File Name: imgaug/augmenters/color.py
Class Name: ChangeColorspace
Method Name: __init__