partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
valid | _ABCTree.set_default | T.set_default(k[,d]) -> T.get(k,d), also set T[k]=d if k not in T | imgaug/external/poly_point_isect_py2py3.py | def set_default(self, key, default=None):
"""T.set_default(k[,d]) -> T.get(k,d), also set T[k]=d if k not in T"""
try:
return self.get_value(key)
except KeyError:
self.insert(key, default)
return default | def set_default(self, key, default=None):
"""T.set_default(k[,d]) -> T.get(k,d), also set T[k]=d if k not in T"""
try:
return self.get_value(key)
except KeyError:
self.insert(key, default)
return default | [
"T",
".",
"set_default",
"(",
"k",
"[",
"d",
"]",
")",
"-",
">",
"T",
".",
"get",
"(",
"k",
"d",
")",
"also",
"set",
"T",
"[",
"k",
"]",
"=",
"d",
"if",
"k",
"not",
"in",
"T"
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L964-L970 | [
"def",
"set_default",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"get_value",
"(",
"key",
")",
"except",
"KeyError",
":",
"self",
".",
"insert",
"(",
"key",
",",
"default",
")",
"return",
"defau... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | _ABCTree.pop | T.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised | imgaug/external/poly_point_isect_py2py3.py | def pop(self, key, *args):
"""T.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised
"""
if len(args) > 1:
raise TypeError("pop expected at most 2 arguments, got %d" % (1 + len(args... | def pop(self, key, *args):
"""T.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised
"""
if len(args) > 1:
raise TypeError("pop expected at most 2 arguments, got %d" % (1 + len(args... | [
"T",
".",
"pop",
"(",
"k",
"[",
"d",
"]",
")",
"-",
">",
"v",
"remove",
"specified",
"key",
"and",
"return",
"the",
"corresponding",
"value",
".",
"If",
"key",
"is",
"not",
"found",
"d",
"is",
"returned",
"if",
"given",
"otherwise",
"KeyError",
"is",... | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L980-L994 | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"*",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
">",
"1",
":",
"raise",
"TypeError",
"(",
"\"pop expected at most 2 arguments, got %d\"",
"%",
"(",
"1",
"+",
"len",
"(",
"args",
")",
")",
")",
"try",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | _ABCTree.prev_key | Get predecessor to key, raises KeyError if key is min key
or key does not exist. | imgaug/external/poly_point_isect_py2py3.py | def prev_key(self, key, default=_sentinel):
"""Get predecessor to key, raises KeyError if key is min key
or key does not exist.
"""
item = self.prev_item(key, default)
return default if item is default else item[0] | def prev_key(self, key, default=_sentinel):
"""Get predecessor to key, raises KeyError if key is min key
or key does not exist.
"""
item = self.prev_item(key, default)
return default if item is default else item[0] | [
"Get",
"predecessor",
"to",
"key",
"raises",
"KeyError",
"if",
"key",
"is",
"min",
"key",
"or",
"key",
"does",
"not",
"exist",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L996-L1001 | [
"def",
"prev_key",
"(",
"self",
",",
"key",
",",
"default",
"=",
"_sentinel",
")",
":",
"item",
"=",
"self",
".",
"prev_item",
"(",
"key",
",",
"default",
")",
"return",
"default",
"if",
"item",
"is",
"default",
"else",
"item",
"[",
"0",
"]"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | _ABCTree.succ_key | Get successor to key, raises KeyError if key is max key
or key does not exist. | imgaug/external/poly_point_isect_py2py3.py | def succ_key(self, key, default=_sentinel):
"""Get successor to key, raises KeyError if key is max key
or key does not exist.
"""
item = self.succ_item(key, default)
return default if item is default else item[0] | def succ_key(self, key, default=_sentinel):
"""Get successor to key, raises KeyError if key is max key
or key does not exist.
"""
item = self.succ_item(key, default)
return default if item is default else item[0] | [
"Get",
"successor",
"to",
"key",
"raises",
"KeyError",
"if",
"key",
"is",
"max",
"key",
"or",
"key",
"does",
"not",
"exist",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L1003-L1008 | [
"def",
"succ_key",
"(",
"self",
",",
"key",
",",
"default",
"=",
"_sentinel",
")",
":",
"item",
"=",
"self",
".",
"succ_item",
"(",
"key",
",",
"default",
")",
"return",
"default",
"if",
"item",
"is",
"default",
"else",
"item",
"[",
"0",
"]"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | _ABCTree.key_slice | T.key_slice(start_key, end_key) -> key iterator:
start_key <= key < end_key.
Yields keys in ascending order if reverse is False else in descending order. | imgaug/external/poly_point_isect_py2py3.py | def key_slice(self, start_key, end_key, reverse=False):
"""T.key_slice(start_key, end_key) -> key iterator:
start_key <= key < end_key.
Yields keys in ascending order if reverse is False else in descending order.
"""
return (k for k, v in self.iter_items(start_key, end_key, reve... | def key_slice(self, start_key, end_key, reverse=False):
"""T.key_slice(start_key, end_key) -> key iterator:
start_key <= key < end_key.
Yields keys in ascending order if reverse is False else in descending order.
"""
return (k for k, v in self.iter_items(start_key, end_key, reve... | [
"T",
".",
"key_slice",
"(",
"start_key",
"end_key",
")",
"-",
">",
"key",
"iterator",
":",
"start_key",
"<",
"=",
"key",
"<",
"end_key",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L1034-L1040 | [
"def",
"key_slice",
"(",
"self",
",",
"start_key",
",",
"end_key",
",",
"reverse",
"=",
"False",
")",
":",
"return",
"(",
"k",
"for",
"k",
",",
"v",
"in",
"self",
".",
"iter_items",
"(",
"start_key",
",",
"end_key",
",",
"reverse",
"=",
"reverse",
")... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | _ABCTree.iter_items | Iterates over the (key, value) items of the associated tree,
in ascending order if reverse is True, iterate in descending order,
reverse defaults to False | imgaug/external/poly_point_isect_py2py3.py | def iter_items(self, start_key=None, end_key=None, reverse=False):
"""Iterates over the (key, value) items of the associated tree,
in ascending order if reverse is True, iterate in descending order,
reverse defaults to False"""
# optimized iterator (reduced method calls) - faster on CPy... | def iter_items(self, start_key=None, end_key=None, reverse=False):
"""Iterates over the (key, value) items of the associated tree,
in ascending order if reverse is True, iterate in descending order,
reverse defaults to False"""
# optimized iterator (reduced method calls) - faster on CPy... | [
"Iterates",
"over",
"the",
"(",
"key",
"value",
")",
"items",
"of",
"the",
"associated",
"tree",
"in",
"ascending",
"order",
"if",
"reverse",
"is",
"True",
"iterate",
"in",
"descending",
"order",
"reverse",
"defaults",
"to",
"False"
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L1042-L1053 | [
"def",
"iter_items",
"(",
"self",
",",
"start_key",
"=",
"None",
",",
"end_key",
"=",
"None",
",",
"reverse",
"=",
"False",
")",
":",
"# optimized iterator (reduced method calls) - faster on CPython but slower on pypy",
"if",
"self",
".",
"is_empty",
"(",
")",
":",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | RBTree.insert | T.insert(key, value) <==> T[key] = value, insert key, value into tree. | imgaug/external/poly_point_isect_py2py3.py | def insert(self, key, value):
"""T.insert(key, value) <==> T[key] = value, insert key, value into tree."""
if self._root is None: # Empty tree case
self._root = self._new_node(key, value)
self._root.red = False # make root black
return
head = Node() # Fals... | def insert(self, key, value):
"""T.insert(key, value) <==> T[key] = value, insert key, value into tree."""
if self._root is None: # Empty tree case
self._root = self._new_node(key, value)
self._root.red = False # make root black
return
head = Node() # Fals... | [
"T",
".",
"insert",
"(",
"key",
"value",
")",
"<",
"==",
">",
"T",
"[",
"key",
"]",
"=",
"value",
"insert",
"key",
"value",
"into",
"tree",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L1166-L1216 | [
"def",
"insert",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"if",
"self",
".",
"_root",
"is",
"None",
":",
"# Empty tree case",
"self",
".",
"_root",
"=",
"self",
".",
"_new_node",
"(",
"key",
",",
"value",
")",
"self",
".",
"_root",
".",
"re... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | RBTree.remove | T.remove(key) <==> del T[key], remove item <key> from tree. | imgaug/external/poly_point_isect_py2py3.py | def remove(self, key):
"""T.remove(key) <==> del T[key], remove item <key> from tree."""
if self._root is None:
raise KeyError(str(key))
head = Node() # False tree root
node = head
node.right = self._root
parent = None
grand_parent = None
foun... | def remove(self, key):
"""T.remove(key) <==> del T[key], remove item <key> from tree."""
if self._root is None:
raise KeyError(str(key))
head = Node() # False tree root
node = head
node.right = self._root
parent = None
grand_parent = None
foun... | [
"T",
".",
"remove",
"(",
"key",
")",
"<",
"==",
">",
"del",
"T",
"[",
"key",
"]",
"remove",
"item",
"<key",
">",
"from",
"tree",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect_py2py3.py#L1218-L1283 | [
"def",
"remove",
"(",
"self",
",",
"key",
")",
":",
"if",
"self",
".",
"_root",
"is",
"None",
":",
"raise",
"KeyError",
"(",
"str",
"(",
"key",
")",
")",
"head",
"=",
"Node",
"(",
")",
"# False tree root",
"node",
"=",
"head",
"node",
".",
"right",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | OpenSimplex.noise2d | Generate 2D OpenSimplex noise from X,Y coordinates. | imgaug/external/opensimplex.py | def noise2d(self, x, y):
"""
Generate 2D OpenSimplex noise from X,Y coordinates.
"""
# Place input coordinates onto grid.
stretch_offset = (x + y) * STRETCH_CONSTANT_2D
xs = x + stretch_offset
ys = y + stretch_offset
# Floor to get grid coordinates of rho... | def noise2d(self, x, y):
"""
Generate 2D OpenSimplex noise from X,Y coordinates.
"""
# Place input coordinates onto grid.
stretch_offset = (x + y) * STRETCH_CONSTANT_2D
xs = x + stretch_offset
ys = y + stretch_offset
# Floor to get grid coordinates of rho... | [
"Generate",
"2D",
"OpenSimplex",
"noise",
"from",
"X",
"Y",
"coordinates",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/opensimplex.py#L143-L244 | [
"def",
"noise2d",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"# Place input coordinates onto grid.",
"stretch_offset",
"=",
"(",
"x",
"+",
"y",
")",
"*",
"STRETCH_CONSTANT_2D",
"xs",
"=",
"x",
"+",
"stretch_offset",
"ys",
"=",
"y",
"+",
"stretch_offset",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | OpenSimplex.noise3d | Generate 3D OpenSimplex noise from X,Y,Z coordinates. | imgaug/external/opensimplex.py | def noise3d(self, x, y, z):
"""
Generate 3D OpenSimplex noise from X,Y,Z coordinates.
"""
# Place input coordinates on simplectic honeycomb.
stretch_offset = (x + y + z) * STRETCH_CONSTANT_3D
xs = x + stretch_offset
ys = y + stretch_offset
zs = z + stretch... | def noise3d(self, x, y, z):
"""
Generate 3D OpenSimplex noise from X,Y,Z coordinates.
"""
# Place input coordinates on simplectic honeycomb.
stretch_offset = (x + y + z) * STRETCH_CONSTANT_3D
xs = x + stretch_offset
ys = y + stretch_offset
zs = z + stretch... | [
"Generate",
"3D",
"OpenSimplex",
"noise",
"from",
"X",
"Y",
"Z",
"coordinates",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/opensimplex.py#L247-L740 | [
"def",
"noise3d",
"(",
"self",
",",
"x",
",",
"y",
",",
"z",
")",
":",
"# Place input coordinates on simplectic honeycomb.",
"stretch_offset",
"=",
"(",
"x",
"+",
"y",
"+",
"z",
")",
"*",
"STRETCH_CONSTANT_3D",
"xs",
"=",
"x",
"+",
"stretch_offset",
"ys",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | OpenSimplex.noise4d | Generate 4D OpenSimplex noise from X,Y,Z,W coordinates. | imgaug/external/opensimplex.py | def noise4d(self, x, y, z, w):
"""
Generate 4D OpenSimplex noise from X,Y,Z,W coordinates.
"""
# Place input coordinates on simplectic honeycomb.
stretch_offset = (x + y + z + w) * STRETCH_CONSTANT_4D
xs = x + stretch_offset
ys = y + stretch_offset
zs = z ... | def noise4d(self, x, y, z, w):
"""
Generate 4D OpenSimplex noise from X,Y,Z,W coordinates.
"""
# Place input coordinates on simplectic honeycomb.
stretch_offset = (x + y + z + w) * STRETCH_CONSTANT_4D
xs = x + stretch_offset
ys = y + stretch_offset
zs = z ... | [
"Generate",
"4D",
"OpenSimplex",
"noise",
"from",
"X",
"Y",
"Z",
"W",
"coordinates",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/opensimplex.py#L743-L1934 | [
"def",
"noise4d",
"(",
"self",
",",
"x",
",",
"y",
",",
"z",
",",
"w",
")",
":",
"# Place input coordinates on simplectic honeycomb.",
"stretch_offset",
"=",
"(",
"x",
"+",
"y",
"+",
"z",
"+",
"w",
")",
"*",
"STRETCH_CONSTANT_4D",
"xs",
"=",
"x",
"+",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | adjust_contrast_gamma | Adjust contrast by scaling each pixel value to ``255 * ((I_ij/255)**gamma)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
* ``uint64``: yes; tested (2) (3) (4)
* ``int8``: limited; tested (2)... | imgaug/augmenters/contrast.py | def adjust_contrast_gamma(arr, gamma):
"""
Adjust contrast by scaling each pixel value to ``255 * ((I_ij/255)**gamma)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
* ``uint64``: yes; tested ... | def adjust_contrast_gamma(arr, gamma):
"""
Adjust contrast by scaling each pixel value to ``255 * ((I_ij/255)**gamma)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
* ``uint64``: yes; tested ... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"255",
"*",
"((",
"I_ij",
"/",
"255",
")",
"**",
"gamma",
")",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L41-L105 | [
"def",
"adjust_contrast_gamma",
"(",
"arr",
",",
"gamma",
")",
":",
"# int8 is also possible according to docs",
"# https://docs.opencv.org/3.0-beta/modules/core/doc/operations_on_arrays.html#cv2.LUT , but here it seemed",
"# like `d` was 0 for CV_8S, causing that to fail",
"if",
"arr",
".... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | adjust_contrast_sigmoid | Adjust contrast by scaling each pixel value to ``255 * 1/(1 + exp(gain*(cutoff - I_ij/255)))``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
* ``uint64``: yes; tested (2) (3) (4)
* ``int8``: l... | imgaug/augmenters/contrast.py | def adjust_contrast_sigmoid(arr, gain, cutoff):
"""
Adjust contrast by scaling each pixel value to ``255 * 1/(1 + exp(gain*(cutoff - I_ij/255)))``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
... | def adjust_contrast_sigmoid(arr, gain, cutoff):
"""
Adjust contrast by scaling each pixel value to ``255 * 1/(1 + exp(gain*(cutoff - I_ij/255)))``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"255",
"*",
"1",
"/",
"(",
"1",
"+",
"exp",
"(",
"gain",
"*",
"(",
"cutoff",
"-",
"I_ij",
"/",
"255",
")))",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L109-L181 | [
"def",
"adjust_contrast_sigmoid",
"(",
"arr",
",",
"gain",
",",
"cutoff",
")",
":",
"# int8 is also possible according to docs",
"# https://docs.opencv.org/3.0-beta/modules/core/doc/operations_on_arrays.html#cv2.LUT , but here it seemed",
"# like `d` was 0 for CV_8S, causing that to fail",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | adjust_contrast_log | Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
* ``uint64``: yes; tested (2) (3) (4)
* ``int8``: limited; tes... | imgaug/augmenters/contrast.py | def adjust_contrast_log(arr, gain):
"""
Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
* ``uint64``: yes; tes... | def adjust_contrast_log(arr, gain):
"""
Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2) (3)
* ``uint16``: yes; tested (2) (3)
* ``uint32``: yes; tested (2) (3)
* ``uint64``: yes; tes... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"255",
"*",
"gain",
"*",
"log_2",
"(",
"1",
"+",
"I_ij",
"/",
"255",
")",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L185-L252 | [
"def",
"adjust_contrast_log",
"(",
"arr",
",",
"gain",
")",
":",
"# int8 is also possible according to docs",
"# https://docs.opencv.org/3.0-beta/modules/core/doc/operations_on_arrays.html#cv2.LUT , but here it seemed",
"# like `d` was 0 for CV_8S, causing that to fail",
"if",
"arr",
".",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | adjust_contrast_linear | Adjust contrast by scaling each pixel value to ``127 + alpha*(I_ij-127)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2)
* ``uint16``: yes; tested (2)
* ``uint32``: yes; tested (2)
* ``uint64``: no (3)
* ``int8``: yes; tested (2)
* ``int16``: yes; tested (2... | imgaug/augmenters/contrast.py | def adjust_contrast_linear(arr, alpha):
"""Adjust contrast by scaling each pixel value to ``127 + alpha*(I_ij-127)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2)
* ``uint16``: yes; tested (2)
* ``uint32``: yes; tested (2)
* ``uint64``: no (3)
* ``int8``: yes;... | def adjust_contrast_linear(arr, alpha):
"""Adjust contrast by scaling each pixel value to ``127 + alpha*(I_ij-127)``.
dtype support::
* ``uint8``: yes; fully tested (1) (2)
* ``uint16``: yes; tested (2)
* ``uint32``: yes; tested (2)
* ``uint64``: no (3)
* ``int8``: yes;... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"127",
"+",
"alpha",
"*",
"(",
"I_ij",
"-",
"127",
")",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L256-L318 | [
"def",
"adjust_contrast_linear",
"(",
"arr",
",",
"alpha",
")",
":",
"# int8 is also possible according to docs",
"# https://docs.opencv.org/3.0-beta/modules/core/doc/operations_on_arrays.html#cv2.LUT , but here it seemed",
"# like `d` was 0 for CV_8S, causing that to fail",
"if",
"arr",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | GammaContrast | Adjust contrast by scaling each pixel value to ``255 * ((I_ij/255)**gamma)``.
Values in the range ``gamma=(0.5, 2.0)`` seem to be sensible.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_gamma`.
Parameters
----------
gamma : number or tuple of number or list of num... | imgaug/augmenters/contrast.py | def GammaContrast(gamma=1, per_channel=False, name=None, deterministic=False, random_state=None):
"""
Adjust contrast by scaling each pixel value to ``255 * ((I_ij/255)**gamma)``.
Values in the range ``gamma=(0.5, 2.0)`` seem to be sensible.
dtype support::
See :func:`imgaug.augmenters.contra... | def GammaContrast(gamma=1, per_channel=False, name=None, deterministic=False, random_state=None):
"""
Adjust contrast by scaling each pixel value to ``255 * ((I_ij/255)**gamma)``.
Values in the range ``gamma=(0.5, 2.0)`` seem to be sensible.
dtype support::
See :func:`imgaug.augmenters.contra... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"255",
"*",
"((",
"I_ij",
"/",
"255",
")",
"**",
"gamma",
")",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L321-L373 | [
"def",
"GammaContrast",
"(",
"gamma",
"=",
"1",
",",
"per_channel",
"=",
"False",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"params1d",
"=",
"[",
"iap",
".",
"handle_continuous_param",
"(",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SigmoidContrast | Adjust contrast by scaling each pixel value to ``255 * 1/(1 + exp(gain*(cutoff - I_ij/255)))``.
Values in the range ``gain=(5, 20)`` and ``cutoff=(0.25, 0.75)`` seem to be sensible.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_sigmoid`.
Parameters
----------
gain... | imgaug/augmenters/contrast.py | def SigmoidContrast(gain=10, cutoff=0.5, per_channel=False, name=None, deterministic=False, random_state=None):
"""
Adjust contrast by scaling each pixel value to ``255 * 1/(1 + exp(gain*(cutoff - I_ij/255)))``.
Values in the range ``gain=(5, 20)`` and ``cutoff=(0.25, 0.75)`` seem to be sensible.
dtyp... | def SigmoidContrast(gain=10, cutoff=0.5, per_channel=False, name=None, deterministic=False, random_state=None):
"""
Adjust contrast by scaling each pixel value to ``255 * 1/(1 + exp(gain*(cutoff - I_ij/255)))``.
Values in the range ``gain=(5, 20)`` and ``cutoff=(0.25, 0.75)`` seem to be sensible.
dtyp... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"255",
"*",
"1",
"/",
"(",
"1",
"+",
"exp",
"(",
"gain",
"*",
"(",
"cutoff",
"-",
"I_ij",
"/",
"255",
")))",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L376-L442 | [
"def",
"SigmoidContrast",
"(",
"gain",
"=",
"10",
",",
"cutoff",
"=",
"0.5",
",",
"per_channel",
"=",
"False",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"# TODO add inv parameter?",
"params1d",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LogContrast | Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_log`.
Parameters
----------
gain : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
... | imgaug/augmenters/contrast.py | def LogContrast(gain=1, per_channel=False, name=None, deterministic=False, random_state=None):
"""
Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_log`.
Parameters
----------
gai... | def LogContrast(gain=1, per_channel=False, name=None, deterministic=False, random_state=None):
"""
Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_log`.
Parameters
----------
gai... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"255",
"*",
"gain",
"*",
"log_2",
"(",
"1",
"+",
"I_ij",
"/",
"255",
")",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L445-L498 | [
"def",
"LogContrast",
"(",
"gain",
"=",
"1",
",",
"per_channel",
"=",
"False",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"# TODO add inv parameter?",
"params1d",
"=",
"[",
"iap",
".",
"handle_... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LinearContrast | Adjust contrast by scaling each pixel value to ``127 + alpha*(I_ij-127)``.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_linear`.
Parameters
----------
alpha : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
Multip... | imgaug/augmenters/contrast.py | def LinearContrast(alpha=1, per_channel=False, name=None, deterministic=False, random_state=None):
"""Adjust contrast by scaling each pixel value to ``127 + alpha*(I_ij-127)``.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_linear`.
Parameters
----------
alpha : num... | def LinearContrast(alpha=1, per_channel=False, name=None, deterministic=False, random_state=None):
"""Adjust contrast by scaling each pixel value to ``127 + alpha*(I_ij-127)``.
dtype support::
See :func:`imgaug.augmenters.contrast.adjust_contrast_linear`.
Parameters
----------
alpha : num... | [
"Adjust",
"contrast",
"by",
"scaling",
"each",
"pixel",
"value",
"to",
"127",
"+",
"alpha",
"*",
"(",
"I_ij",
"-",
"127",
")",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/contrast.py#L501-L552 | [
"def",
"LinearContrast",
"(",
"alpha",
"=",
"1",
",",
"per_channel",
"=",
"False",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"params1d",
"=",
"[",
"iap",
".",
"handle_continuous_param",
"(",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | InColorspace | Convert images to another colorspace. | imgaug/augmenters/color.py | def InColorspace(to_colorspace, from_colorspace="RGB", children=None, name=None, deterministic=False,
random_state=None):
"""Convert images to another colorspace."""
return WithColorspace(to_colorspace, from_colorspace, children, name, deterministic, random_state) | def InColorspace(to_colorspace, from_colorspace="RGB", children=None, name=None, deterministic=False,
random_state=None):
"""Convert images to another colorspace."""
return WithColorspace(to_colorspace, from_colorspace, children, name, deterministic, random_state) | [
"Convert",
"images",
"to",
"another",
"colorspace",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/color.py#L39-L42 | [
"def",
"InColorspace",
"(",
"to_colorspace",
",",
"from_colorspace",
"=",
"\"RGB\"",
",",
"children",
"=",
"None",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"return",
"WithColorspace",
"(",
"to_... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | Grayscale | Augmenter to convert images to their grayscale versions.
NOTE: Number of output channels is still 3, i.e. this augmenter just "removes" color.
TODO check dtype support
dtype support::
* ``uint8``: yes; fully tested
* ``uint16``: ?
* ``uint32``: ?
* ``uint64``: ?
*... | imgaug/augmenters/color.py | def Grayscale(alpha=0, from_colorspace="RGB", name=None, deterministic=False, random_state=None):
"""
Augmenter to convert images to their grayscale versions.
NOTE: Number of output channels is still 3, i.e. this augmenter just "removes" color.
TODO check dtype support
dtype support::
* ... | def Grayscale(alpha=0, from_colorspace="RGB", name=None, deterministic=False, random_state=None):
"""
Augmenter to convert images to their grayscale versions.
NOTE: Number of output channels is still 3, i.e. this augmenter just "removes" color.
TODO check dtype support
dtype support::
* ... | [
"Augmenter",
"to",
"convert",
"images",
"to",
"their",
"grayscale",
"versions",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/color.py#L596-L667 | [
"def",
"Grayscale",
"(",
"alpha",
"=",
"0",
",",
"from_colorspace",
"=",
"\"RGB\"",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"\"Unnamed%s\"",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.height | Get the height of a bounding box encapsulating the line. | imgaug/augmentables/lines.py | def height(self):
"""Get the height of a bounding box encapsulating the line."""
if len(self.coords) <= 1:
return 0
return np.max(self.yy) - np.min(self.yy) | def height(self):
"""Get the height of a bounding box encapsulating the line."""
if len(self.coords) <= 1:
return 0
return np.max(self.yy) - np.min(self.yy) | [
"Get",
"the",
"height",
"of",
"a",
"bounding",
"box",
"encapsulating",
"the",
"line",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L100-L104 | [
"def",
"height",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"<=",
"1",
":",
"return",
"0",
"return",
"np",
".",
"max",
"(",
"self",
".",
"yy",
")",
"-",
"np",
".",
"min",
"(",
"self",
".",
"yy",
")"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.width | Get the width of a bounding box encapsulating the line. | imgaug/augmentables/lines.py | def width(self):
"""Get the width of a bounding box encapsulating the line."""
if len(self.coords) <= 1:
return 0
return np.max(self.xx) - np.min(self.xx) | def width(self):
"""Get the width of a bounding box encapsulating the line."""
if len(self.coords) <= 1:
return 0
return np.max(self.xx) - np.min(self.xx) | [
"Get",
"the",
"width",
"of",
"a",
"bounding",
"box",
"encapsulating",
"the",
"line",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L107-L111 | [
"def",
"width",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"<=",
"1",
":",
"return",
"0",
"return",
"np",
".",
"max",
"(",
"self",
".",
"xx",
")",
"-",
"np",
".",
"min",
"(",
"self",
".",
"xx",
")"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.get_pointwise_inside_image_mask | Get for each point whether it is inside of the given image plane.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
Returns
-------
ndarray
Boolean ... | imgaug/augmentables/lines.py | def get_pointwise_inside_image_mask(self, image):
"""
Get for each point whether it is inside of the given image plane.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.... | def get_pointwise_inside_image_mask(self, image):
"""
Get for each point whether it is inside of the given image plane.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.... | [
"Get",
"for",
"each",
"point",
"whether",
"it",
"is",
"inside",
"of",
"the",
"given",
"image",
"plane",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L113-L136 | [
"def",
"get_pointwise_inside_image_mask",
"(",
"self",
",",
"image",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"==",
"0",
":",
"return",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
")",
",",
"dtype",
"=",
"bool",
")",
"shape",
"=",
"norma... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.compute_neighbour_distances | Get the euclidean distance between each two consecutive points.
Returns
-------
ndarray
Euclidean distances between point pairs.
Same order as in `coords`. For ``N`` points, ``N-1`` distances
are returned. | imgaug/augmentables/lines.py | def compute_neighbour_distances(self):
"""
Get the euclidean distance between each two consecutive points.
Returns
-------
ndarray
Euclidean distances between point pairs.
Same order as in `coords`. For ``N`` points, ``N-1`` distances
are retu... | def compute_neighbour_distances(self):
"""
Get the euclidean distance between each two consecutive points.
Returns
-------
ndarray
Euclidean distances between point pairs.
Same order as in `coords`. For ``N`` points, ``N-1`` distances
are retu... | [
"Get",
"the",
"euclidean",
"distance",
"between",
"each",
"two",
"consecutive",
"points",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L139-L158 | [
"def",
"compute_neighbour_distances",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"<=",
"1",
":",
"return",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
")",
",",
"dtype",
"=",
"np",
".",
"float32",
")",
"return",
"np",
".",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.compute_pointwise_distances | Compute the minimal distance between each point on self and other.
Parameters
----------
other : tuple of number \
or imgaug.augmentables.kps.Keypoint \
or imgaug.augmentables.LineString
Other object to which to compute the distances.
default... | imgaug/augmentables/lines.py | def compute_pointwise_distances(self, other, default=None):
"""
Compute the minimal distance between each point on self and other.
Parameters
----------
other : tuple of number \
or imgaug.augmentables.kps.Keypoint \
or imgaug.augmentables.LineStr... | def compute_pointwise_distances(self, other, default=None):
"""
Compute the minimal distance between each point on self and other.
Parameters
----------
other : tuple of number \
or imgaug.augmentables.kps.Keypoint \
or imgaug.augmentables.LineStr... | [
"Compute",
"the",
"minimal",
"distance",
"between",
"each",
"point",
"on",
"self",
"and",
"other",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L160-L201 | [
"def",
"compute_pointwise_distances",
"(",
"self",
",",
"other",
",",
"default",
"=",
"None",
")",
":",
"import",
"shapely",
".",
"geometry",
"from",
".",
"kps",
"import",
"Keypoint",
"if",
"isinstance",
"(",
"other",
",",
"Keypoint",
")",
":",
"other",
"=... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.compute_distance | Compute the minimal distance between the line string and `other`.
Parameters
----------
other : tuple of number \
or imgaug.augmentables.kps.Keypoint \
or imgaug.augmentables.LineString
Other object to which to compute the distance.
default
... | imgaug/augmentables/lines.py | def compute_distance(self, other, default=None):
"""
Compute the minimal distance between the line string and `other`.
Parameters
----------
other : tuple of number \
or imgaug.augmentables.kps.Keypoint \
or imgaug.augmentables.LineString
... | def compute_distance(self, other, default=None):
"""
Compute the minimal distance between the line string and `other`.
Parameters
----------
other : tuple of number \
or imgaug.augmentables.kps.Keypoint \
or imgaug.augmentables.LineString
... | [
"Compute",
"the",
"minimal",
"distance",
"between",
"the",
"line",
"string",
"and",
"other",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L203-L228 | [
"def",
"compute_distance",
"(",
"self",
",",
"other",
",",
"default",
"=",
"None",
")",
":",
"# FIXME this computes distance pointwise, does not have to be identical",
"# with the actual min distance (e.g. edge center to other's point)",
"distances",
"=",
"self",
".",
"comp... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.contains | Estimate whether the bounding box contains a point.
Parameters
----------
other : tuple of number or imgaug.augmentables.kps.Keypoint
Point to check for.
max_distance : float
Maximum allowed euclidean distance between the point and the
closest point ... | imgaug/augmentables/lines.py | def contains(self, other, max_distance=1e-4):
"""
Estimate whether the bounding box contains a point.
Parameters
----------
other : tuple of number or imgaug.augmentables.kps.Keypoint
Point to check for.
max_distance : float
Maximum allowed eucli... | def contains(self, other, max_distance=1e-4):
"""
Estimate whether the bounding box contains a point.
Parameters
----------
other : tuple of number or imgaug.augmentables.kps.Keypoint
Point to check for.
max_distance : float
Maximum allowed eucli... | [
"Estimate",
"whether",
"the",
"bounding",
"box",
"contains",
"a",
"point",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L231-L253 | [
"def",
"contains",
"(",
"self",
",",
"other",
",",
"max_distance",
"=",
"1e-4",
")",
":",
"return",
"self",
".",
"compute_distance",
"(",
"other",
",",
"default",
"=",
"np",
".",
"inf",
")",
"<",
"max_distance"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.project | Project the line string onto a differently shaped image.
E.g. if a point of the line string is on its original image at
``x=(10 of 100 pixels)`` and ``y=(20 of 100 pixels)`` and is projected
onto a new image with size ``(width=200, height=200)``, its new
position will be ``(x=20, y=40)`... | imgaug/augmentables/lines.py | def project(self, from_shape, to_shape):
"""
Project the line string onto a differently shaped image.
E.g. if a point of the line string is on its original image at
``x=(10 of 100 pixels)`` and ``y=(20 of 100 pixels)`` and is projected
onto a new image with size ``(width=200, he... | def project(self, from_shape, to_shape):
"""
Project the line string onto a differently shaped image.
E.g. if a point of the line string is on its original image at
``x=(10 of 100 pixels)`` and ``y=(20 of 100 pixels)`` and is projected
onto a new image with size ``(width=200, he... | [
"Project",
"the",
"line",
"string",
"onto",
"a",
"differently",
"shaped",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L255-L282 | [
"def",
"project",
"(",
"self",
",",
"from_shape",
",",
"to_shape",
")",
":",
"coords_proj",
"=",
"project_coords",
"(",
"self",
".",
"coords",
",",
"from_shape",
",",
"to_shape",
")",
"return",
"self",
".",
"copy",
"(",
"coords",
"=",
"coords_proj",
")"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.is_fully_within_image | Estimate whether the line string is fully inside the image area.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
default
Default value to return if the line strin... | imgaug/augmentables/lines.py | def is_fully_within_image(self, image, default=False):
"""
Estimate whether the line string is fully inside the image area.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image sh... | def is_fully_within_image(self, image, default=False):
"""
Estimate whether the line string is fully inside the image area.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image sh... | [
"Estimate",
"whether",
"the",
"line",
"string",
"is",
"fully",
"inside",
"the",
"image",
"area",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L284-L306 | [
"def",
"is_fully_within_image",
"(",
"self",
",",
"image",
",",
"default",
"=",
"False",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"==",
"0",
":",
"return",
"default",
"return",
"np",
".",
"all",
"(",
"self",
".",
"get_pointwise_inside_imag... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.is_partly_within_image | Estimate whether the line string is at least partially inside the image.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
default
Default value to return if the li... | imgaug/augmentables/lines.py | def is_partly_within_image(self, image, default=False):
"""
Estimate whether the line string is at least partially inside the image.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an... | def is_partly_within_image(self, image, default=False):
"""
Estimate whether the line string is at least partially inside the image.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an... | [
"Estimate",
"whether",
"the",
"line",
"string",
"is",
"at",
"least",
"partially",
"inside",
"the",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L308-L335 | [
"def",
"is_partly_within_image",
"(",
"self",
",",
"image",
",",
"default",
"=",
"False",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"==",
"0",
":",
"return",
"default",
"# check mask first to avoid costly computation of intersection points",
"# wheneve... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.is_out_of_image | Estimate whether the line is partially/fully outside of the image area.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
fully : bool, optional
Whether to return T... | imgaug/augmentables/lines.py | def is_out_of_image(self, image, fully=True, partly=False, default=True):
"""
Estimate whether the line is partially/fully outside of the image area.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
... | def is_out_of_image(self, image, fully=True, partly=False, default=True):
"""
Estimate whether the line is partially/fully outside of the image area.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
... | [
"Estimate",
"whether",
"the",
"line",
"is",
"partially",
"/",
"fully",
"outside",
"of",
"the",
"image",
"area",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L337-L375 | [
"def",
"is_out_of_image",
"(",
"self",
",",
"image",
",",
"fully",
"=",
"True",
",",
"partly",
"=",
"False",
",",
"default",
"=",
"True",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"==",
"0",
":",
"return",
"default",
"if",
"self",
"."... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.clip_out_of_image | Clip off all parts of the line_string that are outside of the image.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
Returns
-------
list of imgaug.augmentabl... | imgaug/augmentables/lines.py | def clip_out_of_image(self, image):
"""
Clip off all parts of the line_string that are outside of the image.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
R... | def clip_out_of_image(self, image):
"""
Clip off all parts of the line_string that are outside of the image.
Parameters
----------
image : ndarray or tuple of int
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
R... | [
"Clip",
"off",
"all",
"parts",
"of",
"the",
"line_string",
"that",
"are",
"outside",
"of",
"the",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L377-L488 | [
"def",
"clip_out_of_image",
"(",
"self",
",",
"image",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"==",
"0",
":",
"return",
"[",
"]",
"inside_image_mask",
"=",
"self",
".",
"get_pointwise_inside_image_mask",
"(",
"image",
")",
"ooi_mask",
"=",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.find_intersections_with | Find all intersection points between the line string and `other`.
Parameters
----------
other : tuple of number or list of tuple of number or \
list of LineString or LineString
The other geometry to use during intersection tests.
Returns
-------
... | imgaug/augmentables/lines.py | def find_intersections_with(self, other):
"""
Find all intersection points between the line string and `other`.
Parameters
----------
other : tuple of number or list of tuple of number or \
list of LineString or LineString
The other geometry to use du... | def find_intersections_with(self, other):
"""
Find all intersection points between the line string and `other`.
Parameters
----------
other : tuple of number or list of tuple of number or \
list of LineString or LineString
The other geometry to use du... | [
"Find",
"all",
"intersection",
"points",
"between",
"the",
"line",
"string",
"and",
"other",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L491-L540 | [
"def",
"find_intersections_with",
"(",
"self",
",",
"other",
")",
":",
"import",
"shapely",
".",
"geometry",
"geom",
"=",
"_convert_var_to_shapely_geometry",
"(",
"other",
")",
"result",
"=",
"[",
"]",
"for",
"p_start",
",",
"p_end",
"in",
"zip",
"(",
"self"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.shift | Shift/move the line string from one or more image sides.
Parameters
----------
top : None or int, optional
Amount of pixels by which to shift the bounding box from the
top.
right : None or int, optional
Amount of pixels by which to shift the bounding... | imgaug/augmentables/lines.py | def shift(self, top=None, right=None, bottom=None, left=None):
"""
Shift/move the line string from one or more image sides.
Parameters
----------
top : None or int, optional
Amount of pixels by which to shift the bounding box from the
top.
right ... | def shift(self, top=None, right=None, bottom=None, left=None):
"""
Shift/move the line string from one or more image sides.
Parameters
----------
top : None or int, optional
Amount of pixels by which to shift the bounding box from the
top.
right ... | [
"Shift",
"/",
"move",
"the",
"line",
"string",
"from",
"one",
"or",
"more",
"image",
"sides",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L543-L578 | [
"def",
"shift",
"(",
"self",
",",
"top",
"=",
"None",
",",
"right",
"=",
"None",
",",
"bottom",
"=",
"None",
",",
"left",
"=",
"None",
")",
":",
"top",
"=",
"top",
"if",
"top",
"is",
"not",
"None",
"else",
"0",
"right",
"=",
"right",
"if",
"rig... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.draw_mask | Draw this line segment as a binary image mask.
Parameters
----------
image_shape : tuple of int
The shape of the image onto which to draw the line mask.
size_lines : int, optional
Thickness of the line segments.
size_points : int, optional
S... | imgaug/augmentables/lines.py | def draw_mask(self, image_shape, size_lines=1, size_points=0,
raise_if_out_of_image=False):
"""
Draw this line segment as a binary image mask.
Parameters
----------
image_shape : tuple of int
The shape of the image onto which to draw the line mask.
... | def draw_mask(self, image_shape, size_lines=1, size_points=0,
raise_if_out_of_image=False):
"""
Draw this line segment as a binary image mask.
Parameters
----------
image_shape : tuple of int
The shape of the image onto which to draw the line mask.
... | [
"Draw",
"this",
"line",
"segment",
"as",
"a",
"binary",
"image",
"mask",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L580-L613 | [
"def",
"draw_mask",
"(",
"self",
",",
"image_shape",
",",
"size_lines",
"=",
"1",
",",
"size_points",
"=",
"0",
",",
"raise_if_out_of_image",
"=",
"False",
")",
":",
"heatmap",
"=",
"self",
".",
"draw_heatmap_array",
"(",
"image_shape",
",",
"alpha_lines",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.draw_lines_heatmap_array | Draw the line segments of the line string as a heatmap array.
Parameters
----------
image_shape : tuple of int
The shape of the image onto which to draw the line mask.
alpha : float, optional
Opacity of the line string. Higher values denote a more visible
... | imgaug/augmentables/lines.py | def draw_lines_heatmap_array(self, image_shape, alpha=1.0,
size=1, antialiased=True,
raise_if_out_of_image=False):
"""
Draw the line segments of the line string as a heatmap array.
Parameters
----------
image_shap... | def draw_lines_heatmap_array(self, image_shape, alpha=1.0,
size=1, antialiased=True,
raise_if_out_of_image=False):
"""
Draw the line segments of the line string as a heatmap array.
Parameters
----------
image_shap... | [
"Draw",
"the",
"line",
"segments",
"of",
"the",
"line",
"string",
"as",
"a",
"heatmap",
"array",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L615-L659 | [
"def",
"draw_lines_heatmap_array",
"(",
"self",
",",
"image_shape",
",",
"alpha",
"=",
"1.0",
",",
"size",
"=",
"1",
",",
"antialiased",
"=",
"True",
",",
"raise_if_out_of_image",
"=",
"False",
")",
":",
"assert",
"len",
"(",
"image_shape",
")",
"==",
"2",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.draw_points_heatmap_array | Draw the points of the line string as a heatmap array.
Parameters
----------
image_shape : tuple of int
The shape of the image onto which to draw the point mask.
alpha : float, optional
Opacity of the line string points. Higher values denote a more
v... | imgaug/augmentables/lines.py | def draw_points_heatmap_array(self, image_shape, alpha=1.0,
size=1, raise_if_out_of_image=False):
"""
Draw the points of the line string as a heatmap array.
Parameters
----------
image_shape : tuple of int
The shape of the image onto... | def draw_points_heatmap_array(self, image_shape, alpha=1.0,
size=1, raise_if_out_of_image=False):
"""
Draw the points of the line string as a heatmap array.
Parameters
----------
image_shape : tuple of int
The shape of the image onto... | [
"Draw",
"the",
"points",
"of",
"the",
"line",
"string",
"as",
"a",
"heatmap",
"array",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L661-L700 | [
"def",
"draw_points_heatmap_array",
"(",
"self",
",",
"image_shape",
",",
"alpha",
"=",
"1.0",
",",
"size",
"=",
"1",
",",
"raise_if_out_of_image",
"=",
"False",
")",
":",
"assert",
"len",
"(",
"image_shape",
")",
"==",
"2",
"or",
"(",
"len",
"(",
"image... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.draw_heatmap_array | Draw the line segments and points of the line string as a heatmap array.
Parameters
----------
image_shape : tuple of int
The shape of the image onto which to draw the line mask.
alpha_lines : float, optional
Opacity of the line string. Higher values denote a mo... | imgaug/augmentables/lines.py | def draw_heatmap_array(self, image_shape, alpha_lines=1.0, alpha_points=1.0,
size_lines=1, size_points=0, antialiased=True,
raise_if_out_of_image=False):
"""
Draw the line segments and points of the line string as a heatmap array.
Parameters... | def draw_heatmap_array(self, image_shape, alpha_lines=1.0, alpha_points=1.0,
size_lines=1, size_points=0, antialiased=True,
raise_if_out_of_image=False):
"""
Draw the line segments and points of the line string as a heatmap array.
Parameters... | [
"Draw",
"the",
"line",
"segments",
"and",
"points",
"of",
"the",
"line",
"string",
"as",
"a",
"heatmap",
"array",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L702-L759 | [
"def",
"draw_heatmap_array",
"(",
"self",
",",
"image_shape",
",",
"alpha_lines",
"=",
"1.0",
",",
"alpha_points",
"=",
"1.0",
",",
"size_lines",
"=",
"1",
",",
"size_points",
"=",
"0",
",",
"antialiased",
"=",
"True",
",",
"raise_if_out_of_image",
"=",
"Fal... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.draw_lines_on_image | Draw the line segments of the line string on a given image.
Parameters
----------
image : ndarray or tuple of int
The image onto which to draw.
Expected to be ``uint8`` and of shape ``(H, W, C)`` with ``C``
usually being ``3`` (other values are not tested).
... | imgaug/augmentables/lines.py | def draw_lines_on_image(self, image, color=(0, 255, 0),
alpha=1.0, size=3,
antialiased=True,
raise_if_out_of_image=False):
"""
Draw the line segments of the line string on a given image.
Parameters
-----... | def draw_lines_on_image(self, image, color=(0, 255, 0),
alpha=1.0, size=3,
antialiased=True,
raise_if_out_of_image=False):
"""
Draw the line segments of the line string on a given image.
Parameters
-----... | [
"Draw",
"the",
"line",
"segments",
"of",
"the",
"line",
"string",
"on",
"a",
"given",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L763-L887 | [
"def",
"draw_lines_on_image",
"(",
"self",
",",
"image",
",",
"color",
"=",
"(",
"0",
",",
"255",
",",
"0",
")",
",",
"alpha",
"=",
"1.0",
",",
"size",
"=",
"3",
",",
"antialiased",
"=",
"True",
",",
"raise_if_out_of_image",
"=",
"False",
")",
":",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.draw_points_on_image | Draw the points of the line string on a given image.
Parameters
----------
image : ndarray or tuple of int
The image onto which to draw.
Expected to be ``uint8`` and of shape ``(H, W, C)`` with ``C``
usually being ``3`` (other values are not tested).
... | imgaug/augmentables/lines.py | def draw_points_on_image(self, image, color=(0, 128, 0),
alpha=1.0, size=3,
copy=True, raise_if_out_of_image=False):
"""
Draw the points of the line string on a given image.
Parameters
----------
image : ndarray or tuple ... | def draw_points_on_image(self, image, color=(0, 128, 0),
alpha=1.0, size=3,
copy=True, raise_if_out_of_image=False):
"""
Draw the points of the line string on a given image.
Parameters
----------
image : ndarray or tuple ... | [
"Draw",
"the",
"points",
"of",
"the",
"line",
"string",
"on",
"a",
"given",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L889-L939 | [
"def",
"draw_points_on_image",
"(",
"self",
",",
"image",
",",
"color",
"=",
"(",
"0",
",",
"128",
",",
"0",
")",
",",
"alpha",
"=",
"1.0",
",",
"size",
"=",
"3",
",",
"copy",
"=",
"True",
",",
"raise_if_out_of_image",
"=",
"False",
")",
":",
"from... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.draw_on_image | Draw the line string on an image.
Parameters
----------
image : ndarray
The `(H,W,C)` `uint8` image onto which to draw the line string.
color : iterable of int, optional
Color to use as RGB, i.e. three values.
The color of the line and points are der... | imgaug/augmentables/lines.py | def draw_on_image(self, image,
color=(0, 255, 0), color_lines=None, color_points=None,
alpha=1.0, alpha_lines=None, alpha_points=None,
size=1, size_lines=None, size_points=None,
antialiased=True,
raise_if_out_o... | def draw_on_image(self, image,
color=(0, 255, 0), color_lines=None, color_points=None,
alpha=1.0, alpha_lines=None, alpha_points=None,
size=1, size_lines=None, size_points=None,
antialiased=True,
raise_if_out_o... | [
"Draw",
"the",
"line",
"string",
"on",
"an",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L941-L1041 | [
"def",
"draw_on_image",
"(",
"self",
",",
"image",
",",
"color",
"=",
"(",
"0",
",",
"255",
",",
"0",
")",
",",
"color_lines",
"=",
"None",
",",
"color_points",
"=",
"None",
",",
"alpha",
"=",
"1.0",
",",
"alpha_lines",
"=",
"None",
",",
"alpha_point... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.extract_from_image | Extract the image pixels covered by the line string.
It will only extract pixels overlapped by the line string.
This function will by default zero-pad the image if the line string is
partially/fully outside of the image. This is for consistency with
the same implementations for boundin... | imgaug/augmentables/lines.py | def extract_from_image(self, image, size=1, pad=True, pad_max=None,
antialiased=True, prevent_zero_size=True):
"""
Extract the image pixels covered by the line string.
It will only extract pixels overlapped by the line string.
This function will by default ze... | def extract_from_image(self, image, size=1, pad=True, pad_max=None,
antialiased=True, prevent_zero_size=True):
"""
Extract the image pixels covered by the line string.
It will only extract pixels overlapped by the line string.
This function will by default ze... | [
"Extract",
"the",
"image",
"pixels",
"covered",
"by",
"the",
"line",
"string",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1043-L1135 | [
"def",
"extract_from_image",
"(",
"self",
",",
"image",
",",
"size",
"=",
"1",
",",
"pad",
"=",
"True",
",",
"pad_max",
"=",
"None",
",",
"antialiased",
"=",
"True",
",",
"prevent_zero_size",
"=",
"True",
")",
":",
"from",
".",
"bbs",
"import",
"Boundi... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.concatenate | Concatenate this line string with another one.
This will add a line segment between the end point of this line string
and the start point of `other`.
Parameters
----------
other : imgaug.augmentables.lines.LineString or ndarray \
or iterable of tuple of number
... | imgaug/augmentables/lines.py | def concatenate(self, other):
"""
Concatenate this line string with another one.
This will add a line segment between the end point of this line string
and the start point of `other`.
Parameters
----------
other : imgaug.augmentables.lines.LineString or ndarray ... | def concatenate(self, other):
"""
Concatenate this line string with another one.
This will add a line segment between the end point of this line string
and the start point of `other`.
Parameters
----------
other : imgaug.augmentables.lines.LineString or ndarray ... | [
"Concatenate",
"this",
"line",
"string",
"with",
"another",
"one",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1137-L1160 | [
"def",
"concatenate",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"LineString",
")",
":",
"other",
"=",
"LineString",
"(",
"other",
")",
"return",
"self",
".",
"deepcopy",
"(",
"coords",
"=",
"np",
".",
"concatena... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.subdivide | Adds ``N`` interpolated points with uniform spacing to each edge.
For each edge between points ``A`` and ``B`` this adds points
at ``A + (i/(1+N)) * (B - A)``, where ``i`` is the index of the added
point and ``N`` is the number of points to add per edge.
Calling this method two times w... | imgaug/augmentables/lines.py | def subdivide(self, points_per_edge):
"""
Adds ``N`` interpolated points with uniform spacing to each edge.
For each edge between points ``A`` and ``B`` this adds points
at ``A + (i/(1+N)) * (B - A)``, where ``i`` is the index of the added
point and ``N`` is the number of points... | def subdivide(self, points_per_edge):
"""
Adds ``N`` interpolated points with uniform spacing to each edge.
For each edge between points ``A`` and ``B`` this adds points
at ``A + (i/(1+N)) * (B - A)``, where ``i`` is the index of the added
point and ``N`` is the number of points... | [
"Adds",
"N",
"interpolated",
"points",
"with",
"uniform",
"spacing",
"to",
"each",
"edge",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1163-L1190 | [
"def",
"subdivide",
"(",
"self",
",",
"points_per_edge",
")",
":",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"<=",
"1",
"or",
"points_per_edge",
"<",
"1",
":",
"return",
"self",
".",
"deepcopy",
"(",
")",
"coords",
"=",
"interpolate_points",
"(",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.to_keypoints | Convert the line string points to keypoints.
Returns
-------
list of imgaug.augmentables.kps.Keypoint
Points of the line string as keypoints. | imgaug/augmentables/lines.py | def to_keypoints(self):
"""
Convert the line string points to keypoints.
Returns
-------
list of imgaug.augmentables.kps.Keypoint
Points of the line string as keypoints.
"""
# TODO get rid of this deferred import
from imgaug.augmentables.kps ... | def to_keypoints(self):
"""
Convert the line string points to keypoints.
Returns
-------
list of imgaug.augmentables.kps.Keypoint
Points of the line string as keypoints.
"""
# TODO get rid of this deferred import
from imgaug.augmentables.kps ... | [
"Convert",
"the",
"line",
"string",
"points",
"to",
"keypoints",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1192-L1204 | [
"def",
"to_keypoints",
"(",
"self",
")",
":",
"# TODO get rid of this deferred import",
"from",
"imgaug",
".",
"augmentables",
".",
"kps",
"import",
"Keypoint",
"return",
"[",
"Keypoint",
"(",
"x",
"=",
"x",
",",
"y",
"=",
"y",
")",
"for",
"(",
"x",
",",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.to_bounding_box | Generate a bounding box encapsulating the line string.
Returns
-------
None or imgaug.augmentables.bbs.BoundingBox
Bounding box encapsulating the line string.
``None`` if the line string contained no points. | imgaug/augmentables/lines.py | def to_bounding_box(self):
"""
Generate a bounding box encapsulating the line string.
Returns
-------
None or imgaug.augmentables.bbs.BoundingBox
Bounding box encapsulating the line string.
``None`` if the line string contained no points.
"""
... | def to_bounding_box(self):
"""
Generate a bounding box encapsulating the line string.
Returns
-------
None or imgaug.augmentables.bbs.BoundingBox
Bounding box encapsulating the line string.
``None`` if the line string contained no points.
"""
... | [
"Generate",
"a",
"bounding",
"box",
"encapsulating",
"the",
"line",
"string",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1206-L1224 | [
"def",
"to_bounding_box",
"(",
"self",
")",
":",
"from",
".",
"bbs",
"import",
"BoundingBox",
"# we don't have to mind the case of len(.) == 1 here, because",
"# zero-sized BBs are considered valid",
"if",
"len",
"(",
"self",
".",
"coords",
")",
"==",
"0",
":",
"return"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.to_polygon | Generate a polygon from the line string points.
Returns
-------
imgaug.augmentables.polys.Polygon
Polygon with the same corner points as the line string.
Note that the polygon might be invalid, e.g. contain less than 3
points or have self-intersections. | imgaug/augmentables/lines.py | def to_polygon(self):
"""
Generate a polygon from the line string points.
Returns
-------
imgaug.augmentables.polys.Polygon
Polygon with the same corner points as the line string.
Note that the polygon might be invalid, e.g. contain less than 3
... | def to_polygon(self):
"""
Generate a polygon from the line string points.
Returns
-------
imgaug.augmentables.polys.Polygon
Polygon with the same corner points as the line string.
Note that the polygon might be invalid, e.g. contain less than 3
... | [
"Generate",
"a",
"polygon",
"from",
"the",
"line",
"string",
"points",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1226-L1239 | [
"def",
"to_polygon",
"(",
"self",
")",
":",
"from",
".",
"polys",
"import",
"Polygon",
"return",
"Polygon",
"(",
"self",
".",
"coords",
",",
"label",
"=",
"self",
".",
"label",
")"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.to_heatmap | Generate a heatmap object from the line string.
This is similar to
:func:`imgaug.augmentables.lines.LineString.draw_lines_heatmap_array`
executed with ``alpha=1.0``. The result is wrapped in a
``HeatmapsOnImage`` object instead of just an array.
No points are drawn.
Par... | imgaug/augmentables/lines.py | def to_heatmap(self, image_shape, size_lines=1, size_points=0,
antialiased=True, raise_if_out_of_image=False):
"""
Generate a heatmap object from the line string.
This is similar to
:func:`imgaug.augmentables.lines.LineString.draw_lines_heatmap_array`
executed... | def to_heatmap(self, image_shape, size_lines=1, size_points=0,
antialiased=True, raise_if_out_of_image=False):
"""
Generate a heatmap object from the line string.
This is similar to
:func:`imgaug.augmentables.lines.LineString.draw_lines_heatmap_array`
executed... | [
"Generate",
"a",
"heatmap",
"object",
"from",
"the",
"line",
"string",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1241-L1284 | [
"def",
"to_heatmap",
"(",
"self",
",",
"image_shape",
",",
"size_lines",
"=",
"1",
",",
"size_points",
"=",
"0",
",",
"antialiased",
"=",
"True",
",",
"raise_if_out_of_image",
"=",
"False",
")",
":",
"from",
".",
"heatmaps",
"import",
"HeatmapsOnImage",
"ret... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.to_segmentation_map | Generate a segmentation map object from the line string.
This is similar to
:func:`imgaug.augmentables.lines.LineString.draw_mask`.
The result is wrapped in a ``SegmentationMapOnImage`` object
instead of just an array.
Parameters
----------
image_shape : tuple o... | imgaug/augmentables/lines.py | def to_segmentation_map(self, image_shape, size_lines=1, size_points=0,
raise_if_out_of_image=False):
"""
Generate a segmentation map object from the line string.
This is similar to
:func:`imgaug.augmentables.lines.LineString.draw_mask`.
The result is... | def to_segmentation_map(self, image_shape, size_lines=1, size_points=0,
raise_if_out_of_image=False):
"""
Generate a segmentation map object from the line string.
This is similar to
:func:`imgaug.augmentables.lines.LineString.draw_mask`.
The result is... | [
"Generate",
"a",
"segmentation",
"map",
"object",
"from",
"the",
"line",
"string",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1286-L1324 | [
"def",
"to_segmentation_map",
"(",
"self",
",",
"image_shape",
",",
"size_lines",
"=",
"1",
",",
"size_points",
"=",
"0",
",",
"raise_if_out_of_image",
"=",
"False",
")",
":",
"from",
".",
"segmaps",
"import",
"SegmentationMapOnImage",
"return",
"SegmentationMapOn... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.coords_almost_equals | Compare this and another LineString's coordinates.
This is an approximate method based on pointwise distances and can
in rare corner cases produce wrong outputs.
Parameters
----------
other : imgaug.augmentables.lines.LineString \
or tuple of number \
... | imgaug/augmentables/lines.py | def coords_almost_equals(self, other, max_distance=1e-6, points_per_edge=8):
"""
Compare this and another LineString's coordinates.
This is an approximate method based on pointwise distances and can
in rare corner cases produce wrong outputs.
Parameters
----------
... | def coords_almost_equals(self, other, max_distance=1e-6, points_per_edge=8):
"""
Compare this and another LineString's coordinates.
This is an approximate method based on pointwise distances and can
in rare corner cases produce wrong outputs.
Parameters
----------
... | [
"Compare",
"this",
"and",
"another",
"LineString",
"s",
"coordinates",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1327-L1379 | [
"def",
"coords_almost_equals",
"(",
"self",
",",
"other",
",",
"max_distance",
"=",
"1e-6",
",",
"points_per_edge",
"=",
"8",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"LineString",
")",
":",
"pass",
"elif",
"isinstance",
"(",
"other",
",",
"tuple",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.almost_equals | Compare this and another LineString.
Parameters
----------
other: imgaug.augmentables.lines.LineString
The other line string. Must be a LineString instance, not just
its coordinates.
max_distance : float, optional
See :func:`imgaug.augmentables.lines... | imgaug/augmentables/lines.py | def almost_equals(self, other, max_distance=1e-4, points_per_edge=8):
"""
Compare this and another LineString.
Parameters
----------
other: imgaug.augmentables.lines.LineString
The other line string. Must be a LineString instance, not just
its coordinates... | def almost_equals(self, other, max_distance=1e-4, points_per_edge=8):
"""
Compare this and another LineString.
Parameters
----------
other: imgaug.augmentables.lines.LineString
The other line string. Must be a LineString instance, not just
its coordinates... | [
"Compare",
"this",
"and",
"another",
"LineString",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1381-L1408 | [
"def",
"almost_equals",
"(",
"self",
",",
"other",
",",
"max_distance",
"=",
"1e-4",
",",
"points_per_edge",
"=",
"8",
")",
":",
"if",
"self",
".",
"label",
"!=",
"other",
".",
"label",
":",
"return",
"False",
"return",
"self",
".",
"coords_almost_equals",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.copy | Create a shallow copy of the LineString object.
Parameters
----------
coords : None or iterable of tuple of number or ndarray
If not ``None``, then the coords of the copied object will be set
to this value.
label : None or str
If not ``None``, then t... | imgaug/augmentables/lines.py | def copy(self, coords=None, label=None):
"""
Create a shallow copy of the LineString object.
Parameters
----------
coords : None or iterable of tuple of number or ndarray
If not ``None``, then the coords of the copied object will be set
to this value.
... | def copy(self, coords=None, label=None):
"""
Create a shallow copy of the LineString object.
Parameters
----------
coords : None or iterable of tuple of number or ndarray
If not ``None``, then the coords of the copied object will be set
to this value.
... | [
"Create",
"a",
"shallow",
"copy",
"of",
"the",
"LineString",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1410-L1431 | [
"def",
"copy",
"(",
"self",
",",
"coords",
"=",
"None",
",",
"label",
"=",
"None",
")",
":",
"return",
"LineString",
"(",
"coords",
"=",
"self",
".",
"coords",
"if",
"coords",
"is",
"None",
"else",
"coords",
",",
"label",
"=",
"self",
".",
"label",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineString.deepcopy | Create a deep copy of the BoundingBox object.
Parameters
----------
coords : None or iterable of tuple of number or ndarray
If not ``None``, then the coords of the copied object will be set
to this value.
label : None or str
If not ``None``, then the... | imgaug/augmentables/lines.py | def deepcopy(self, coords=None, label=None):
"""
Create a deep copy of the BoundingBox object.
Parameters
----------
coords : None or iterable of tuple of number or ndarray
If not ``None``, then the coords of the copied object will be set
to this value.
... | def deepcopy(self, coords=None, label=None):
"""
Create a deep copy of the BoundingBox object.
Parameters
----------
coords : None or iterable of tuple of number or ndarray
If not ``None``, then the coords of the copied object will be set
to this value.
... | [
"Create",
"a",
"deep",
"copy",
"of",
"the",
"BoundingBox",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1433-L1455 | [
"def",
"deepcopy",
"(",
"self",
",",
"coords",
"=",
"None",
",",
"label",
"=",
"None",
")",
":",
"return",
"LineString",
"(",
"coords",
"=",
"np",
".",
"copy",
"(",
"self",
".",
"coords",
")",
"if",
"coords",
"is",
"None",
"else",
"coords",
",",
"l... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.on | Project bounding boxes from one image to a new one.
Parameters
----------
image : ndarray or tuple of int
The new image onto which to project.
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image shape.
Returns
-------
... | imgaug/augmentables/lines.py | def on(self, image):
"""
Project bounding boxes from one image to a new one.
Parameters
----------
image : ndarray or tuple of int
The new image onto which to project.
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image ... | def on(self, image):
"""
Project bounding boxes from one image to a new one.
Parameters
----------
image : ndarray or tuple of int
The new image onto which to project.
Either an image with shape ``(H,W,[C])`` or a tuple denoting
such an image ... | [
"Project",
"bounding",
"boxes",
"from",
"one",
"image",
"to",
"a",
"new",
"one",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1530-L1552 | [
"def",
"on",
"(",
"self",
",",
"image",
")",
":",
"shape",
"=",
"normalize_shape",
"(",
"image",
")",
"if",
"shape",
"[",
"0",
":",
"2",
"]",
"==",
"self",
".",
"shape",
"[",
"0",
":",
"2",
"]",
":",
"return",
"self",
".",
"deepcopy",
"(",
")",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.from_xy_arrays | Convert an `(N,M,2)` ndarray to a LineStringsOnImage object.
This is the inverse of
:func:`imgaug.augmentables.lines.LineStringsOnImage.to_xy_array`.
Parameters
----------
xy : (N,M,2) ndarray or iterable of (M,2) ndarray
Array containing the point coordinates ``N``... | imgaug/augmentables/lines.py | def from_xy_arrays(cls, xy, shape):
"""
Convert an `(N,M,2)` ndarray to a LineStringsOnImage object.
This is the inverse of
:func:`imgaug.augmentables.lines.LineStringsOnImage.to_xy_array`.
Parameters
----------
xy : (N,M,2) ndarray or iterable of (M,2) ndarray
... | def from_xy_arrays(cls, xy, shape):
"""
Convert an `(N,M,2)` ndarray to a LineStringsOnImage object.
This is the inverse of
:func:`imgaug.augmentables.lines.LineStringsOnImage.to_xy_array`.
Parameters
----------
xy : (N,M,2) ndarray or iterable of (M,2) ndarray
... | [
"Convert",
"an",
"(",
"N",
"M",
"2",
")",
"ndarray",
"to",
"a",
"LineStringsOnImage",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1555-L1584 | [
"def",
"from_xy_arrays",
"(",
"cls",
",",
"xy",
",",
"shape",
")",
":",
"lss",
"=",
"[",
"]",
"for",
"xy_ls",
"in",
"xy",
":",
"lss",
".",
"append",
"(",
"LineString",
"(",
"xy_ls",
")",
")",
"return",
"cls",
"(",
"lss",
",",
"shape",
")"
] | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.to_xy_arrays | Convert this object to an iterable of ``(M,2)`` arrays of points.
This is the inverse of
:func:`imgaug.augmentables.lines.LineStringsOnImage.from_xy_array`.
Parameters
----------
dtype : numpy.dtype, optional
Desired output datatype of the ndarray.
Returns
... | imgaug/augmentables/lines.py | def to_xy_arrays(self, dtype=np.float32):
"""
Convert this object to an iterable of ``(M,2)`` arrays of points.
This is the inverse of
:func:`imgaug.augmentables.lines.LineStringsOnImage.from_xy_array`.
Parameters
----------
dtype : numpy.dtype, optional
... | def to_xy_arrays(self, dtype=np.float32):
"""
Convert this object to an iterable of ``(M,2)`` arrays of points.
This is the inverse of
:func:`imgaug.augmentables.lines.LineStringsOnImage.from_xy_array`.
Parameters
----------
dtype : numpy.dtype, optional
... | [
"Convert",
"this",
"object",
"to",
"an",
"iterable",
"of",
"(",
"M",
"2",
")",
"arrays",
"of",
"points",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1586-L1606 | [
"def",
"to_xy_arrays",
"(",
"self",
",",
"dtype",
"=",
"np",
".",
"float32",
")",
":",
"from",
".",
".",
"import",
"dtypes",
"as",
"iadt",
"return",
"[",
"iadt",
".",
"restore_dtypes_",
"(",
"np",
".",
"copy",
"(",
"ls",
".",
"coords",
")",
",",
"d... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.draw_on_image | Draw all line strings onto a given image.
Parameters
----------
image : ndarray
The `(H,W,C)` `uint8` image onto which to draw the line strings.
color : iterable of int, optional
Color to use as RGB, i.e. three values.
The color of the lines and poin... | imgaug/augmentables/lines.py | def draw_on_image(self, image,
color=(0, 255, 0), color_lines=None, color_points=None,
alpha=1.0, alpha_lines=None, alpha_points=None,
size=1, size_lines=None, size_points=None,
antialiased=True,
raise_if_out_o... | def draw_on_image(self, image,
color=(0, 255, 0), color_lines=None, color_points=None,
alpha=1.0, alpha_lines=None, alpha_points=None,
size=1, size_lines=None, size_points=None,
antialiased=True,
raise_if_out_o... | [
"Draw",
"all",
"line",
"strings",
"onto",
"a",
"given",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1608-L1690 | [
"def",
"draw_on_image",
"(",
"self",
",",
"image",
",",
"color",
"=",
"(",
"0",
",",
"255",
",",
"0",
")",
",",
"color_lines",
"=",
"None",
",",
"color_points",
"=",
"None",
",",
"alpha",
"=",
"1.0",
",",
"alpha_lines",
"=",
"None",
",",
"alpha_point... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.remove_out_of_image | Remove all line strings that are fully/partially outside of the image.
Parameters
----------
fully : bool, optional
Whether to remove line strings that are fully outside of the image.
partly : bool, optional
Whether to remove line strings that are partially outs... | imgaug/augmentables/lines.py | def remove_out_of_image(self, fully=True, partly=False):
"""
Remove all line strings that are fully/partially outside of the image.
Parameters
----------
fully : bool, optional
Whether to remove line strings that are fully outside of the image.
partly : bool... | def remove_out_of_image(self, fully=True, partly=False):
"""
Remove all line strings that are fully/partially outside of the image.
Parameters
----------
fully : bool, optional
Whether to remove line strings that are fully outside of the image.
partly : bool... | [
"Remove",
"all",
"line",
"strings",
"that",
"are",
"fully",
"/",
"partially",
"outside",
"of",
"the",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1692-L1715 | [
"def",
"remove_out_of_image",
"(",
"self",
",",
"fully",
"=",
"True",
",",
"partly",
"=",
"False",
")",
":",
"lss_clean",
"=",
"[",
"ls",
"for",
"ls",
"in",
"self",
".",
"line_strings",
"if",
"not",
"ls",
".",
"is_out_of_image",
"(",
"self",
".",
"shap... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.clip_out_of_image | Clip off all parts of the line strings that are outside of the image.
Returns
-------
imgaug.augmentables.lines.LineStringsOnImage
Line strings, clipped to fall within the image dimensions. | imgaug/augmentables/lines.py | def clip_out_of_image(self):
"""
Clip off all parts of the line strings that are outside of the image.
Returns
-------
imgaug.augmentables.lines.LineStringsOnImage
Line strings, clipped to fall within the image dimensions.
"""
lss_cut = [ls_clipped
... | def clip_out_of_image(self):
"""
Clip off all parts of the line strings that are outside of the image.
Returns
-------
imgaug.augmentables.lines.LineStringsOnImage
Line strings, clipped to fall within the image dimensions.
"""
lss_cut = [ls_clipped
... | [
"Clip",
"off",
"all",
"parts",
"of",
"the",
"line",
"strings",
"that",
"are",
"outside",
"of",
"the",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1717-L1730 | [
"def",
"clip_out_of_image",
"(",
"self",
")",
":",
"lss_cut",
"=",
"[",
"ls_clipped",
"for",
"ls",
"in",
"self",
".",
"line_strings",
"for",
"ls_clipped",
"in",
"ls",
".",
"clip_out_of_image",
"(",
"self",
".",
"shape",
")",
"]",
"return",
"LineStringsOnImag... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.shift | Shift/move the line strings from one or more image sides.
Parameters
----------
top : None or int, optional
Amount of pixels by which to shift all bounding boxes from the
top.
right : None or int, optional
Amount of pixels by which to shift all bound... | imgaug/augmentables/lines.py | def shift(self, top=None, right=None, bottom=None, left=None):
"""
Shift/move the line strings from one or more image sides.
Parameters
----------
top : None or int, optional
Amount of pixels by which to shift all bounding boxes from the
top.
rig... | def shift(self, top=None, right=None, bottom=None, left=None):
"""
Shift/move the line strings from one or more image sides.
Parameters
----------
top : None or int, optional
Amount of pixels by which to shift all bounding boxes from the
top.
rig... | [
"Shift",
"/",
"move",
"the",
"line",
"strings",
"from",
"one",
"or",
"more",
"image",
"sides",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1732-L1762 | [
"def",
"shift",
"(",
"self",
",",
"top",
"=",
"None",
",",
"right",
"=",
"None",
",",
"bottom",
"=",
"None",
",",
"left",
"=",
"None",
")",
":",
"lss_new",
"=",
"[",
"ls",
".",
"shift",
"(",
"top",
"=",
"top",
",",
"right",
"=",
"right",
",",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.copy | Create a shallow copy of the LineStringsOnImage object.
Parameters
----------
line_strings : None \
or list of imgaug.augmentables.lines.LineString, optional
List of line strings on the image.
If not ``None``, then the ``line_strings`` attribute of... | imgaug/augmentables/lines.py | def copy(self, line_strings=None, shape=None):
"""
Create a shallow copy of the LineStringsOnImage object.
Parameters
----------
line_strings : None \
or list of imgaug.augmentables.lines.LineString, optional
List of line strings on the image.
... | def copy(self, line_strings=None, shape=None):
"""
Create a shallow copy of the LineStringsOnImage object.
Parameters
----------
line_strings : None \
or list of imgaug.augmentables.lines.LineString, optional
List of line strings on the image.
... | [
"Create",
"a",
"shallow",
"copy",
"of",
"the",
"LineStringsOnImage",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1764-L1791 | [
"def",
"copy",
"(",
"self",
",",
"line_strings",
"=",
"None",
",",
"shape",
"=",
"None",
")",
":",
"lss",
"=",
"self",
".",
"line_strings",
"if",
"line_strings",
"is",
"None",
"else",
"line_strings",
"shape",
"=",
"self",
".",
"shape",
"if",
"shape",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | LineStringsOnImage.deepcopy | Create a deep copy of the LineStringsOnImage object.
Parameters
----------
line_strings : None \
or list of imgaug.augmentables.lines.LineString, optional
List of line strings on the image.
If not ``None``, then the ``line_strings`` attribute of th... | imgaug/augmentables/lines.py | def deepcopy(self, line_strings=None, shape=None):
"""
Create a deep copy of the LineStringsOnImage object.
Parameters
----------
line_strings : None \
or list of imgaug.augmentables.lines.LineString, optional
List of line strings on the image.... | def deepcopy(self, line_strings=None, shape=None):
"""
Create a deep copy of the LineStringsOnImage object.
Parameters
----------
line_strings : None \
or list of imgaug.augmentables.lines.LineString, optional
List of line strings on the image.... | [
"Create",
"a",
"deep",
"copy",
"of",
"the",
"LineStringsOnImage",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/lines.py#L1793-L1822 | [
"def",
"deepcopy",
"(",
"self",
",",
"line_strings",
"=",
"None",
",",
"shape",
"=",
"None",
")",
":",
"lss",
"=",
"self",
".",
"line_strings",
"if",
"line_strings",
"is",
"None",
"else",
"line_strings",
"shape",
"=",
"self",
".",
"shape",
"if",
"shape",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | blend_alpha | Blend two images using an alpha blending.
In an alpha blending, the two images are naively mixed. Let ``A`` be the foreground image
and ``B`` the background image and ``a`` is the alpha value. Each pixel intensity is then
computed as ``a * A_ij + (1-a) * B_ij``.
dtype support::
* ``uint8``: y... | imgaug/augmenters/blend.py | def blend_alpha(image_fg, image_bg, alpha, eps=1e-2):
"""
Blend two images using an alpha blending.
In an alpha blending, the two images are naively mixed. Let ``A`` be the foreground image
and ``B`` the background image and ``a`` is the alpha value. Each pixel intensity is then
computed as ``a * A... | def blend_alpha(image_fg, image_bg, alpha, eps=1e-2):
"""
Blend two images using an alpha blending.
In an alpha blending, the two images are naively mixed. Let ``A`` be the foreground image
and ``B`` the background image and ``a`` is the alpha value. Each pixel intensity is then
computed as ``a * A... | [
"Blend",
"two",
"images",
"using",
"an",
"alpha",
"blending",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/blend.py#L34-L165 | [
"def",
"blend_alpha",
"(",
"image_fg",
",",
"image_bg",
",",
"alpha",
",",
"eps",
"=",
"1e-2",
")",
":",
"assert",
"image_fg",
".",
"shape",
"==",
"image_bg",
".",
"shape",
"assert",
"image_fg",
".",
"dtype",
".",
"kind",
"==",
"image_bg",
".",
"dtype",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SimplexNoiseAlpha | Augmenter to alpha-blend two image sources using simplex noise alpha masks.
The alpha masks are sampled using a simplex noise method, roughly creating
connected blobs of 1s surrounded by 0s. If nearest neighbour upsampling
is used, these blobs can be rectangular with sharp edges.
dtype support::
... | imgaug/augmenters/blend.py | def SimplexNoiseAlpha(first=None, second=None, per_channel=False, size_px_max=(2, 16), upscale_method=None,
iterations=(1, 3), aggregation_method="max", sigmoid=True, sigmoid_thresh=None,
name=None, deterministic=False, random_state=None):
"""
Augmenter to alpha-blend... | def SimplexNoiseAlpha(first=None, second=None, per_channel=False, size_px_max=(2, 16), upscale_method=None,
iterations=(1, 3), aggregation_method="max", sigmoid=True, sigmoid_thresh=None,
name=None, deterministic=False, random_state=None):
"""
Augmenter to alpha-blend... | [
"Augmenter",
"to",
"alpha",
"-",
"blend",
"two",
"image",
"sources",
"using",
"simplex",
"noise",
"alpha",
"masks",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/blend.py#L797-L980 | [
"def",
"SimplexNoiseAlpha",
"(",
"first",
"=",
"None",
",",
"second",
"=",
"None",
",",
"per_channel",
"=",
"False",
",",
"size_px_max",
"=",
"(",
"2",
",",
"16",
")",
",",
"upscale_method",
"=",
"None",
",",
"iterations",
"=",
"(",
"1",
",",
"3",
")... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | OneOf | Augmenter that always executes exactly one of its children.
dtype support::
See ``imgaug.augmenters.meta.SomeOf``.
Parameters
----------
children : list of imgaug.augmenters.meta.Augmenter
The choices of augmenters to apply.
name : None or str, optional
See :func:`imgaug.... | imgaug/augmenters/meta.py | def OneOf(children, name=None, deterministic=False, random_state=None):
"""
Augmenter that always executes exactly one of its children.
dtype support::
See ``imgaug.augmenters.meta.SomeOf``.
Parameters
----------
children : list of imgaug.augmenters.meta.Augmenter
The choices ... | def OneOf(children, name=None, deterministic=False, random_state=None):
"""
Augmenter that always executes exactly one of its children.
dtype support::
See ``imgaug.augmenters.meta.SomeOf``.
Parameters
----------
children : list of imgaug.augmenters.meta.Augmenter
The choices ... | [
"Augmenter",
"that",
"always",
"executes",
"exactly",
"one",
"of",
"its",
"children",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/meta.py#L3234-L3284 | [
"def",
"OneOf",
"(",
"children",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"return",
"SomeOf",
"(",
"n",
"=",
"1",
",",
"children",
"=",
"children",
",",
"random_order",
"=",
"False",
",",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | AssertLambda | Augmenter that runs an assert on each batch of input images
using a lambda function as condition.
This is useful to make generic assumption about the input images and error
out early if they aren't met.
dtype support::
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
*... | imgaug/augmenters/meta.py | def AssertLambda(func_images=None, func_heatmaps=None, func_keypoints=None,
func_polygons=None, name=None, deterministic=False,
random_state=None):
"""
Augmenter that runs an assert on each batch of input images
using a lambda function as condition.
This is useful to m... | def AssertLambda(func_images=None, func_heatmaps=None, func_keypoints=None,
func_polygons=None, name=None, deterministic=False,
random_state=None):
"""
Augmenter that runs an assert on each batch of input images
using a lambda function as condition.
This is useful to m... | [
"Augmenter",
"that",
"runs",
"an",
"assert",
"on",
"each",
"batch",
"of",
"input",
"images",
"using",
"a",
"lambda",
"function",
"as",
"condition",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/meta.py#L3894-L3986 | [
"def",
"AssertLambda",
"(",
"func_images",
"=",
"None",
",",
"func_heatmaps",
"=",
"None",
",",
"func_keypoints",
"=",
"None",
",",
"func_polygons",
"=",
"None",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | AssertShape | Augmenter to make assumptions about the shape of input image(s), heatmaps and keypoints.
dtype support::
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
* ``uint32``: yes; tested
* ``uint64``: yes; tested
* ``int8``: yes; tested
* ``int16``: yes; tested
... | imgaug/augmenters/meta.py | def AssertShape(shape, check_images=True, check_heatmaps=True,
check_keypoints=True, check_polygons=True,
name=None, deterministic=False, random_state=None):
"""
Augmenter to make assumptions about the shape of input image(s), heatmaps and keypoints.
dtype support::
... | def AssertShape(shape, check_images=True, check_heatmaps=True,
check_keypoints=True, check_polygons=True,
name=None, deterministic=False, random_state=None):
"""
Augmenter to make assumptions about the shape of input image(s), heatmaps and keypoints.
dtype support::
... | [
"Augmenter",
"to",
"make",
"assumptions",
"about",
"the",
"shape",
"of",
"input",
"image",
"(",
"s",
")",
"heatmaps",
"and",
"keypoints",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/meta.py#L3989-L4171 | [
"def",
"AssertShape",
"(",
"shape",
",",
"check_images",
"=",
"True",
",",
"check_heatmaps",
"=",
"True",
",",
"check_keypoints",
"=",
"True",
",",
"check_polygons",
"=",
"True",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_stat... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | shuffle_channels | Randomize the order of (color) channels in an image.
dtype support::
* ``uint8``: yes; fully tested
* ``uint16``: yes; indirectly tested (1)
* ``uint32``: yes; indirectly tested (1)
* ``uint64``: yes; indirectly tested (1)
* ``int8``: yes; indirectly tested (1)
* ``... | imgaug/augmenters/meta.py | def shuffle_channels(image, random_state, channels=None):
"""
Randomize the order of (color) channels in an image.
dtype support::
* ``uint8``: yes; fully tested
* ``uint16``: yes; indirectly tested (1)
* ``uint32``: yes; indirectly tested (1)
* ``uint64``: yes; indirectly ... | def shuffle_channels(image, random_state, channels=None):
"""
Randomize the order of (color) channels in an image.
dtype support::
* ``uint8``: yes; fully tested
* ``uint16``: yes; indirectly tested (1)
* ``uint32``: yes; indirectly tested (1)
* ``uint64``: yes; indirectly ... | [
"Randomize",
"the",
"order",
"of",
"(",
"color",
")",
"channels",
"in",
"an",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/meta.py#L4255-L4316 | [
"def",
"shuffle_channels",
"(",
"image",
",",
"random_state",
",",
"channels",
"=",
"None",
")",
":",
"if",
"image",
".",
"ndim",
"<",
"3",
"or",
"image",
".",
"shape",
"[",
"2",
"]",
"==",
"1",
":",
"return",
"image",
"nb_channels",
"=",
"image",
".... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | blur_gaussian_ | Blur an image using gaussian blurring.
This operation might change the input image in-place.
dtype support::
if (backend="auto")::
* ``uint8``: yes; fully tested (1)
* ``uint16``: yes; tested (1)
* ``uint32``: yes; tested (2)
* ``uint64``: yes; tested ... | imgaug/augmenters/blur.py | def blur_gaussian_(image, sigma, ksize=None, backend="auto", eps=1e-3):
"""
Blur an image using gaussian blurring.
This operation might change the input image in-place.
dtype support::
if (backend="auto")::
* ``uint8``: yes; fully tested (1)
* ``uint16``: yes; tested ... | def blur_gaussian_(image, sigma, ksize=None, backend="auto", eps=1e-3):
"""
Blur an image using gaussian blurring.
This operation might change the input image in-place.
dtype support::
if (backend="auto")::
* ``uint8``: yes; fully tested (1)
* ``uint16``: yes; tested ... | [
"Blur",
"an",
"image",
"using",
"gaussian",
"blurring",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/blur.py#L42-L253 | [
"def",
"blur_gaussian_",
"(",
"image",
",",
"sigma",
",",
"ksize",
"=",
"None",
",",
"backend",
"=",
"\"auto\"",
",",
"eps",
"=",
"1e-3",
")",
":",
"if",
"sigma",
">",
"0",
"+",
"eps",
":",
"dtype",
"=",
"image",
".",
"dtype",
"iadt",
".",
"gate_dt... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | MotionBlur | Augmenter that sharpens images and overlays the result with the original image.
dtype support::
See ``imgaug.augmenters.convolutional.Convolve``.
Parameters
----------
k : int or tuple of int or list of int or imgaug.parameters.StochasticParameter, optional
Kernel size to use.
... | imgaug/augmenters/blur.py | def MotionBlur(k=5, angle=(0, 360), direction=(-1.0, 1.0), order=1, name=None, deterministic=False, random_state=None):
"""
Augmenter that sharpens images and overlays the result with the original image.
dtype support::
See ``imgaug.augmenters.convolutional.Convolve``.
Parameters
--------... | def MotionBlur(k=5, angle=(0, 360), direction=(-1.0, 1.0), order=1, name=None, deterministic=False, random_state=None):
"""
Augmenter that sharpens images and overlays the result with the original image.
dtype support::
See ``imgaug.augmenters.convolutional.Convolve``.
Parameters
--------... | [
"Augmenter",
"that",
"sharpens",
"images",
"and",
"overlays",
"the",
"result",
"with",
"the",
"original",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/blur.py#L722-L825 | [
"def",
"MotionBlur",
"(",
"k",
"=",
"5",
",",
"angle",
"=",
"(",
"0",
",",
"360",
")",
",",
"direction",
"=",
"(",
"-",
"1.0",
",",
"1.0",
")",
",",
"order",
"=",
"1",
",",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_s... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | Clouds | Augmenter to draw clouds in images.
This is a wrapper around ``CloudLayer``. It executes 1 to 2 layers per image, leading to varying densities
and frequency patterns of clouds.
This augmenter seems to be fairly robust w.r.t. the image size. Tested with ``96x128``, ``192x256``
and ``960x1280``.
dt... | imgaug/augmenters/weather.py | def Clouds(name=None, deterministic=False, random_state=None):
"""
Augmenter to draw clouds in images.
This is a wrapper around ``CloudLayer``. It executes 1 to 2 layers per image, leading to varying densities
and frequency patterns of clouds.
This augmenter seems to be fairly robust w.r.t. the im... | def Clouds(name=None, deterministic=False, random_state=None):
"""
Augmenter to draw clouds in images.
This is a wrapper around ``CloudLayer``. It executes 1 to 2 layers per image, leading to varying densities
and frequency patterns of clouds.
This augmenter seems to be fairly robust w.r.t. the im... | [
"Augmenter",
"to",
"draw",
"clouds",
"in",
"images",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/weather.py#L169-L231 | [
"def",
"Clouds",
"(",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"\"Unnamed%s\"",
"%",
"(",
"ia",
".",
"caller_name",
"(",
")",
",",
")",
"return"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | Fog | Augmenter to draw fog in images.
This is a wrapper around ``CloudLayer``. It executes a single layer per image with a configuration leading
to fairly dense clouds with low-frequency patterns.
This augmenter seems to be fairly robust w.r.t. the image size. Tested with ``96x128``, ``192x256``
and ``960x... | imgaug/augmenters/weather.py | def Fog(name=None, deterministic=False, random_state=None):
"""
Augmenter to draw fog in images.
This is a wrapper around ``CloudLayer``. It executes a single layer per image with a configuration leading
to fairly dense clouds with low-frequency patterns.
This augmenter seems to be fairly robust w... | def Fog(name=None, deterministic=False, random_state=None):
"""
Augmenter to draw fog in images.
This is a wrapper around ``CloudLayer``. It executes a single layer per image with a configuration leading
to fairly dense clouds with low-frequency patterns.
This augmenter seems to be fairly robust w... | [
"Augmenter",
"to",
"draw",
"fog",
"in",
"images",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/weather.py#L236-L292 | [
"def",
"Fog",
"(",
"name",
"=",
"None",
",",
"deterministic",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"\"Unnamed%s\"",
"%",
"(",
"ia",
".",
"caller_name",
"(",
")",
",",
")",
"return",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | Snowflakes | Augmenter to add falling snowflakes to images.
This is a wrapper around ``SnowflakesLayer``. It executes 1 to 3 layers per image.
dtype support::
* ``uint8``: yes; tested
* ``uint16``: no (1)
* ``uint32``: no (1)
* ``uint64``: no (1)
* ``int8``: no (1)
* ``int1... | imgaug/augmenters/weather.py | def Snowflakes(density=(0.005, 0.075), density_uniformity=(0.3, 0.9), flake_size=(0.2, 0.7),
flake_size_uniformity=(0.4, 0.8), angle=(-30, 30), speed=(0.007, 0.03),
name=None, deterministic=False, random_state=None):
"""
Augmenter to add falling snowflakes to images.
This is a... | def Snowflakes(density=(0.005, 0.075), density_uniformity=(0.3, 0.9), flake_size=(0.2, 0.7),
flake_size_uniformity=(0.4, 0.8), angle=(-30, 30), speed=(0.007, 0.03),
name=None, deterministic=False, random_state=None):
"""
Augmenter to add falling snowflakes to images.
This is a... | [
"Augmenter",
"to",
"add",
"falling",
"snowflakes",
"to",
"images",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmenters/weather.py#L527-L668 | [
"def",
"Snowflakes",
"(",
"density",
"=",
"(",
"0.005",
",",
"0.075",
")",
",",
"density_uniformity",
"=",
"(",
"0.3",
",",
"0.9",
")",
",",
"flake_size",
"=",
"(",
"0.2",
",",
"0.7",
")",
",",
"flake_size_uniformity",
"=",
"(",
"0.4",
",",
"0.8",
")... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.get_arr_int | Get the segmentation map array as an integer array of shape (H, W).
Each pixel in that array contains an integer value representing the pixel's class.
If multiple classes overlap, the one with the highest local float value is picked.
If that highest local value is below `background_threshold`, ... | imgaug/augmentables/segmaps.py | def get_arr_int(self, background_threshold=0.01, background_class_id=None):
"""
Get the segmentation map array as an integer array of shape (H, W).
Each pixel in that array contains an integer value representing the pixel's class.
If multiple classes overlap, the one with the highest lo... | def get_arr_int(self, background_threshold=0.01, background_class_id=None):
"""
Get the segmentation map array as an integer array of shape (H, W).
Each pixel in that array contains an integer value representing the pixel's class.
If multiple classes overlap, the one with the highest lo... | [
"Get",
"the",
"segmentation",
"map",
"array",
"as",
"an",
"integer",
"array",
"of",
"shape",
"(",
"H",
"W",
")",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L136-L190 | [
"def",
"get_arr_int",
"(",
"self",
",",
"background_threshold",
"=",
"0.01",
",",
"background_class_id",
"=",
"None",
")",
":",
"if",
"self",
".",
"input_was",
"[",
"0",
"]",
"in",
"[",
"\"bool\"",
",",
"\"float\"",
"]",
":",
"ia",
".",
"do_assert",
"(",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.draw | Render the segmentation map as an RGB image.
Parameters
----------
size : None or float or iterable of int or iterable of float, optional
Size of the rendered RGB image as ``(height, width)``.
See :func:`imgaug.imgaug.imresize_single_image` for details.
If se... | imgaug/augmentables/segmaps.py | def draw(self, size=None, background_threshold=0.01, background_class_id=None, colors=None,
return_foreground_mask=False):
"""
Render the segmentation map as an RGB image.
Parameters
----------
size : None or float or iterable of int or iterable of float, optional
... | def draw(self, size=None, background_threshold=0.01, background_class_id=None, colors=None,
return_foreground_mask=False):
"""
Render the segmentation map as an RGB image.
Parameters
----------
size : None or float or iterable of int or iterable of float, optional
... | [
"Render",
"the",
"segmentation",
"map",
"as",
"an",
"RGB",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L196-L260 | [
"def",
"draw",
"(",
"self",
",",
"size",
"=",
"None",
",",
"background_threshold",
"=",
"0.01",
",",
"background_class_id",
"=",
"None",
",",
"colors",
"=",
"None",
",",
"return_foreground_mask",
"=",
"False",
")",
":",
"arr",
"=",
"self",
".",
"get_arr_in... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.draw_on_image | Draw the segmentation map as an overlay over an image.
Parameters
----------
image : (H,W,3) ndarray
Image onto which to draw the segmentation map. Dtype is expected to be uint8.
alpha : float, optional
Alpha/opacity value to use for the mixing of image and segm... | imgaug/augmentables/segmaps.py | def draw_on_image(self, image, alpha=0.75, resize="segmentation_map", background_threshold=0.01,
background_class_id=None, colors=None, draw_background=False):
"""
Draw the segmentation map as an overlay over an image.
Parameters
----------
image : (H,W,3) ... | def draw_on_image(self, image, alpha=0.75, resize="segmentation_map", background_threshold=0.01,
background_class_id=None, colors=None, draw_background=False):
"""
Draw the segmentation map as an overlay over an image.
Parameters
----------
image : (H,W,3) ... | [
"Draw",
"the",
"segmentation",
"map",
"as",
"an",
"overlay",
"over",
"an",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L262-L336 | [
"def",
"draw_on_image",
"(",
"self",
",",
"image",
",",
"alpha",
"=",
"0.75",
",",
"resize",
"=",
"\"segmentation_map\"",
",",
"background_threshold",
"=",
"0.01",
",",
"background_class_id",
"=",
"None",
",",
"colors",
"=",
"None",
",",
"draw_background",
"="... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.pad | Pad the segmentation map on its top/right/bottom/left side.
Parameters
----------
top : int, optional
Amount of pixels to add at the top side of the segmentation map. Must be 0 or greater.
right : int, optional
Amount of pixels to add at the right side of the se... | imgaug/augmentables/segmaps.py | def pad(self, top=0, right=0, bottom=0, left=0, mode="constant", cval=0.0):
"""
Pad the segmentation map on its top/right/bottom/left side.
Parameters
----------
top : int, optional
Amount of pixels to add at the top side of the segmentation map. Must be 0 or greater... | def pad(self, top=0, right=0, bottom=0, left=0, mode="constant", cval=0.0):
"""
Pad the segmentation map on its top/right/bottom/left side.
Parameters
----------
top : int, optional
Amount of pixels to add at the top side of the segmentation map. Must be 0 or greater... | [
"Pad",
"the",
"segmentation",
"map",
"on",
"its",
"top",
"/",
"right",
"/",
"bottom",
"/",
"left",
"side",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L338-L371 | [
"def",
"pad",
"(",
"self",
",",
"top",
"=",
"0",
",",
"right",
"=",
"0",
",",
"bottom",
"=",
"0",
",",
"left",
"=",
"0",
",",
"mode",
"=",
"\"constant\"",
",",
"cval",
"=",
"0.0",
")",
":",
"arr_padded",
"=",
"ia",
".",
"pad",
"(",
"self",
".... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.pad_to_aspect_ratio | Pad the segmentation map on its sides so that its matches a target aspect ratio.
Depending on which dimension is smaller (height or width), only the corresponding
sides (left/right or top/bottom) will be padded. In each case, both of the sides will
be padded equally.
Parameters
... | imgaug/augmentables/segmaps.py | def pad_to_aspect_ratio(self, aspect_ratio, mode="constant", cval=0.0, return_pad_amounts=False):
"""
Pad the segmentation map on its sides so that its matches a target aspect ratio.
Depending on which dimension is smaller (height or width), only the corresponding
sides (left/right or t... | def pad_to_aspect_ratio(self, aspect_ratio, mode="constant", cval=0.0, return_pad_amounts=False):
"""
Pad the segmentation map on its sides so that its matches a target aspect ratio.
Depending on which dimension is smaller (height or width), only the corresponding
sides (left/right or t... | [
"Pad",
"the",
"segmentation",
"map",
"on",
"its",
"sides",
"so",
"that",
"its",
"matches",
"a",
"target",
"aspect",
"ratio",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L373-L417 | [
"def",
"pad_to_aspect_ratio",
"(",
"self",
",",
"aspect_ratio",
",",
"mode",
"=",
"\"constant\"",
",",
"cval",
"=",
"0.0",
",",
"return_pad_amounts",
"=",
"False",
")",
":",
"arr_padded",
",",
"pad_amounts",
"=",
"ia",
".",
"pad_to_aspect_ratio",
"(",
"self",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.resize | Resize the segmentation map array to the provided size given the provided interpolation.
Parameters
----------
sizes : float or iterable of int or iterable of float
New size of the array in ``(height, width)``.
See :func:`imgaug.imgaug.imresize_single_image` for details.... | imgaug/augmentables/segmaps.py | def resize(self, sizes, interpolation="cubic"):
"""
Resize the segmentation map array to the provided size given the provided interpolation.
Parameters
----------
sizes : float or iterable of int or iterable of float
New size of the array in ``(height, width)``.
... | def resize(self, sizes, interpolation="cubic"):
"""
Resize the segmentation map array to the provided size given the provided interpolation.
Parameters
----------
sizes : float or iterable of int or iterable of float
New size of the array in ``(height, width)``.
... | [
"Resize",
"the",
"segmentation",
"map",
"array",
"to",
"the",
"provided",
"size",
"given",
"the",
"provided",
"interpolation",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L424-L455 | [
"def",
"resize",
"(",
"self",
",",
"sizes",
",",
"interpolation",
"=",
"\"cubic\"",
")",
":",
"arr_resized",
"=",
"ia",
".",
"imresize_single_image",
"(",
"self",
".",
"arr",
",",
"sizes",
",",
"interpolation",
"=",
"interpolation",
")",
"# cubic interpolation... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.to_heatmaps | Convert segmentation map to heatmaps object.
Each segmentation map class will be represented as a single heatmap channel.
Parameters
----------
only_nonempty : bool, optional
If True, then only heatmaps for classes that appear in the segmentation map will be
gen... | imgaug/augmentables/segmaps.py | def to_heatmaps(self, only_nonempty=False, not_none_if_no_nonempty=False):
"""
Convert segmentation map to heatmaps object.
Each segmentation map class will be represented as a single heatmap channel.
Parameters
----------
only_nonempty : bool, optional
If T... | def to_heatmaps(self, only_nonempty=False, not_none_if_no_nonempty=False):
"""
Convert segmentation map to heatmaps object.
Each segmentation map class will be represented as a single heatmap channel.
Parameters
----------
only_nonempty : bool, optional
If T... | [
"Convert",
"segmentation",
"map",
"to",
"heatmaps",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L457-L502 | [
"def",
"to_heatmaps",
"(",
"self",
",",
"only_nonempty",
"=",
"False",
",",
"not_none_if_no_nonempty",
"=",
"False",
")",
":",
"# TODO get rid of this deferred import",
"from",
"imgaug",
".",
"augmentables",
".",
"heatmaps",
"import",
"HeatmapsOnImage",
"if",
"not",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.from_heatmaps | Convert heatmaps to segmentation map.
Assumes that each class is represented as a single heatmap channel.
Parameters
----------
heatmaps : imgaug.HeatmapsOnImage
Heatmaps to convert.
class_indices : None or list of int, optional
List of class indices re... | imgaug/augmentables/segmaps.py | def from_heatmaps(heatmaps, class_indices=None, nb_classes=None):
"""
Convert heatmaps to segmentation map.
Assumes that each class is represented as a single heatmap channel.
Parameters
----------
heatmaps : imgaug.HeatmapsOnImage
Heatmaps to convert.
... | def from_heatmaps(heatmaps, class_indices=None, nb_classes=None):
"""
Convert heatmaps to segmentation map.
Assumes that each class is represented as a single heatmap channel.
Parameters
----------
heatmaps : imgaug.HeatmapsOnImage
Heatmaps to convert.
... | [
"Convert",
"heatmaps",
"to",
"segmentation",
"map",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L505-L541 | [
"def",
"from_heatmaps",
"(",
"heatmaps",
",",
"class_indices",
"=",
"None",
",",
"nb_classes",
"=",
"None",
")",
":",
"if",
"class_indices",
"is",
"None",
":",
"return",
"SegmentationMapOnImage",
"(",
"heatmaps",
".",
"arr_0to1",
",",
"shape",
"=",
"heatmaps",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | SegmentationMapOnImage.deepcopy | Create a deep copy of the segmentation map object.
Returns
-------
imgaug.SegmentationMapOnImage
Deep copy. | imgaug/augmentables/segmaps.py | def deepcopy(self):
"""
Create a deep copy of the segmentation map object.
Returns
-------
imgaug.SegmentationMapOnImage
Deep copy.
"""
segmap = SegmentationMapOnImage(self.arr, shape=self.shape, nb_classes=self.nb_classes)
segmap.input_was =... | def deepcopy(self):
"""
Create a deep copy of the segmentation map object.
Returns
-------
imgaug.SegmentationMapOnImage
Deep copy.
"""
segmap = SegmentationMapOnImage(self.arr, shape=self.shape, nb_classes=self.nb_classes)
segmap.input_was =... | [
"Create",
"a",
"deep",
"copy",
"of",
"the",
"segmentation",
"map",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/segmaps.py#L555-L567 | [
"def",
"deepcopy",
"(",
"self",
")",
":",
"segmap",
"=",
"SegmentationMapOnImage",
"(",
"self",
".",
"arr",
",",
"shape",
"=",
"self",
".",
"shape",
",",
"nb_classes",
"=",
"self",
".",
"nb_classes",
")",
"segmap",
".",
"input_was",
"=",
"self",
".",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | EventQueue.offer | Offer a new event ``s`` at point ``p`` in this queue. | imgaug/external/poly_point_isect.py | def offer(self, p, e: Event):
"""
Offer a new event ``s`` at point ``p`` in this queue.
"""
existing = self.events_scan.setdefault(
p, ([], [], [], []) if USE_VERTICAL else
([], [], []))
# Can use double linked-list for easy insertion at beginni... | def offer(self, p, e: Event):
"""
Offer a new event ``s`` at point ``p`` in this queue.
"""
existing = self.events_scan.setdefault(
p, ([], [], [], []) if USE_VERTICAL else
([], [], []))
# Can use double linked-list for easy insertion at beginni... | [
"Offer",
"a",
"new",
"event",
"s",
"at",
"point",
"p",
"in",
"this",
"queue",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/external/poly_point_isect.py#L514-L529 | [
"def",
"offer",
"(",
"self",
",",
"p",
",",
"e",
":",
"Event",
")",
":",
"existing",
"=",
"self",
".",
"events_scan",
".",
"setdefault",
"(",
"p",
",",
"(",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
")",
"if",
"USE_VERTICAL",
"el... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.get_arr | Get the heatmap's array within the value range originally provided in ``__init__()``.
The HeatmapsOnImage object saves heatmaps internally in the value range ``(min=0.0, max=1.0)``.
This function converts the internal representation to ``(min=min_value, max=max_value)``,
where ``min_value`` and... | imgaug/augmentables/heatmaps.py | def get_arr(self):
"""
Get the heatmap's array within the value range originally provided in ``__init__()``.
The HeatmapsOnImage object saves heatmaps internally in the value range ``(min=0.0, max=1.0)``.
This function converts the internal representation to ``(min=min_value, max=max_va... | def get_arr(self):
"""
Get the heatmap's array within the value range originally provided in ``__init__()``.
The HeatmapsOnImage object saves heatmaps internally in the value range ``(min=0.0, max=1.0)``.
This function converts the internal representation to ``(min=min_value, max=max_va... | [
"Get",
"the",
"heatmap",
"s",
"array",
"within",
"the",
"value",
"range",
"originally",
"provided",
"in",
"__init__",
"()",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L78-L104 | [
"def",
"get_arr",
"(",
"self",
")",
":",
"if",
"self",
".",
"arr_was_2d",
"and",
"self",
".",
"arr_0to1",
".",
"shape",
"[",
"2",
"]",
"==",
"1",
":",
"arr",
"=",
"self",
".",
"arr_0to1",
"[",
":",
",",
":",
",",
"0",
"]",
"else",
":",
"arr",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.draw | Render the heatmaps as RGB images.
Parameters
----------
size : None or float or iterable of int or iterable of float, optional
Size of the rendered RGB image as ``(height, width)``.
See :func:`imgaug.imgaug.imresize_single_image` for details.
If set to None,... | imgaug/augmentables/heatmaps.py | def draw(self, size=None, cmap="jet"):
"""
Render the heatmaps as RGB images.
Parameters
----------
size : None or float or iterable of int or iterable of float, optional
Size of the rendered RGB image as ``(height, width)``.
See :func:`imgaug.imgaug.imre... | def draw(self, size=None, cmap="jet"):
"""
Render the heatmaps as RGB images.
Parameters
----------
size : None or float or iterable of int or iterable of float, optional
Size of the rendered RGB image as ``(height, width)``.
See :func:`imgaug.imgaug.imre... | [
"Render",
"the",
"heatmaps",
"as",
"RGB",
"images",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L110-L158 | [
"def",
"draw",
"(",
"self",
",",
"size",
"=",
"None",
",",
"cmap",
"=",
"\"jet\"",
")",
":",
"heatmaps_uint8",
"=",
"self",
".",
"to_uint8",
"(",
")",
"heatmaps_drawn",
"=",
"[",
"]",
"for",
"c",
"in",
"sm",
".",
"xrange",
"(",
"heatmaps_uint8",
".",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.draw_on_image | Draw the heatmaps as overlays over an image.
Parameters
----------
image : (H,W,3) ndarray
Image onto which to draw the heatmaps. Expected to be of dtype uint8.
alpha : float, optional
Alpha/opacity value to use for the mixing of image and heatmaps.
... | imgaug/augmentables/heatmaps.py | def draw_on_image(self, image, alpha=0.75, cmap="jet", resize="heatmaps"):
"""
Draw the heatmaps as overlays over an image.
Parameters
----------
image : (H,W,3) ndarray
Image onto which to draw the heatmaps. Expected to be of dtype uint8.
alpha : float, opt... | def draw_on_image(self, image, alpha=0.75, cmap="jet", resize="heatmaps"):
"""
Draw the heatmaps as overlays over an image.
Parameters
----------
image : (H,W,3) ndarray
Image onto which to draw the heatmaps. Expected to be of dtype uint8.
alpha : float, opt... | [
"Draw",
"the",
"heatmaps",
"as",
"overlays",
"over",
"an",
"image",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L160-L209 | [
"def",
"draw_on_image",
"(",
"self",
",",
"image",
",",
"alpha",
"=",
"0.75",
",",
"cmap",
"=",
"\"jet\"",
",",
"resize",
"=",
"\"heatmaps\"",
")",
":",
"# assert RGB image",
"ia",
".",
"do_assert",
"(",
"image",
".",
"ndim",
"==",
"3",
")",
"ia",
".",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.invert | Inverts each value in the heatmap, shifting low towards high values and vice versa.
This changes each value to::
v' = max - (v - min)
where ``v`` is the value at some spatial location, ``min`` is the minimum value in the heatmap
and ``max`` is the maximum value.
As the hea... | imgaug/augmentables/heatmaps.py | def invert(self):
"""
Inverts each value in the heatmap, shifting low towards high values and vice versa.
This changes each value to::
v' = max - (v - min)
where ``v`` is the value at some spatial location, ``min`` is the minimum value in the heatmap
and ``max`` is... | def invert(self):
"""
Inverts each value in the heatmap, shifting low towards high values and vice versa.
This changes each value to::
v' = max - (v - min)
where ``v`` is the value at some spatial location, ``min`` is the minimum value in the heatmap
and ``max`` is... | [
"Inverts",
"each",
"value",
"in",
"the",
"heatmap",
"shifting",
"low",
"towards",
"high",
"values",
"and",
"vice",
"versa",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L211-L238 | [
"def",
"invert",
"(",
"self",
")",
":",
"arr_inv",
"=",
"HeatmapsOnImage",
".",
"from_0to1",
"(",
"1",
"-",
"self",
".",
"arr_0to1",
",",
"shape",
"=",
"self",
".",
"shape",
",",
"min_value",
"=",
"self",
".",
"min_value",
",",
"max_value",
"=",
"self"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.pad | Pad the heatmaps on their top/right/bottom/left side.
Parameters
----------
top : int, optional
Amount of pixels to add at the top side of the heatmaps. Must be 0 or greater.
right : int, optional
Amount of pixels to add at the right side of the heatmaps. Must b... | imgaug/augmentables/heatmaps.py | def pad(self, top=0, right=0, bottom=0, left=0, mode="constant", cval=0.0):
"""
Pad the heatmaps on their top/right/bottom/left side.
Parameters
----------
top : int, optional
Amount of pixels to add at the top side of the heatmaps. Must be 0 or greater.
rig... | def pad(self, top=0, right=0, bottom=0, left=0, mode="constant", cval=0.0):
"""
Pad the heatmaps on their top/right/bottom/left side.
Parameters
----------
top : int, optional
Amount of pixels to add at the top side of the heatmaps. Must be 0 or greater.
rig... | [
"Pad",
"the",
"heatmaps",
"on",
"their",
"top",
"/",
"right",
"/",
"bottom",
"/",
"left",
"side",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L240-L272 | [
"def",
"pad",
"(",
"self",
",",
"top",
"=",
"0",
",",
"right",
"=",
"0",
",",
"bottom",
"=",
"0",
",",
"left",
"=",
"0",
",",
"mode",
"=",
"\"constant\"",
",",
"cval",
"=",
"0.0",
")",
":",
"arr_0to1_padded",
"=",
"ia",
".",
"pad",
"(",
"self",... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.pad_to_aspect_ratio | Pad the heatmaps on their sides so that they match a target aspect ratio.
Depending on which dimension is smaller (height or width), only the corresponding
sides (left/right or top/bottom) will be padded. In each case, both of the sides will
be padded equally.
Parameters
------... | imgaug/augmentables/heatmaps.py | def pad_to_aspect_ratio(self, aspect_ratio, mode="constant", cval=0.0, return_pad_amounts=False):
"""
Pad the heatmaps on their sides so that they match a target aspect ratio.
Depending on which dimension is smaller (height or width), only the corresponding
sides (left/right or top/bott... | def pad_to_aspect_ratio(self, aspect_ratio, mode="constant", cval=0.0, return_pad_amounts=False):
"""
Pad the heatmaps on their sides so that they match a target aspect ratio.
Depending on which dimension is smaller (height or width), only the corresponding
sides (left/right or top/bott... | [
"Pad",
"the",
"heatmaps",
"on",
"their",
"sides",
"so",
"that",
"they",
"match",
"a",
"target",
"aspect",
"ratio",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L274-L317 | [
"def",
"pad_to_aspect_ratio",
"(",
"self",
",",
"aspect_ratio",
",",
"mode",
"=",
"\"constant\"",
",",
"cval",
"=",
"0.0",
",",
"return_pad_amounts",
"=",
"False",
")",
":",
"arr_0to1_padded",
",",
"pad_amounts",
"=",
"ia",
".",
"pad_to_aspect_ratio",
"(",
"se... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.avg_pool | Resize the heatmap(s) array using average pooling of a given block/kernel size.
Parameters
----------
block_size : int or tuple of int
Size of each block of values to pool, aka kernel size. See :func:`imgaug.pool` for details.
Returns
-------
imgaug.Heatmaps... | imgaug/augmentables/heatmaps.py | def avg_pool(self, block_size):
"""
Resize the heatmap(s) array using average pooling of a given block/kernel size.
Parameters
----------
block_size : int or tuple of int
Size of each block of values to pool, aka kernel size. See :func:`imgaug.pool` for details.
... | def avg_pool(self, block_size):
"""
Resize the heatmap(s) array using average pooling of a given block/kernel size.
Parameters
----------
block_size : int or tuple of int
Size of each block of values to pool, aka kernel size. See :func:`imgaug.pool` for details.
... | [
"Resize",
"the",
"heatmap",
"(",
"s",
")",
"array",
"using",
"average",
"pooling",
"of",
"a",
"given",
"block",
"/",
"kernel",
"size",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L319-L336 | [
"def",
"avg_pool",
"(",
"self",
",",
"block_size",
")",
":",
"arr_0to1_reduced",
"=",
"ia",
".",
"avg_pool",
"(",
"self",
".",
"arr_0to1",
",",
"block_size",
",",
"cval",
"=",
"0.0",
")",
"return",
"HeatmapsOnImage",
".",
"from_0to1",
"(",
"arr_0to1_reduced"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.max_pool | Resize the heatmap(s) array using max-pooling of a given block/kernel size.
Parameters
----------
block_size : int or tuple of int
Size of each block of values to pool, aka kernel size. See :func:`imgaug.pool` for details.
Returns
-------
imgaug.HeatmapsOnIm... | imgaug/augmentables/heatmaps.py | def max_pool(self, block_size):
"""
Resize the heatmap(s) array using max-pooling of a given block/kernel size.
Parameters
----------
block_size : int or tuple of int
Size of each block of values to pool, aka kernel size. See :func:`imgaug.pool` for details.
... | def max_pool(self, block_size):
"""
Resize the heatmap(s) array using max-pooling of a given block/kernel size.
Parameters
----------
block_size : int or tuple of int
Size of each block of values to pool, aka kernel size. See :func:`imgaug.pool` for details.
... | [
"Resize",
"the",
"heatmap",
"(",
"s",
")",
"array",
"using",
"max",
"-",
"pooling",
"of",
"a",
"given",
"block",
"/",
"kernel",
"size",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L338-L355 | [
"def",
"max_pool",
"(",
"self",
",",
"block_size",
")",
":",
"arr_0to1_reduced",
"=",
"ia",
".",
"max_pool",
"(",
"self",
".",
"arr_0to1",
",",
"block_size",
")",
"return",
"HeatmapsOnImage",
".",
"from_0to1",
"(",
"arr_0to1_reduced",
",",
"shape",
"=",
"sel... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.resize | Resize the heatmap(s) array to the provided size given the provided interpolation.
Parameters
----------
sizes : float or iterable of int or iterable of float
New size of the array in ``(height, width)``.
See :func:`imgaug.imgaug.imresize_single_image` for details.
... | imgaug/augmentables/heatmaps.py | def resize(self, sizes, interpolation="cubic"):
"""
Resize the heatmap(s) array to the provided size given the provided interpolation.
Parameters
----------
sizes : float or iterable of int or iterable of float
New size of the array in ``(height, width)``.
... | def resize(self, sizes, interpolation="cubic"):
"""
Resize the heatmap(s) array to the provided size given the provided interpolation.
Parameters
----------
sizes : float or iterable of int or iterable of float
New size of the array in ``(height, width)``.
... | [
"Resize",
"the",
"heatmap",
"(",
"s",
")",
"array",
"to",
"the",
"provided",
"size",
"given",
"the",
"provided",
"interpolation",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L362-L390 | [
"def",
"resize",
"(",
"self",
",",
"sizes",
",",
"interpolation",
"=",
"\"cubic\"",
")",
":",
"arr_0to1_resized",
"=",
"ia",
".",
"imresize_single_image",
"(",
"self",
".",
"arr_0to1",
",",
"sizes",
",",
"interpolation",
"=",
"interpolation",
")",
"# cubic int... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.to_uint8 | Convert this heatmaps object to a 0-to-255 array.
Returns
-------
arr_uint8 : (H,W,C) ndarray
Heatmap as a 0-to-255 array (dtype is uint8). | imgaug/augmentables/heatmaps.py | def to_uint8(self):
"""
Convert this heatmaps object to a 0-to-255 array.
Returns
-------
arr_uint8 : (H,W,C) ndarray
Heatmap as a 0-to-255 array (dtype is uint8).
"""
# TODO this always returns (H,W,C), even if input ndarray was originall (H,W)
... | def to_uint8(self):
"""
Convert this heatmaps object to a 0-to-255 array.
Returns
-------
arr_uint8 : (H,W,C) ndarray
Heatmap as a 0-to-255 array (dtype is uint8).
"""
# TODO this always returns (H,W,C), even if input ndarray was originall (H,W)
... | [
"Convert",
"this",
"heatmaps",
"object",
"to",
"a",
"0",
"-",
"to",
"-",
"255",
"array",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L392-L406 | [
"def",
"to_uint8",
"(",
"self",
")",
":",
"# TODO this always returns (H,W,C), even if input ndarray was originall (H,W)",
"# does it make sense here to also return (H,W) if self.arr_was_2d?",
"arr_0to255",
"=",
"np",
".",
"clip",
"(",
"np",
".",
"round",
"(",
"self",
".",
"a... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.from_uint8 | Create a heatmaps object from an heatmap array containing values ranging from 0 to 255.
Parameters
----------
arr_uint8 : (H,W) ndarray or (H,W,C) ndarray
Heatmap(s) array, where ``H`` is height, ``W`` is width and ``C`` is the number of heatmap channels.
Expected dtype ... | imgaug/augmentables/heatmaps.py | def from_uint8(arr_uint8, shape, min_value=0.0, max_value=1.0):
"""
Create a heatmaps object from an heatmap array containing values ranging from 0 to 255.
Parameters
----------
arr_uint8 : (H,W) ndarray or (H,W,C) ndarray
Heatmap(s) array, where ``H`` is height, ``W... | def from_uint8(arr_uint8, shape, min_value=0.0, max_value=1.0):
"""
Create a heatmaps object from an heatmap array containing values ranging from 0 to 255.
Parameters
----------
arr_uint8 : (H,W) ndarray or (H,W,C) ndarray
Heatmap(s) array, where ``H`` is height, ``W... | [
"Create",
"a",
"heatmaps",
"object",
"from",
"an",
"heatmap",
"array",
"containing",
"values",
"ranging",
"from",
"0",
"to",
"255",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L409-L441 | [
"def",
"from_uint8",
"(",
"arr_uint8",
",",
"shape",
",",
"min_value",
"=",
"0.0",
",",
"max_value",
"=",
"1.0",
")",
":",
"arr_0to1",
"=",
"arr_uint8",
".",
"astype",
"(",
"np",
".",
"float32",
")",
"/",
"255.0",
"return",
"HeatmapsOnImage",
".",
"from_... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.from_0to1 | Create a heatmaps object from an heatmap array containing values ranging from 0.0 to 1.0.
Parameters
----------
arr_0to1 : (H,W) or (H,W,C) ndarray
Heatmap(s) array, where ``H`` is height, ``W`` is width and ``C`` is the number of heatmap channels.
Expected dtype is floa... | imgaug/augmentables/heatmaps.py | def from_0to1(arr_0to1, shape, min_value=0.0, max_value=1.0):
"""
Create a heatmaps object from an heatmap array containing values ranging from 0.0 to 1.0.
Parameters
----------
arr_0to1 : (H,W) or (H,W,C) ndarray
Heatmap(s) array, where ``H`` is height, ``W`` is wid... | def from_0to1(arr_0to1, shape, min_value=0.0, max_value=1.0):
"""
Create a heatmaps object from an heatmap array containing values ranging from 0.0 to 1.0.
Parameters
----------
arr_0to1 : (H,W) or (H,W,C) ndarray
Heatmap(s) array, where ``H`` is height, ``W`` is wid... | [
"Create",
"a",
"heatmaps",
"object",
"from",
"an",
"heatmap",
"array",
"containing",
"values",
"ranging",
"from",
"0",
".",
"0",
"to",
"1",
".",
"0",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L444-L482 | [
"def",
"from_0to1",
"(",
"arr_0to1",
",",
"shape",
",",
"min_value",
"=",
"0.0",
",",
"max_value",
"=",
"1.0",
")",
":",
"heatmaps",
"=",
"HeatmapsOnImage",
"(",
"arr_0to1",
",",
"shape",
",",
"min_value",
"=",
"0.0",
",",
"max_value",
"=",
"1.0",
")",
... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.change_normalization | Change the value range of a heatmap from one min-max to another min-max.
E.g. the value range may be changed from min=0.0, max=1.0 to min=-1.0, max=1.0.
Parameters
----------
arr : ndarray
Heatmap array to modify.
source : tuple of float
Current value r... | imgaug/augmentables/heatmaps.py | def change_normalization(cls, arr, source, target):
"""
Change the value range of a heatmap from one min-max to another min-max.
E.g. the value range may be changed from min=0.0, max=1.0 to min=-1.0, max=1.0.
Parameters
----------
arr : ndarray
Heatmap array... | def change_normalization(cls, arr, source, target):
"""
Change the value range of a heatmap from one min-max to another min-max.
E.g. the value range may be changed from min=0.0, max=1.0 to min=-1.0, max=1.0.
Parameters
----------
arr : ndarray
Heatmap array... | [
"Change",
"the",
"value",
"range",
"of",
"a",
"heatmap",
"from",
"one",
"min",
"-",
"max",
"to",
"another",
"min",
"-",
"max",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L485-L542 | [
"def",
"change_normalization",
"(",
"cls",
",",
"arr",
",",
"source",
",",
"target",
")",
":",
"ia",
".",
"do_assert",
"(",
"ia",
".",
"is_np_array",
"(",
"arr",
")",
")",
"if",
"isinstance",
"(",
"source",
",",
"HeatmapsOnImage",
")",
":",
"source",
"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | HeatmapsOnImage.deepcopy | Create a deep copy of the Heatmaps object.
Returns
-------
imgaug.HeatmapsOnImage
Deep copy. | imgaug/augmentables/heatmaps.py | def deepcopy(self):
"""
Create a deep copy of the Heatmaps object.
Returns
-------
imgaug.HeatmapsOnImage
Deep copy.
"""
return HeatmapsOnImage(self.get_arr(), shape=self.shape, min_value=self.min_value, max_value=self.max_value) | def deepcopy(self):
"""
Create a deep copy of the Heatmaps object.
Returns
-------
imgaug.HeatmapsOnImage
Deep copy.
"""
return HeatmapsOnImage(self.get_arr(), shape=self.shape, min_value=self.min_value, max_value=self.max_value) | [
"Create",
"a",
"deep",
"copy",
"of",
"the",
"Heatmaps",
"object",
"."
] | aleju/imgaug | python | https://github.com/aleju/imgaug/blob/786be74aa855513840113ea523c5df495dc6a8af/imgaug/augmentables/heatmaps.py#L556-L566 | [
"def",
"deepcopy",
"(",
"self",
")",
":",
"return",
"HeatmapsOnImage",
"(",
"self",
".",
"get_arr",
"(",
")",
",",
"shape",
"=",
"self",
".",
"shape",
",",
"min_value",
"=",
"self",
".",
"min_value",
",",
"max_value",
"=",
"self",
".",
"max_value",
")"... | 786be74aa855513840113ea523c5df495dc6a8af |
valid | MutableHeaders.setdefault | If the header `key` does not exist, then set it to `value`.
Returns the header value. | starlette/datastructures.py | def setdefault(self, key: str, value: str) -> str:
"""
If the header `key` does not exist, then set it to `value`.
Returns the header value.
"""
set_key = key.lower().encode("latin-1")
set_value = value.encode("latin-1")
for idx, (item_key, item_value) in enumera... | def setdefault(self, key: str, value: str) -> str:
"""
If the header `key` does not exist, then set it to `value`.
Returns the header value.
"""
set_key = key.lower().encode("latin-1")
set_value = value.encode("latin-1")
for idx, (item_key, item_value) in enumera... | [
"If",
"the",
"header",
"key",
"does",
"not",
"exist",
"then",
"set",
"it",
"to",
"value",
".",
"Returns",
"the",
"header",
"value",
"."
] | encode/starlette | python | https://github.com/encode/starlette/blob/d23bfd0d8ff68d535d0283aa4099e5055da88bb9/starlette/datastructures.py#L577-L589 | [
"def",
"setdefault",
"(",
"self",
",",
"key",
":",
"str",
",",
"value",
":",
"str",
")",
"->",
"str",
":",
"set_key",
"=",
"key",
".",
"lower",
"(",
")",
".",
"encode",
"(",
"\"latin-1\"",
")",
"set_value",
"=",
"value",
".",
"encode",
"(",
"\"lati... | d23bfd0d8ff68d535d0283aa4099e5055da88bb9 |
valid | MutableHeaders.append | Append a header, preserving any duplicate entries. | starlette/datastructures.py | def append(self, key: str, value: str) -> None:
"""
Append a header, preserving any duplicate entries.
"""
append_key = key.lower().encode("latin-1")
append_value = value.encode("latin-1")
self._list.append((append_key, append_value)) | def append(self, key: str, value: str) -> None:
"""
Append a header, preserving any duplicate entries.
"""
append_key = key.lower().encode("latin-1")
append_value = value.encode("latin-1")
self._list.append((append_key, append_value)) | [
"Append",
"a",
"header",
"preserving",
"any",
"duplicate",
"entries",
"."
] | encode/starlette | python | https://github.com/encode/starlette/blob/d23bfd0d8ff68d535d0283aa4099e5055da88bb9/starlette/datastructures.py#L595-L601 | [
"def",
"append",
"(",
"self",
",",
"key",
":",
"str",
",",
"value",
":",
"str",
")",
"->",
"None",
":",
"append_key",
"=",
"key",
".",
"lower",
"(",
")",
".",
"encode",
"(",
"\"latin-1\"",
")",
"append_value",
"=",
"value",
".",
"encode",
"(",
"\"l... | d23bfd0d8ff68d535d0283aa4099e5055da88bb9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.