id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20,300 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric.WithPolarWarping | from . import meta
from .. import dtypes as iadt
from imgaug.imgaug import _normalize_cv2_input_arr_
import numpy as np
import imgaug as ia
import cv2
class WithPolarWarping(meta.Augmenter):
"""Augmenter that applies other augmenters in a polar-transformed space.
This augmenter first transforms an image into ... |
class WithPolarWarping(meta.Augmenter):
'''Augmenter that applies other augmenters in a polar-transformed space.
This augmenter first transforms an image into a polar representation,
then applies its child augmenter, then transforms back to cartesian
space. The polar representation is still in the imag... | 59 | 3 | 15 | 2 | 12 | 1 | 3 | 0.38 | 1 | 6 | 0 | 0 | 6 | 1 | 32 | 84 | 695 | 128 | 413 | 167 | 348 | 156 | 312 | 135 | 279 | 11 | 2 | 3 | 93 |
20,301 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric._AffineMatrixGenerator | import numpy as np
class _AffineMatrixGenerator(object):
def __init__(self, matrix=None):
if matrix is None:
matrix = np.eye(3, dtype=np.float32)
self.matrix = matrix
def centerize(self, image_shape):
height, width = image_shape[0:2]
self.translate(-width / 2, -hei... |
class _AffineMatrixGenerator(object):
def __init__(self, matrix=None):
pass
def centerize(self, image_shape):
pass
def invert_centerize(self, image_shape):
pass
def translate(self, x_px, y_px):
pass
def scale(self, x_frac, y_frac):
pass
def rotate(s... | 9 | 0 | 7 | 0 | 7 | 0 | 2 | 0.15 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 68 | 7 | 53 | 16 | 44 | 8 | 36 | 16 | 27 | 2 | 1 | 1 | 13 |
20,302 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric._AffineSamplingResult | import numpy as np
class _AffineSamplingResult(object):
def __init__(self, scale=None, translate=None, translate_mode='px', rotate=None, shear=None, cval=None, mode=None, order=None):
self.scale = scale
self.translate = translate
self.translate_mode = translate_mode
self.rotate = r... |
class _AffineSamplingResult(object):
def __init__(self, scale=None, translate=None, translate_mode='px', rotate=None, shear=None, cval=None, mode=None, order=None):
pass
def get_affine_parameters(self, idx, arr_shape, image_shape):
pass
def to_matrix(self, idx, arr_shape, image_shape, fi... | 6 | 0 | 19 | 2 | 17 | 1 | 2 | 0.1 | 1 | 1 | 1 | 0 | 5 | 8 | 5 | 5 | 105 | 12 | 86 | 37 | 72 | 9 | 49 | 29 | 43 | 3 | 1 | 1 | 8 |
20,303 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric._ElasticTfShiftMapGenerator | import numpy as np
import itertools
import six.moves as sm
from . import blur as blur_lib
import cv2
class _ElasticTfShiftMapGenerator(object):
"""Class to generate shift/displacement maps for ElasticTransformation.
This class re-uses samples for multiple examples. This minimizes the amount
of sampling th... |
class _ElasticTfShiftMapGenerator(object):
'''Class to generate shift/displacement maps for ElasticTransformation.
This class re-uses samples for multiple examples. This minimizes the amount
of sampling that has to be done.
Added in 0.5.0.
'''
def __init__(self):
pass
def generate... | 11 | 1 | 15 | 1 | 12 | 2 | 3 | 0.32 | 1 | 5 | 0 | 0 | 2 | 0 | 6 | 6 | 115 | 15 | 76 | 30 | 65 | 24 | 57 | 26 | 50 | 6 | 1 | 3 | 17 |
20,304 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric._ElasticTransformationSamplingResult | class _ElasticTransformationSamplingResult(object):
def __init__(self, random_state, alphas, sigmas, orders, cvals, modes):
self.random_state = random_state
self.alphas = alphas
self.sigmas = sigmas
self.orders = orders
self.cvals = cvals
self.modes = modes | class _ElasticTransformationSamplingResult(object):
def __init__(self, random_state, alphas, sigmas, orders, cvals, modes):
pass | 2 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 6 | 1 | 1 | 8 | 0 | 8 | 8 | 6 | 0 | 8 | 8 | 6 | 1 | 1 | 0 | 1 |
20,305 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric._JigsawSamples | class _JigsawSamples(object):
def __init__(self, nb_rows, nb_cols, max_steps, destinations):
self.nb_rows = nb_rows
self.nb_cols = nb_cols
self.max_steps = max_steps
self.destinations = destinations | class _JigsawSamples(object):
def __init__(self, nb_rows, nb_cols, max_steps, destinations):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 1 | 0.17 | 1 | 0 | 0 | 0 | 1 | 4 | 1 | 1 | 7 | 0 | 6 | 6 | 4 | 1 | 6 | 6 | 4 | 1 | 1 | 0 | 1 |
20,306 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric._PerspectiveTransformSamplingResult | class _PerspectiveTransformSamplingResult(object):
def __init__(self, matrices, max_heights, max_widths, cvals, modes):
self.matrices = matrices
self.max_heights = max_heights
self.max_widths = max_widths
self.cvals = cvals
self.modes = modes | class _PerspectiveTransformSamplingResult(object):
def __init__(self, matrices, max_heights, max_widths, cvals, modes):
pass | 2 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 5 | 1 | 1 | 7 | 0 | 7 | 7 | 5 | 0 | 7 | 7 | 5 | 1 | 1 | 0 | 1 |
20,307 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/geometric.py | imgaug.augmenters.geometric._PiecewiseAffineSamplingResult | from .. import dtypes as iadt
class _PiecewiseAffineSamplingResult(object):
def __init__(self, nb_rows, nb_cols, jitter, order, cval, mode):
self.nb_rows = nb_rows
self.nb_cols = nb_cols
self.order = order
self.jitter = jitter
self.cval = cval
self.mode = mode
... |
class _PiecewiseAffineSamplingResult(object):
def __init__(self, nb_rows, nb_cols, jitter, order, cval, mode):
pass
def get_clipped_cval(self, idx, dtype):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 6 | 2 | 2 | 14 | 1 | 13 | 11 | 10 | 0 | 13 | 11 | 10 | 1 | 1 | 0 | 2 |
20,308 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Brightness | class Brightness(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.brightness``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_brightness`.
... | class Brightness(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.brightness``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_brightness`.
P... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,309 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Contrast | class Contrast(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.contrast``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_contrast`.
P... | class Contrast(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.contrast``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_contrast`.
Paramet... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,310 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.DefocusBlur | class DefocusBlur(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.defocus_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_defocus_bl... | class DefocusBlur(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.defocus_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_defocus_blur`.
... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,311 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.ElasticTransform | class ElasticTransform(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.elastic_transform``.
.. warning::
This augmenter can currently only transform image-data.
Batches containing heatmaps, segmentation maps and
coordinate-based augmentables will be rej... | class ElasticTransform(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.elastic_transform``.
.. warning::
This augmenter can currently only transform image-data.
Batches containing heatmaps, segmentation maps and
coordinate-based augmentables will be rejec... | 3 | 1 | 8 | 0 | 8 | 0 | 1 | 2.35 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 58 | 72 | 15 | 17 | 6 | 12 | 40 | 7 | 4 | 4 | 1 | 3 | 0 | 2 |
20,312 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Fog | class Fog(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.fog``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_fog`.
Parameters
-... | class Fog(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.fog``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_fog`.
Parameters
-------... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,313 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Frost | class Frost(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.frost``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_frost`.
Parameters... | class Frost(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.frost``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_frost`.
Parameters
-... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,314 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.GaussianBlur | class GaussianBlur(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.gaussian_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_gaussian... | class GaussianBlur(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.gaussian_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_gaussian_blur... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,315 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.GaussianNoise | class GaussianNoise(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.gaussian_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_gaussi... | class GaussianNoise(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.gaussian_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_gaussian_no... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,316 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.GlassBlur | class GlassBlur(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.glass_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_glass_blur`.
... | class GlassBlur(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.glass_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_glass_blur`.
Pa... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,317 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.ImpulseNoise | class ImpulseNoise(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.impulse_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_impulse_... | class ImpulseNoise(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.impulse_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_impulse_noise... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,318 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.JpegCompression | class JpegCompression(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.jpeg_compression``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_jp... | class JpegCompression(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.jpeg_compression``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_jpeg_co... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,319 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.MotionBlur | class MotionBlur(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.motion_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_motion_blur`... | class MotionBlur(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.motion_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_motion_blur`.
... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,320 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Pixelate | class Pixelate(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.pixelate``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_pixelate`.
P... | class Pixelate(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.pixelate``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_pixelate`.
Paramet... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,321 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Saturate | class Saturate(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.saturate``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_saturate`.
P... | class Saturate(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.saturate``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_saturate`.
Paramet... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,322 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.ShotNoise | class ShotNoise(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.shot_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_shot_noise`.
Paramete... | class ShotNoise(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.shot_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_shot_noise`.
Parameters
... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,323 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Snow | class Snow(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.snow``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_snow`.
Parameters
... | class Snow(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.snow``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_snow`.
Parameters
----... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,324 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.Spatter | class Spatter(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.spatter``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_spatter`.
Para... | class Spatter(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.spatter``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_spatter`.
Parameters... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,325 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.SpeckleNoise | class SpeckleNoise(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.speckle_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_speckle_... | class SpeckleNoise(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.speckle_noise``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_speckle_noise... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,326 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike.ZoomBlur | class ZoomBlur(_ImgcorruptAugmenterBase):
"""
Wrapper around ``imagecorruptions.corruptions.zoom_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_zoom_blur`.
... | class ZoomBlur(_ImgcorruptAugmenterBase):
'''
Wrapper around ``imagecorruptions.corruptions.zoom_blur``.
.. note::
This augmenter only affects images. Other data is not changed.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.imgcorruptlike.apply_zoom_blur`.
Param... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.38 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 57 | 14 | 8 | 4 | 4 | 35 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,327 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/imgcorruptlike.py | imgaug.augmenters.imgcorruptlike._ImgcorruptAugmenterBase | from .. import parameters as iap
from . import meta
class _ImgcorruptAugmenterBase(meta.Augmenter):
def __init__(self, func, severity=1, seed=None, name=None, random_state='deprecated', deterministic='deprecated'):
super(_ImgcorruptAugmenterBase, self).__init__(seed=seed, name=name, random_state=random_st... |
class _ImgcorruptAugmenterBase(meta.Augmenter):
def __init__(self, func, severity=1, seed=None, name=None, random_state='deprecated', deterministic='deprecated'):
pass
def _augment_batch_(self, batch, random_state, parents, hooks):
pass
def _draw_samples(self, nb_rows, random_state):
... | 5 | 1 | 8 | 1 | 6 | 0 | 2 | 0.15 | 1 | 2 | 0 | 19 | 4 | 2 | 4 | 56 | 38 | 8 | 26 | 13 | 19 | 4 | 18 | 11 | 13 | 3 | 2 | 1 | 6 |
20,328 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.AssertLambda | class AssertLambda(Lambda):
"""Assert conditions based on lambda-function to be the case for input data.
This augmenter applies a lambda function to each image or other input.
The lambda function must return ``True`` or ``False``. If ``False`` is
returned, an assertion error is produced.
This is u... | class AssertLambda(Lambda):
'''Assert conditions based on lambda-function to be the case for input data.
This augmenter applies a lambda function to each image or other input.
The lambda function must return ``True`` or ``False``. If ``False`` is
returned, an assertion error is produced.
This is use... | 3 | 1 | 15 | 1 | 15 | 0 | 2 | 3.63 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 62 | 145 | 34 | 24 | 8 | 16 | 87 | 5 | 3 | 2 | 2 | 3 | 0 | 3 |
20,329 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.AssertShape | import imgaug as ia
class AssertShape(Lambda):
"""Assert that inputs have a specified shape.
**Supported dtypes**:
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
* ``uint32``: yes; tested
* ``uint64``: yes; tested
* ``int8``: yes; tested
* ``int16``: ... |
class AssertShape(Lambda):
'''Assert that inputs have a specified shape.
**Supported dtypes**:
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
* ``uint32``: yes; tested
* ``uint64``: yes; tested
* ``int8``: yes; tested
* ``int16``: yes; tested
* ... | 7 | 1 | 17 | 1 | 16 | 1 | 3 | 1.63 | 1 | 14 | 7 | 0 | 1 | 1 | 3 | 64 | 199 | 28 | 65 | 16 | 53 | 106 | 22 | 9 | 17 | 5 | 3 | 2 | 12 |
20,330 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.Augmenter | import imgaug as ia
from . import base as iabase
import itertools
import six.moves as sm
from .. import random as iarandom
import re
import six
from .. import parameters as iap
import copy as copy_module
import numpy as np
import sys
from abc import ABCMeta, abstractmethod
from imgaug.augmentables.batches import Batch,... | @six.add_metaclass(ABCMeta)
class Augmenter(object):
'''
Base class for Augmenter objects.
All augmenters derive from this class.
Parameters
----------
seed : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.Rand... | 64 | 51 | 49 | 7 | 15 | 27 | 3 | 2.13 | 1 | 23 | 8 | 70 | 50 | 4 | 52 | 52 | 2,781 | 472 | 739 | 197 | 648 | 1,571 | 446 | 165 | 385 | 18 | 1 | 4 | 181 |
20,331 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.ChannelShuffle | import imgaug as ia
from .. import parameters as iap
class ChannelShuffle(Augmenter):
"""Randomize the order of channels in input images.
**Supported dtypes**:
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
* ``uint32``: yes; tested
* ``uint64``: yes; tested
... |
class ChannelShuffle(Augmenter):
'''Randomize the order of channels in input images.
**Supported dtypes**:
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
* ``uint32``: yes; tested
* ``uint64``: yes; tested
* ``int8``: yes; tested
* ``int16``: yes; teste... | 4 | 2 | 12 | 1 | 11 | 0 | 2 | 1.67 | 1 | 5 | 0 | 0 | 3 | 2 | 3 | 55 | 106 | 18 | 33 | 14 | 27 | 55 | 20 | 12 | 16 | 4 | 2 | 2 | 6 |
20,332 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.ClipCBAsToImagePlanes | class ClipCBAsToImagePlanes(Augmenter):
"""Clip coordinate-based augmentables to areas within the image plane.
This augmenter inspects all coordinate-based augmentables (e.g.
bounding boxes, line strings) within a given batch and from each of them
parts that are outside of the image plane. Parts within... | class ClipCBAsToImagePlanes(Augmenter):
'''Clip coordinate-based augmentables to areas within the image plane.
This augmenter inspects all coordinate-based augmentables (e.g.
bounding boxes, line strings) within a given batch and from each of them
parts that are outside of the image plane. Parts within ... | 4 | 2 | 6 | 0 | 5 | 0 | 2 | 3.25 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 55 | 83 | 15 | 16 | 8 | 10 | 52 | 11 | 6 | 7 | 4 | 2 | 3 | 6 |
20,333 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.Identity | class Identity(Augmenter):
"""Augmenter that does not change the input data.
This augmenter is useful e.g. during validation/testing as it allows
to re-use the training code without actually performing any augmentation.
Added in 0.4.0.
**Supported dtypes**:
* ``uint8``: yes; fully tested... | class Identity(Augmenter):
'''Augmenter that does not change the input data.
This augmenter is useful e.g. during validation/testing as it allows
to re-use the training code without actually performing any augmentation.
Added in 0.4.0.
**Supported dtypes**:
* ``uint8``: yes; fully tested
... | 4 | 2 | 4 | 0 | 3 | 0 | 1 | 3.91 | 1 | 1 | 0 | 1 | 3 | 0 | 3 | 55 | 68 | 14 | 11 | 6 | 5 | 43 | 7 | 4 | 3 | 1 | 2 | 0 | 3 |
20,334 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.Lambda | import imgaug as ia
class Lambda(Augmenter):
"""Augmenter that calls a lambda function for each input batch.
This is useful to add missing functions to a list of augmenters.
**Supported dtypes**:
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
* ``uint32``: yes; tested
... |
class Lambda(Augmenter):
'''Augmenter that calls a lambda function for each input batch.
This is useful to add missing functions to a list of augmenters.
**Supported dtypes**:
* ``uint8``: yes; fully tested
* ``uint16``: yes; tested
* ``uint32``: yes; tested
* ``uint64``: ye... | 10 | 2 | 16 | 0 | 15 | 0 | 3 | 1.02 | 1 | 3 | 1 | 2 | 9 | 7 | 9 | 61 | 328 | 47 | 139 | 41 | 119 | 142 | 77 | 32 | 66 | 7 | 2 | 4 | 23 |
20,335 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.Noop | class Noop(Identity):
"""Alias for augmenter :class:`Identity`.
It is recommended to now use :class:`Identity`. :class:`Noop` might be
deprecated in the future.
**Supported dtypes**:
See :class:`~imgaug.augmenters.meta.Identity`.
Parameters
----------
seed : None or int or imgaug.ran... | class Noop(Identity):
'''Alias for augmenter :class:`Identity`.
It is recommended to now use :class:`Identity`. :class:`Noop` might be
deprecated in the future.
**Supported dtypes**:
See :class:`~imgaug.augmenters.meta.Identity`.
Parameters
----------
seed : None or int or imgaug.random.... | 2 | 1 | 6 | 0 | 6 | 0 | 1 | 3.71 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 44 | 11 | 7 | 4 | 3 | 26 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,336 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.OneOf | class OneOf(SomeOf):
"""Augmenter that always executes exactly one of its children.
**Supported dtypes**:
See :class:`imgaug.augmenters.meta.SomeOf`.
Parameters
----------
children : imgaug.augmenters.meta.Augmenter or list of imgaug.augmenters.meta.Augmenter
The choices of augmenters... | class OneOf(SomeOf):
'''Augmenter that always executes exactly one of its children.
**Supported dtypes**:
See :class:`imgaug.augmenters.meta.SomeOf`.
Parameters
----------
children : imgaug.augmenters.meta.Augmenter or list of imgaug.augmenters.meta.Augmenter
The choices of augmenters to... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 4.4 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 97 | 67 | 13 | 10 | 4 | 6 | 44 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,337 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.RemoveCBAsByOutOfImageFraction | class RemoveCBAsByOutOfImageFraction(Augmenter):
"""Remove coordinate-based augmentables exceeding an out of image fraction.
This augmenter inspects all coordinate-based augmentables (e.g.
bounding boxes, line strings) within a given batch and removes any such
augmentable which's out of image fraction ... | class RemoveCBAsByOutOfImageFraction(Augmenter):
'''Remove coordinate-based augmentables exceeding an out of image fraction.
This augmenter inspects all coordinate-based augmentables (e.g.
bounding boxes, line strings) within a given batch and removes any such
augmentable which's out of image fraction i... | 4 | 2 | 7 | 1 | 6 | 0 | 2 | 4.28 | 1 | 2 | 0 | 0 | 3 | 1 | 3 | 55 | 114 | 19 | 18 | 9 | 12 | 77 | 12 | 7 | 8 | 4 | 2 | 3 | 6 |
20,338 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.Sequential | import imgaug as ia
import six.moves as sm
class Sequential(Augmenter, list):
"""List augmenter containing child augmenters to apply to inputs.
This augmenter is simply a list of other augmenters. To augment an image
or any other data, it iterates over its children and applies each one
of them indepen... |
class Sequential(Augmenter, list):
'''List augmenter containing child augmenters to apply to inputs.
This augmenter is simply a list of other augmenters. To augment an image
or any other data, it iterates over its children and applies each one
of them independently to the data. (This also means that th... | 8 | 4 | 11 | 1 | 8 | 2 | 2 | 1.54 | 2 | 3 | 0 | 1 | 7 | 1 | 7 | 92 | 180 | 30 | 59 | 17 | 49 | 91 | 36 | 15 | 28 | 4 | 2 | 2 | 12 |
20,339 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.SomeOf | import imgaug as ia
import numpy as np
from .. import parameters as iap
class SomeOf(Augmenter, list):
"""List augmenter that applies only some of its children to inputs.
This augmenter is similar to :class:`~imgaug.augmenters.meta.Sequential`,
but may apply only a fixed or random subset of its child augm... |
class SomeOf(Augmenter, list):
'''List augmenter that applies only some of its children to inputs.
This augmenter is similar to :class:`~imgaug.augmenters.meta.Sequential`,
but may apply only a fixed or random subset of its child augmenters to
inputs. E.g. the augmenter could be initialized with a list... | 13 | 4 | 14 | 1 | 11 | 3 | 3 | 1.03 | 2 | 8 | 2 | 4 | 10 | 3 | 11 | 96 | 280 | 40 | 118 | 33 | 103 | 122 | 82 | 30 | 70 | 7 | 2 | 3 | 30 |
20,340 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.Sometimes | import numpy as np
from .. import parameters as iap
class Sometimes(Augmenter):
"""Apply child augmenter(s) with a probability of `p`.
Let ``C`` be one or more child augmenters given to
:class:`~imgaug.augmenters.meta.Sometimes`.
Let ``p`` be the fraction of images (or other data) to augment.
Let ... |
class Sometimes(Augmenter):
'''Apply child augmenter(s) with a probability of `p`.
Let ``C`` be one or more child augmenters given to
:class:`~imgaug.augmenters.meta.Sometimes`.
Let ``p`` be the fraction of images (or other data) to augment.
Let ``I`` be the input images (or other data).
Let ``... | 7 | 3 | 12 | 1 | 10 | 2 | 2 | 1.19 | 1 | 2 | 0 | 0 | 6 | 4 | 6 | 58 | 156 | 27 | 59 | 22 | 50 | 70 | 38 | 20 | 31 | 3 | 2 | 3 | 12 |
20,341 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta.WithChannels | import imgaug as ia
import numpy as np
class WithChannels(Augmenter):
"""Apply child augmenters to specific channels.
Let ``C`` be one or more child augmenters given to this augmenter.
Let ``H`` be a list of channels.
Let ``I`` be the input images.
Then this augmenter will pick the channels ``H`` ... |
class WithChannels(Augmenter):
'''Apply child augmenters to specific channels.
Let ``C`` be one or more child augmenters given to this augmenter.
Let ``H`` be a list of channels.
Let ``I`` be the input images.
Then this augmenter will pick the channels ``H`` from each image
in ``I`` (resulting ... | 18 | 3 | 12 | 1 | 10 | 1 | 2 | 0.57 | 1 | 5 | 0 | 0 | 9 | 2 | 13 | 65 | 245 | 39 | 131 | 36 | 111 | 75 | 81 | 30 | 67 | 7 | 2 | 3 | 32 |
20,342 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta._AssertLambdaCallback | class _AssertLambdaCallback(object):
def __init__(self, func, augmentable_name):
self.func = func
self.augmentable_name = augmentable_name
def __call__(self, augmentables, random_state, parents, hooks):
assert self.func(augmentables, random_state, parents, hooks), 'Input %s did not ful... | class _AssertLambdaCallback(object):
def __init__(self, func, augmentable_name):
pass
def __call__(self, augmentables, random_state, parents, hooks):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0.22 | 1 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 12 | 1 | 9 | 5 | 6 | 2 | 7 | 5 | 4 | 1 | 1 | 0 | 2 |
20,343 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/meta.py | imgaug.augmenters.meta._maybe_deterministic_ctx | class _maybe_deterministic_ctx(object):
"""Context that resets an RNG to its initial state upon exit.
This allows to execute some sampling functions and leave the code block
with the used RNG in the same state as before.
Parameters
----------
random_state : imgaug.random.RNG or imgaug.augmente... | class _maybe_deterministic_ctx(object):
'''Context that resets an RNG to its initial state upon exit.
This allows to execute some sampling functions and leave the code block
with the used RNG in the same state as before.
Parameters
----------
random_state : imgaug.random.RNG or imgaug.augmenters... | 4 | 1 | 6 | 0 | 6 | 0 | 2 | 0.78 | 1 | 0 | 0 | 0 | 3 | 3 | 3 | 3 | 38 | 7 | 18 | 8 | 14 | 14 | 16 | 8 | 12 | 2 | 1 | 1 | 6 |
20,344 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.Affine | from . import size as sizelib
from . import geometric
class Affine(geometric.Affine):
"""Apply PIL-like affine transformations to images.
This augmenter has identical outputs to
``PIL.Image.transform`` with parameter ``method=PIL.Image.AFFINE``.
.. warning::
This augmenter can currently only... |
class Affine(geometric.Affine):
'''Apply PIL-like affine transformations to images.
This augmenter has identical outputs to
``PIL.Image.transform`` with parameter ``method=PIL.Image.AFFINE``.
.. warning::
This augmenter can currently only transform image-data.
Batches containing heatmap... | 6 | 2 | 16 | 1 | 14 | 1 | 2 | 1.18 | 1 | 3 | 0 | 0 | 5 | 1 | 5 | 66 | 194 | 39 | 71 | 20 | 60 | 84 | 28 | 15 | 22 | 3 | 3 | 1 | 8 |
20,345 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.Autocontrast | from .. import parameters as iap
from . import contrast as contrastlib
class Autocontrast(contrastlib._ContrastFuncWrapper):
"""Adjust contrast by cutting off ``p%`` of lowest/highest histogram values.
This augmenter has identical outputs to ``PIL.ImageOps.autocontrast``.
See :func:`~imgaug.augmenters.pi... |
class Autocontrast(contrastlib._ContrastFuncWrapper):
'''Adjust contrast by cutting off ``p%`` of lowest/highest histogram values.
This augmenter has identical outputs to ``PIL.ImageOps.autocontrast``.
See :func:`~imgaug.augmenters.pillike.autocontrast` for more details.
Added in 0.4.0.
**Supported... | 2 | 1 | 19 | 1 | 18 | 0 | 1 | 2.58 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 87 | 19 | 19 | 6 | 15 | 49 | 5 | 4 | 3 | 1 | 3 | 0 | 1 |
20,346 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.EnhanceBrightness | class EnhanceBrightness(_EnhanceBase):
"""Change the brightness of images.
This augmenter has identical outputs to
``PIL.ImageEnhance.Brightness``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_brightness`.
Parameters
----------
factor : num... | class EnhanceBrightness(_EnhanceBase):
'''Change the brightness of images.
This augmenter has identical outputs to
``PIL.ImageEnhance.Brightness``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_brightness`.
Parameters
----------
factor : number o... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 4 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 64 | 14 | 10 | 4 | 6 | 40 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,347 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.EnhanceColor | class EnhanceColor(_EnhanceBase):
"""Convert images to grayscale.
This augmenter has identical outputs to ``PIL.ImageEnhance.Color``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_color`.
Parameters
----------
factor : number or tuple of number ... | class EnhanceColor(_EnhanceBase):
'''Convert images to grayscale.
This augmenter has identical outputs to ``PIL.ImageEnhance.Color``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_color`.
Parameters
----------
factor : number or tuple of number or li... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 3.9 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 63 | 14 | 10 | 4 | 6 | 39 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,348 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.EnhanceContrast | class EnhanceContrast(_EnhanceBase):
"""Change the contrast of images.
This augmenter has identical outputs to ``PIL.ImageEnhance.Contrast``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_contrast`.
Parameters
----------
factor : number or tuple... | class EnhanceContrast(_EnhanceBase):
'''Change the contrast of images.
This augmenter has identical outputs to ``PIL.ImageEnhance.Contrast``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_contrast`.
Parameters
----------
factor : number or tuple of n... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 4 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 64 | 14 | 10 | 4 | 6 | 40 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,349 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.EnhanceSharpness | class EnhanceSharpness(_EnhanceBase):
"""Change the sharpness of images.
This augmenter has identical outputs to
``PIL.ImageEnhance.Sharpness``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_sharpness`.
Parameters
----------
factor : number ... | class EnhanceSharpness(_EnhanceBase):
'''Change the sharpness of images.
This augmenter has identical outputs to
``PIL.ImageEnhance.Sharpness``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.enhance_sharpness`.
Parameters
----------
factor : number or tu... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 4 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 64 | 14 | 10 | 4 | 6 | 40 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,350 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.Equalize | from . import meta
class Equalize(meta.Augmenter):
"""Equalize the image histogram.
This augmenter has identical outputs to ``PIL.ImageOps.equalize``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.equalize_`.
Parameters
----------
seed : None or int or... |
class Equalize(meta.Augmenter):
'''Equalize the image histogram.
This augmenter has identical outputs to ``PIL.ImageOps.equalize``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.equalize_`.
Parameters
----------
seed : None or int or imgaug.random.RNG or nu... | 4 | 2 | 5 | 0 | 4 | 1 | 2 | 2.21 | 1 | 1 | 0 | 0 | 3 | 0 | 3 | 55 | 59 | 14 | 14 | 7 | 8 | 31 | 10 | 5 | 6 | 3 | 2 | 2 | 5 |
20,351 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterBlur | class FilterBlur(_FilterBase):
"""Apply a blur filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.BLUR``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_blur`.
Parameters
---... | class FilterBlur(_FilterBase):
'''Apply a blur filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.BLUR``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_blur`.
Parameters
--------... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 48 | 12 | 8 | 4 | 4 | 28 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,352 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterContour | class FilterContour(_FilterBase):
"""Apply a contour detection filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.CONTOUR``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_contour`.
... | class FilterContour(_FilterBase):
'''Apply a contour detection filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.CONTOUR``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_contour`.
P... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.63 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 49 | 12 | 8 | 4 | 4 | 29 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,353 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterDetail | class FilterDetail(_FilterBase):
"""Apply a detail enhancement filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.DETAIL``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_detail`.
... | class FilterDetail(_FilterBase):
'''Apply a detail enhancement filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.DETAIL``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_detail`.
Par... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.63 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 49 | 12 | 8 | 4 | 4 | 29 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,354 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterEdgeEnhance | class FilterEdgeEnhance(_FilterBase):
"""Apply an edge enhance filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel
``PIL.ImageFilter.EDGE_ENHANCE``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_ed... | class FilterEdgeEnhance(_FilterBase):
'''Apply an edge enhance filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel
``PIL.ImageFilter.EDGE_ENHANCE``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_edge_e... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.75 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 50 | 12 | 8 | 4 | 4 | 30 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,355 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterEdgeEnhanceMore | class FilterEdgeEnhanceMore(_FilterBase):
"""Apply a strong edge enhancement filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel
``PIL.ImageFilter.EDGE_ENHANCE_MORE``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenter... | class FilterEdgeEnhanceMore(_FilterBase):
'''Apply a strong edge enhancement filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel
``PIL.ImageFilter.EDGE_ENHANCE_MORE``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pi... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.75 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 50 | 12 | 8 | 4 | 4 | 30 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,356 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterEmboss | class FilterEmboss(_FilterBase):
"""Apply an emboss filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.EMBOSS``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_emboss`.
Parameter... | class FilterEmboss(_FilterBase):
'''Apply an emboss filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.EMBOSS``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_emboss`.
Parameters
... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 48 | 12 | 8 | 4 | 4 | 28 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,357 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterFindEdges | class FilterFindEdges(_FilterBase):
"""Apply a edge detection kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel
``PIL.ImageFilter.FIND_EDGES``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_find_edges`.... | class FilterFindEdges(_FilterBase):
'''Apply a edge detection kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel
``PIL.ImageFilter.FIND_EDGES``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_find_edges`.
... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.63 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 49 | 12 | 8 | 4 | 4 | 29 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,358 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterSharpen | class FilterSharpen(_FilterBase):
"""Apply a sharpening filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.SHARPEN``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_sharpen`.
Par... | class FilterSharpen(_FilterBase):
'''Apply a sharpening filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.SHARPEN``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_sharpen`.
Paramete... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 48 | 12 | 8 | 4 | 4 | 28 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,359 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterSmooth | class FilterSmooth(_FilterBase):
"""Apply a smoothening filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.SMOOTH``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_smooth`.
Param... | class FilterSmooth(_FilterBase):
'''Apply a smoothening filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.SMOOTH``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_smooth`.
Parameters... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 48 | 12 | 8 | 4 | 4 | 28 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,360 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.FilterSmoothMore | class FilterSmoothMore(_FilterBase):
"""Apply a strong smoothening filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.BLUR``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_smooth_mor... | class FilterSmoothMore(_FilterBase):
'''Apply a strong smoothening filter kernel to images.
This augmenter has identical outputs to
calling ``PIL.Image.filter`` with kernel ``PIL.ImageFilter.BLUR``.
Added in 0.4.0.
**Supported dtypes**:
See :func:`~imgaug.augmenters.pillike.filter_smooth_more`.
... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 3.63 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 49 | 12 | 8 | 4 | 4 | 29 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,361 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.Posterize | from . import color as colorlib
class Posterize(colorlib.Posterize):
"""Augmenter with identical outputs to PIL's ``posterize()`` function.
This augmenter quantizes each array component to ``N`` bits.
This class is currently an alias for
:class:`~imgaug.augmenters.color.Posterize`, which again is an ... |
class Posterize(colorlib.Posterize):
'''Augmenter with identical outputs to PIL's ``posterize()`` function.
This augmenter quantizes each array component to ``N`` bits.
This class is currently an alias for
:class:`~imgaug.augmenters.color.Posterize`, which again is an alias
for :class:`~imgaug.augm... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 11 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 61 | 18 | 6 | 1 | 1 | 0 | 11 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
20,362 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike.Solarize | from . import arithmetic
class Solarize(arithmetic.Invert):
"""Augmenter with identical outputs to PIL's ``solarize()`` function.
This augmenter inverts all pixel values above a threshold.
The outputs are identical to PIL's ``solarize()``.
Added in 0.4.0.
**Supported dtypes**:
See ``~imgau... |
class Solarize(arithmetic.Invert):
'''Augmenter with identical outputs to PIL's ``solarize()`` function.
This augmenter inverts all pixel values above a threshold.
The outputs are identical to PIL's ``solarize()``.
Added in 0.4.0.
**Supported dtypes**:
See ``~imgaug.augmenters.arithmetic.invert... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 3.3 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 58 | 15 | 10 | 4 | 6 | 33 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,363 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike._EnhanceBase | from .. import parameters as iap
from . import meta
class _EnhanceBase(meta.Augmenter):
def __init__(self, func, factor, factor_value_range, seed=None, name=None, random_state='deprecated', deterministic='deprecated'):
super(_EnhanceBase, self).__init__(seed=seed, name=name, random_state=random_state, det... |
class _EnhanceBase(meta.Augmenter):
def __init__(self, func, factor, factor_value_range, seed=None, name=None, random_state='deprecated', deterministic='deprecated'):
pass
def _augment_batch_(self, batch, random_state, parents, hooks):
pass
def _draw_samples(self, nb_rows, random_state):... | 5 | 1 | 6 | 0 | 5 | 0 | 2 | 0.23 | 1 | 2 | 0 | 4 | 4 | 2 | 4 | 56 | 31 | 4 | 22 | 11 | 15 | 5 | 16 | 9 | 11 | 3 | 2 | 1 | 6 |
20,364 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pillike.py | imgaug.augmenters.pillike._FilterBase | from . import meta
class _FilterBase(meta.Augmenter):
def __init__(self, func, seed=None, name=None, random_state='deprecated', deterministic='deprecated'):
super(_FilterBase, self).__init__(seed=seed, name=name, random_state=random_state, deterministic=deterministic)
self.func = func
def _au... |
class _FilterBase(meta.Augmenter):
def __init__(self, func, seed=None, name=None, random_state='deprecated', deterministic='deprecated'):
pass
def _augment_batch_(self, batch, random_state, parents, hooks):
pass
def get_parameters(self):
'''See :func:`~imgaug.augmenters.meta.Augm... | 4 | 1 | 5 | 0 | 5 | 0 | 2 | 0.27 | 1 | 1 | 0 | 10 | 3 | 1 | 3 | 55 | 21 | 2 | 15 | 8 | 9 | 4 | 11 | 6 | 7 | 3 | 2 | 2 | 5 |
20,365 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pooling.py | imgaug.augmenters.pooling.AveragePooling | import imgaug as ia
class AveragePooling(_AbstractPoolingBase):
"""
Apply average pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by averaging the
pixel values within these windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatical... |
class AveragePooling(_AbstractPoolingBase):
'''
Apply average pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by averaging the
pixel values within these windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatically re-upscale the ima... | 3 | 1 | 6 | 0 | 6 | 0 | 1 | 6.46 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 67 | 123 | 26 | 13 | 5 | 8 | 84 | 5 | 3 | 2 | 1 | 3 | 0 | 2 |
20,366 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pooling.py | imgaug.augmenters.pooling.MaxPooling | import imgaug as ia
class MaxPooling(_AbstractPoolingBase):
"""
Apply max pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by taking the
maximum pixel value over windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatically re-upscal... |
class MaxPooling(_AbstractPoolingBase):
'''
Apply max pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by taking the
maximum pixel value over windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatically re-upscale the image
to th... | 3 | 1 | 6 | 0 | 6 | 0 | 1 | 6.15 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 67 | 119 | 26 | 13 | 5 | 8 | 80 | 5 | 3 | 2 | 1 | 3 | 0 | 2 |
20,367 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pooling.py | imgaug.augmenters.pooling.MedianPooling | import imgaug as ia
class MedianPooling(_AbstractPoolingBase):
"""
Apply median pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by taking the
median pixel value over windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatically re-u... |
class MedianPooling(_AbstractPoolingBase):
'''
Apply median pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by taking the
median pixel value over windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatically re-upscale the image
... | 3 | 1 | 7 | 0 | 6 | 1 | 1 | 6.31 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 67 | 121 | 26 | 13 | 5 | 8 | 82 | 5 | 3 | 2 | 1 | 3 | 0 | 2 |
20,368 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pooling.py | imgaug.augmenters.pooling.MinPooling | import imgaug as ia
class MinPooling(_AbstractPoolingBase):
"""
Apply minimum pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by taking the
minimum pixel value over windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatically re-up... |
class MinPooling(_AbstractPoolingBase):
'''
Apply minimum pooling to images.
This augmenter pools images with kernel sizes ``H x W`` by taking the
minimum pixel value over windows. For e.g. ``2 x 2`` this halves the image
size. Optionally, the augmenter will automatically re-upscale the image
t... | 3 | 1 | 6 | 0 | 6 | 0 | 1 | 6.15 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 67 | 119 | 26 | 13 | 5 | 8 | 80 | 5 | 3 | 2 | 1 | 3 | 0 | 2 |
20,369 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/pooling.py | imgaug.augmenters.pooling._AbstractPoolingBase | import imgaug as ia
import functools
import numpy as np
from . import meta
import six
from .. import parameters as iap
from abc import ABCMeta, abstractmethod
@six.add_metaclass(ABCMeta)
class _AbstractPoolingBase(meta.Augmenter):
def __init__(self, kernel_size, keep_size=True, seed=None, name=None, random_state=... | @six.add_metaclass(ABCMeta)
class _AbstractPoolingBase(meta.Augmenter):
def __init__(self, kernel_size, keep_size=True, seed=None, name=None, random_state='deprecated', deterministic='deprecated'):
pass
@abstractmethod
def _pool_image(self, image, kernel_size_h, kernel_size_w):
'''Apply poo... | 16 | 2 | 10 | 1 | 8 | 0 | 2 | 0.16 | 1 | 5 | 0 | 4 | 13 | 3 | 13 | 65 | 151 | 26 | 108 | 45 | 89 | 17 | 74 | 40 | 60 | 5 | 2 | 3 | 28 |
20,370 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.DropoutPointsSampler | import numpy as np
import imgaug as ia
from .. import parameters as iap
from .. import random as iarandom
class DropoutPointsSampler(IPointsSampler):
"""Remove a defined fraction of sampled points.
Parameters
----------
other_points_sampler : IPointsSampler
Another point sampler that is querie... |
class DropoutPointsSampler(IPointsSampler):
'''Remove a defined fraction of sampled points.
Parameters
----------
other_points_sampler : IPointsSampler
Another point sampler that is queried to generate a list of points.
The dropout operation will be applied to that list.
p_drop : nu... | 11 | 1 | 9 | 0 | 8 | 1 | 2 | 0.59 | 1 | 7 | 4 | 0 | 6 | 2 | 8 | 9 | 126 | 15 | 70 | 24 | 59 | 41 | 46 | 22 | 37 | 4 | 2 | 3 | 14 |
20,371 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.IPointsSampler | from abc import ABCMeta, abstractmethod
import six
import six.moves as sm
@six.add_metaclass(ABCMeta)
class IPointsSampler(object):
"""Interface for all point samplers.
Point samplers return coordinate arrays of shape ``Nx2``.
These coordinates can be used in other augmenters, see e.g.
:class:`~imgaug... | @six.add_metaclass(ABCMeta)
class IPointsSampler(object):
'''Interface for all point samplers.
Point samplers return coordinate arrays of shape ``Nx2``.
These coordinates can be used in other augmenters, see e.g.
:class:`~imgaug.augmenters.segmentation.Voronoi`.
'''
@abstractmethod
def sampl... | 4 | 2 | 26 | 4 | 1 | 21 | 1 | 8.67 | 1 | 0 | 0 | 5 | 1 | 0 | 1 | 1 | 36 | 7 | 3 | 3 | 0 | 26 | 2 | 2 | 0 | 1 | 1 | 0 | 1 |
20,372 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.RegularGridPointsSampler | from .. import random as iarandom
from .. import parameters as iap
import numpy as np
class RegularGridPointsSampler(IPointsSampler):
"""Sampler that generates a regular grid of coordinates on an image.
'Regular grid' here means that on each axis all coordinates have the
same distance from each other. Not... |
class RegularGridPointsSampler(IPointsSampler):
'''Sampler that generates a regular grid of coordinates on an image.
'Regular grid' here means that on each axis all coordinates have the
same distance from each other. Note that the distance may change between
axis.
Parameters
----------
n_ro... | 12 | 1 | 8 | 1 | 7 | 1 | 1 | 0.88 | 1 | 2 | 1 | 0 | 5 | 2 | 8 | 9 | 127 | 20 | 57 | 32 | 45 | 50 | 48 | 29 | 39 | 3 | 2 | 1 | 11 |
20,373 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.RegularGridVoronoi | class RegularGridVoronoi(Voronoi):
"""Sample Voronoi cells from regular grids and color-average them.
This augmenter is a shortcut for the combination of
:class:`~imgaug.augmenters.segmentation.Voronoi`,
:class:`~imgaug.augmenters.segmentation.RegularGridPointsSampler` and
:class:`~imgaug.augmenter... | class RegularGridVoronoi(Voronoi):
'''Sample Voronoi cells from regular grids and color-average them.
This augmenter is a shortcut for the combination of
:class:`~imgaug.augmenters.segmentation.Voronoi`,
:class:`~imgaug.augmenters.segmentation.RegularGridPointsSampler` and
:class:`~imgaug.augmenters... | 2 | 1 | 15 | 0 | 15 | 0 | 1 | 7.75 | 1 | 3 | 2 | 0 | 1 | 0 | 1 | 57 | 165 | 25 | 16 | 6 | 10 | 124 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,374 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.RelativeRegularGridPointsSampler | from .. import parameters as iap
import numpy as np
from .. import random as iarandom
class RelativeRegularGridPointsSampler(IPointsSampler):
"""Regular grid coordinate sampler; places more points on larger images.
This is similar to ``RegularGridPointsSampler``, but the number of rows
and columns is give... |
class RelativeRegularGridPointsSampler(IPointsSampler):
'''Regular grid coordinate sampler; places more points on larger images.
This is similar to ``RegularGridPointsSampler``, but the number of rows
and columns is given as fractions of each image's height and width.
Hence, more coordinates are genera... | 6 | 1 | 8 | 1 | 7 | 0 | 1 | 1.35 | 1 | 2 | 2 | 0 | 5 | 2 | 5 | 6 | 96 | 16 | 34 | 18 | 28 | 46 | 25 | 18 | 19 | 1 | 2 | 0 | 5 |
20,375 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.RelativeRegularGridVoronoi | class RelativeRegularGridVoronoi(Voronoi):
"""Sample Voronoi cells from image-dependent grids and color-average them.
This augmenter is a shortcut for the combination of
:class:`~imgaug.augmenters.segmentation.Voronoi`,
:class:`~imgaug.augmenters.segmentation.RegularGridPointsSampler` and
:class:`~... | class RelativeRegularGridVoronoi(Voronoi):
'''Sample Voronoi cells from image-dependent grids and color-average them.
This augmenter is a shortcut for the combination of
:class:`~imgaug.augmenters.segmentation.Voronoi`,
:class:`~imgaug.augmenters.segmentation.RegularGridPointsSampler` and
:class:`~i... | 2 | 1 | 15 | 0 | 15 | 0 | 1 | 8.56 | 1 | 3 | 2 | 0 | 1 | 0 | 1 | 57 | 180 | 27 | 16 | 6 | 10 | 137 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,376 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.SubsamplingPointsSampler | import imgaug as ia
import numpy as np
from .. import random as iarandom
class SubsamplingPointsSampler(IPointsSampler):
"""Ensure that the number of sampled points is below a maximum.
This point sampler will sample points from another sampler and
then -- in case more points were generated than an allowed... |
class SubsamplingPointsSampler(IPointsSampler):
'''Ensure that the number of sampled points is below a maximum.
This point sampler will sample points from another sampler and
then -- in case more points were generated than an allowed maximum --
will randomly pick `n_points_max` of these.
Parameters... | 7 | 1 | 6 | 0 | 6 | 0 | 1 | 0.79 | 1 | 3 | 1 | 0 | 4 | 2 | 5 | 6 | 71 | 12 | 33 | 13 | 26 | 26 | 23 | 12 | 17 | 2 | 2 | 1 | 7 |
20,377 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.Superpixels | import skimage.measure
from . import meta
import skimage.segmentation
import imgaug as ia
from .. import parameters as iap
from .. import dtypes as iadt
import numpy as np
class Superpixels(meta.Augmenter):
"""Transform images parially/completely to their superpixel representation.
This implementation uses sk... |
class Superpixels(meta.Augmenter):
'''Transform images parially/completely to their superpixel representation.
This implementation uses skimage's version of the SLIC algorithm.
.. note::
This augmenter is fairly slow. See :ref:`performance`.
**Supported dtypes**:
if (image size <= max_size)... | 4 | 2 | 31 | 5 | 21 | 5 | 3 | 1.95 | 1 | 3 | 0 | 0 | 3 | 4 | 3 | 55 | 234 | 45 | 64 | 21 | 57 | 125 | 33 | 18 | 29 | 7 | 2 | 2 | 9 |
20,378 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.UniformPointsSampler | from .. import parameters as iap
import numpy as np
from .. import random as iarandom
class UniformPointsSampler(IPointsSampler):
"""Sample points uniformly on images.
This point sampler generates `n_points` points per image. The x- and
y-coordinates are both sampled from uniform distributions matching th... |
class UniformPointsSampler(IPointsSampler):
'''Sample points uniformly on images.
This point sampler generates `n_points` points per image. The x- and
y-coordinates are both sampled from uniform distributions matching the
respective image width and height.
Parameters
----------
n_points : i... | 8 | 1 | 7 | 1 | 6 | 0 | 1 | 0.59 | 1 | 2 | 1 | 0 | 5 | 1 | 6 | 7 | 79 | 17 | 39 | 26 | 30 | 23 | 33 | 24 | 26 | 2 | 2 | 1 | 7 |
20,379 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.UniformVoronoi | class UniformVoronoi(Voronoi):
"""Uniformly sample Voronoi cells on images and average colors within them.
This augmenter is a shortcut for the combination of
:class:`~imgaug.augmenters.segmentation.Voronoi` with
:class:`~imgaug.augmenters.segmentation.UniformPointsSampler`. Hence, it
generates a f... | class UniformVoronoi(Voronoi):
'''Uniformly sample Voronoi cells on images and average colors within them.
This augmenter is a shortcut for the combination of
:class:`~imgaug.augmenters.segmentation.Voronoi` with
:class:`~imgaug.augmenters.segmentation.UniformPointsSampler`. Hence, it
generates a fi... | 2 | 1 | 11 | 0 | 11 | 0 | 1 | 7.33 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 57 | 121 | 21 | 12 | 5 | 7 | 88 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,380 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/segmentation.py | imgaug.augmenters.segmentation.Voronoi | from .. import parameters as iap
from .. import dtypes as iadt
from . import meta
import imgaug as ia
class Voronoi(meta.Augmenter):
"""Average colors of an image within Voronoi cells.
This augmenter performs the following steps:
1. Query `points_sampler` to sample random coordinates of cell
... |
class Voronoi(meta.Augmenter):
'''Average colors of an image within Voronoi cells.
This augmenter performs the following steps:
1. Query `points_sampler` to sample random coordinates of cell
centers. On the image.
2. Estimate for each pixel to which voronoi cell (i.e. segment)
... | 5 | 2 | 13 | 3 | 11 | 0 | 2 | 2.42 | 1 | 5 | 1 | 3 | 4 | 4 | 4 | 56 | 182 | 35 | 43 | 21 | 35 | 104 | 30 | 18 | 25 | 3 | 2 | 1 | 7 |
20,381 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterCropToAspectRatio | class CenterCropToAspectRatio(CropToAspectRatio):
"""Crop images equally on all sides until they reach an aspect ratio.
This is the same as :class:`~imgaug.augmenters.size.CropToAspectRatio`, but
uses ``position="center"`` by default, which spreads the crop amounts
equally over all image sides, while
... | class CenterCropToAspectRatio(CropToAspectRatio):
'''Crop images equally on all sides until they reach an aspect ratio.
This is the same as :class:`~imgaug.augmenters.size.CropToAspectRatio`, but
uses ``position="center"`` by default, which spreads the crop amounts
equally over all image sides, while
... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.63 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 64 | 58 | 13 | 8 | 4 | 4 | 37 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,382 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterCropToFixedSize | class CenterCropToFixedSize(CropToFixedSize):
"""Take a crop from the center of each image.
This is an alias for :class:`~imgaug.augmenters.size.CropToFixedSize` with
``position="center"``.
.. note::
If images already have a width and/or height below the provided
width and/or height t... | class CenterCropToFixedSize(CropToFixedSize):
'''Take a crop from the center of each image.
This is an alias for :class:`~imgaug.augmenters.size.CropToFixedSize` with
``position="center"``.
.. note::
If images already have a width and/or height below the provided
width and/or height then... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.75 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 61 | 62 | 16 | 8 | 4 | 4 | 38 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,383 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterCropToMultiplesOf | class CenterCropToMultiplesOf(CropToMultiplesOf):
"""Crop images equally on all sides until H/W are multiples of given values.
This is the same as :class:`~imgaug.augmenters.size.CropToMultiplesOf`,
but uses ``position="center"`` by default, which spreads the crop amounts
equally over all image sides, ... | class CenterCropToMultiplesOf(CropToMultiplesOf):
'''Crop images equally on all sides until H/W are multiples of given values.
This is the same as :class:`~imgaug.augmenters.size.CropToMultiplesOf`,
but uses ``position="center"`` by default, which spreads the crop amounts
equally over all image sides, w... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 3.9 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 64 | 63 | 14 | 10 | 4 | 6 | 39 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,384 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterCropToPowersOf | class CenterCropToPowersOf(CropToPowersOf):
"""Crop images equally on all sides until H/W is a power of a base.
This is the same as :class:`~imgaug.augmenters.size.CropToPowersOf`, but
uses ``position="center"`` by default, which spreads the crop amounts
equally over all image sides, while
:class:`... | class CenterCropToPowersOf(CropToPowersOf):
'''Crop images equally on all sides until H/W is a power of a base.
This is the same as :class:`~imgaug.augmenters.size.CropToPowersOf`, but
uses ``position="center"`` by default, which spreads the crop amounts
equally over all image sides, while
:class:`~... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.88 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 64 | 61 | 14 | 8 | 4 | 4 | 39 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,385 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterCropToSquare | class CenterCropToSquare(CropToSquare):
"""Crop images equally on all sides until their height/width are identical.
In contrast to :class:`~imgaug.augmenters.size.CropToSquare`, this
augmenter always tries to spread the columns/rows to remove equally over
both sides of the respective axis to be cropped... | class CenterCropToSquare(CropToSquare):
'''Crop images equally on all sides until their height/width are identical.
In contrast to :class:`~imgaug.augmenters.size.CropToSquare`, this
augmenter always tries to spread the columns/rows to remove equally over
both sides of the respective axis to be cropped.... | 2 | 1 | 6 | 0 | 6 | 0 | 1 | 5.57 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 65 | 60 | 14 | 7 | 3 | 4 | 39 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
20,386 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterPadToAspectRatio | class CenterPadToAspectRatio(PadToAspectRatio):
"""Pad images equally on all sides until H/W matches an aspect ratio.
This is the same as :class:`~imgaug.augmenters.size.PadToAspectRatio`, but
uses ``position="center"`` by default, which spreads the pad amounts
equally over all image sides, while
:... | class CenterPadToAspectRatio(PadToAspectRatio):
'''Pad images equally on all sides until H/W matches an aspect ratio.
This is the same as :class:`~imgaug.augmenters.size.PadToAspectRatio`, but
uses ``position="center"`` by default, which spreads the pad amounts
equally over all image sides, while
:c... | 2 | 1 | 8 | 0 | 8 | 0 | 1 | 3.78 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 64 | 57 | 14 | 9 | 4 | 5 | 34 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,387 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterPadToFixedSize | class CenterPadToFixedSize(PadToFixedSize):
"""Pad images equally on all sides up to given minimum heights/widths.
This is an alias for :class:`~imgaug.augmenters.size.PadToFixedSize`
with ``position="center"``. It spreads the pad amounts equally over
all image sides, while :class:`~imgaug.augmenters.s... | class CenterPadToFixedSize(PadToFixedSize):
'''Pad images equally on all sides up to given minimum heights/widths.
This is an alias for :class:`~imgaug.augmenters.size.PadToFixedSize`
with ``position="center"``. It spreads the pad amounts equally over
all image sides, while :class:`~imgaug.augmenters.si... | 2 | 1 | 8 | 0 | 8 | 0 | 1 | 4.44 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 61 | 65 | 16 | 9 | 4 | 5 | 40 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,388 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterPadToMultiplesOf | class CenterPadToMultiplesOf(PadToMultiplesOf):
"""Pad images equally on all sides until H/W are multiples of given values.
This is the same as :class:`~imgaug.augmenters.size.PadToMultiplesOf`, but
uses ``position="center"`` by default, which spreads the pad amounts
equally over all image sides, while... | class CenterPadToMultiplesOf(PadToMultiplesOf):
'''Pad images equally on all sides until H/W are multiples of given values.
This is the same as :class:`~imgaug.augmenters.size.PadToMultiplesOf`, but
uses ``position="center"`` by default, which spreads the pad amounts
equally over all image sides, while
... | 2 | 1 | 12 | 0 | 12 | 0 | 1 | 3.31 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 64 | 72 | 16 | 13 | 5 | 8 | 43 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,389 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterPadToPowersOf | class CenterPadToPowersOf(PadToPowersOf):
"""Pad images equally on all sides until H/W is a power of a base.
This is the same as :class:`~imgaug.augmenters.size.PadToPowersOf`, but uses
``position="center"`` by default, which spreads the pad amounts equally
over all image sides, while :class:`~imgaug.a... | class CenterPadToPowersOf(PadToPowersOf):
'''Pad images equally on all sides until H/W is a power of a base.
This is the same as :class:`~imgaug.augmenters.size.PadToPowersOf`, but uses
``position="center"`` by default, which spreads the pad amounts equally
over all image sides, while :class:`~imgaug.au... | 2 | 1 | 10 | 0 | 10 | 0 | 1 | 3.82 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 64 | 69 | 16 | 11 | 5 | 6 | 42 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,390 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CenterPadToSquare | class CenterPadToSquare(PadToSquare):
"""Pad images equally on all sides until their height & width are identical.
This is the same as :class:`~imgaug.augmenters.size.PadToSquare`, but uses
``position="center"`` by default, which spreads the pad amounts equally
over all image sides, while :class:`~imga... | class CenterPadToSquare(PadToSquare):
'''Pad images equally on all sides until their height & width are identical.
This is the same as :class:`~imgaug.augmenters.size.PadToSquare`, but uses
``position="center"`` by default, which spreads the pad amounts equally
over all image sides, while :class:`~imgau... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 65 | 53 | 13 | 8 | 4 | 4 | 32 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
20,391 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.Crop | import imgaug as ia
from .. import parameters as iap
class Crop(CropAndPad):
"""Crop images, i.e. remove columns/rows of pixels at the sides of images.
This augmenter allows to extract smaller-sized subimages from given
full-sized input images. The number of pixels to cut off may be defined
in absolut... |
class Crop(CropAndPad):
'''Crop images, i.e. remove columns/rows of pixels at the sides of images.
This augmenter allows to extract smaller-sized subimages from given
full-sized input images. The number of pixels to cut off may be defined
in absolute values or as fractions of the image sizes.
This ... | 3 | 1 | 24 | 2 | 23 | 0 | 4 | 3.87 | 1 | 7 | 2 | 0 | 1 | 0 | 1 | 63 | 182 | 31 | 31 | 6 | 25 | 120 | 20 | 3 | 17 | 6 | 3 | 1 | 8 |
20,392 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CropAndPad | import imgaug as ia
import numpy as np
from .. import parameters as iap
import functools
from . import meta
class CropAndPad(meta.Augmenter):
"""Crop/pad images by pixel amounts or fractions of image sizes.
Cropping removes pixels at the sides (i.e. extracts a subimage from
a given full image). Padding ad... |
class CropAndPad(meta.Augmenter):
'''Crop/pad images by pixel amounts or fractions of image sizes.
Cropping removes pixels at the sides (i.e. extracts a subimage from
a given full image). Padding adds pixels to the sides (e.g. black pixels).
This augmenter will never crop images below a height or width... | 17 | 2 | 32 | 3 | 28 | 1 | 4 | 0.73 | 1 | 14 | 6 | 2 | 7 | 14 | 10 | 62 | 581 | 87 | 287 | 73 | 266 | 210 | 172 | 65 | 159 | 6 | 2 | 3 | 50 |
20,393 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CropToAspectRatio | class CropToAspectRatio(CropToFixedSize):
"""Crop images until their width/height matches an aspect ratio.
This augmenter removes either rows or columns until the image reaches
the desired aspect ratio given in ``width / height``. The cropping
operation is stopped once the desired aspect ratio is reach... | class CropToAspectRatio(CropToFixedSize):
'''Crop images until their width/height matches an aspect ratio.
This augmenter removes either rows or columns until the image reaches
the desired aspect ratio given in ``width / height``. The cropping
operation is stopped once the desired aspect ratio is reache... | 4 | 2 | 13 | 1 | 10 | 1 | 2 | 1.48 | 1 | 1 | 0 | 2 | 3 | 1 | 3 | 63 | 97 | 20 | 31 | 14 | 25 | 46 | 18 | 12 | 14 | 3 | 3 | 2 | 5 |
20,394 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CropToFixedSize | import functools
from . import meta
class CropToFixedSize(meta.Augmenter):
"""Crop images down to a predefined maximum width and/or height.
If images are already at the maximum width/height or are smaller, they
will not be cropped. Note that this also means that images will not be
padded if they are b... |
class CropToFixedSize(meta.Augmenter):
'''Crop images down to a predefined maximum width and/or height.
If images are already at the maximum width/height or are smaller, they
will not be cropped. Note that this also means that images will not be
padded if they are below the required width/height.
T... | 10 | 2 | 17 | 3 | 12 | 2 | 2 | 1.24 | 1 | 6 | 0 | 4 | 7 | 2 | 8 | 60 | 267 | 50 | 97 | 49 | 83 | 120 | 74 | 44 | 65 | 6 | 2 | 2 | 19 |
20,395 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CropToMultiplesOf | class CropToMultiplesOf(CropToFixedSize):
"""Crop images down until their height/width is a multiple of a value.
.. note::
For a given axis size ``A`` and multiple ``M``, if ``A`` is in the
interval ``[0 .. M]``, the axis will not be changed.
As a result, this augmenter can still produ... | class CropToMultiplesOf(CropToFixedSize):
'''Crop images down until their height/width is a multiple of a value.
.. note::
For a given axis size ``A`` and multiple ``M``, if ``A`` is in the
interval ``[0 .. M]``, the axis will not be changed.
As a result, this augmenter can still produce... | 4 | 2 | 12 | 1 | 10 | 1 | 1 | 1.7 | 1 | 1 | 0 | 1 | 3 | 2 | 3 | 63 | 102 | 21 | 30 | 15 | 24 | 51 | 17 | 13 | 13 | 2 | 3 | 1 | 4 |
20,396 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CropToPowersOf | class CropToPowersOf(CropToFixedSize):
"""Crop images until their height/width is a power of a base.
This augmenter removes pixels from an axis with size ``S`` leading to the
new size ``S'`` until ``S' = B^E`` is fulfilled, where ``B`` is a
provided base (e.g. ``2``) and ``E`` is an exponent from the d... | class CropToPowersOf(CropToFixedSize):
'''Crop images until their height/width is a power of a base.
This augmenter removes pixels from an axis with size ``S`` leading to the
new size ``S'`` until ``S' = B^E`` is fulfilled, where ``B`` is a
provided base (e.g. ``2``) and ``E`` is an exponent from the di... | 4 | 2 | 12 | 1 | 10 | 1 | 1 | 1.9 | 1 | 1 | 0 | 1 | 3 | 2 | 3 | 63 | 109 | 22 | 30 | 15 | 24 | 57 | 17 | 13 | 13 | 2 | 3 | 1 | 4 |
20,397 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.CropToSquare | class CropToSquare(CropToAspectRatio):
"""Crop images until their width and height are identical.
This is identical to :class:`~imgaug.augmenters.size.CropToAspectRatio`
with ``aspect_ratio=1.0``.
Images with axis sizes of ``0`` will not be altered.
Added in 0.4.0.
**Supported dtypes**:
... | class CropToSquare(CropToAspectRatio):
'''Crop images until their width and height are identical.
This is identical to :class:`~imgaug.augmenters.size.CropToAspectRatio`
with ``aspect_ratio=1.0``.
Images with axis sizes of ``0`` will not be altered.
Added in 0.4.0.
**Supported dtypes**:
See ... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 4.25 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 64 | 56 | 14 | 8 | 4 | 4 | 34 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,398 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.KeepSizeByResize | import imgaug as ia
import numpy as np
from .. import parameters as iap
import functools
from . import meta
class KeepSizeByResize(meta.Augmenter):
"""Resize images back to their input sizes after applying child augmenters.
Combining this with e.g. a cropping augmenter as the child will lead to
images bei... |
class KeepSizeByResize(meta.Augmenter):
'''Resize images back to their input sizes after applying child augmenters.
Combining this with e.g. a cropping augmenter as the child will lead to
images being resized back to the input size after the crop operation was
applied. Some augmenters have a ``keep_siz... | 18 | 3 | 20 | 2 | 17 | 2 | 3 | 0.61 | 1 | 11 | 3 | 0 | 7 | 4 | 11 | 63 | 347 | 54 | 182 | 61 | 157 | 111 | 115 | 49 | 102 | 7 | 2 | 3 | 36 |
20,399 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.Pad | from .. import parameters as iap
import imgaug as ia
class Pad(CropAndPad):
"""Pad images, i.e. adds columns/rows of pixels to them.
**Supported dtypes**:
See :class:`~imgaug.augmenters.size.CropAndPad`.
Parameters
----------
px : None or int or imgaug.parameters.StochasticParameter or tuple... |
class Pad(CropAndPad):
'''Pad images, i.e. adds columns/rows of pixels to them.
**Supported dtypes**:
See :class:`~imgaug.augmenters.size.CropAndPad`.
Parameters
----------
px : None or int or imgaug.parameters.StochasticParameter or tuple, optional
The number of pixels to pad on each s... | 3 | 1 | 25 | 2 | 24 | 0 | 4 | 4.82 | 1 | 6 | 1 | 0 | 1 | 0 | 1 | 63 | 231 | 39 | 33 | 6 | 27 | 159 | 20 | 3 | 17 | 6 | 3 | 1 | 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.