solt 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
solt/__init__.py ADDED
@@ -0,0 +1,21 @@
1
+ __version__ = "0.2"
2
+
3
+ from . import constants, transforms, core, utils
4
+
5
+ from .core import Stream, SelectiveStream
6
+ from .core import DataContainer, Keypoints
7
+ from .utils import from_yaml, from_dict, from_json
8
+
9
+ __all__ = [
10
+ "constants",
11
+ "transforms",
12
+ "core",
13
+ "utils",
14
+ "from_dict",
15
+ "from_json",
16
+ "from_yaml",
17
+ "Stream",
18
+ "SelectiveStream",
19
+ "DataContainer",
20
+ "Keypoints",
21
+ ]
@@ -0,0 +1,56 @@
1
+ """
2
+ Constants module
3
+
4
+ .. data:: ALLOWED_BLURS
5
+
6
+ Defines the blur modes. Can be ``'g'`` - gaussian or ``'m'`` - median.
7
+
8
+ .. data:: ALLOWED_TYPES
9
+
10
+ Defines the allowed types to be stored in a DataCantainer. Can be
11
+ ``'I'`` - image, ``'M'`` - mask, ``'L'`` - labels, ``'P'`` - Keypoints.
12
+
13
+ .. data:: ALLOWED_CROPS
14
+
15
+ Defines the allowed crops. Can be ``'r'`` - random crop or ``'c'`` - center crop.
16
+
17
+ .. data:: ALLOWED_PADDINGS
18
+
19
+ Defines the allowed crops. Can be ``'z'`` - zero padding or ``'r'`` - reflective padding.
20
+
21
+ .. data:: ALLOWED_INTERPOLATIONS
22
+
23
+ Defines the allowed interpolation modes. Can be ``'bilinear'``, ``'nearest'`` or ``'bicubic'``.
24
+
25
+ .. data:: DTYPES_MAX
26
+
27
+ Defines the maximums for different data types. Can be ``numpy.uint8`` or ``numpy.uint16``.
28
+
29
+ .. data:: ALLOWED_COLOR_CONVERSIONS
30
+
31
+ Defines the allowed color conversion modes. Can be ``'gs2rgb'``, ``'rgb2gs'`` or ``'none'``.
32
+
33
+
34
+ """
35
+
36
+ from ._constants import (
37
+ ALLOWED_BLURS,
38
+ ALLOWED_TYPES,
39
+ ALLOWED_CROPS,
40
+ ALLOWED_PADDINGS,
41
+ ALLOWED_INTERPOLATIONS,
42
+ DTYPES_MAX,
43
+ ALLOWED_COLOR_CONVERSIONS,
44
+ ALLOWED_GRIDMASK_MODES,
45
+ )
46
+
47
+ __all__ = [
48
+ "ALLOWED_BLURS",
49
+ "ALLOWED_TYPES",
50
+ "ALLOWED_CROPS",
51
+ "ALLOWED_PADDINGS",
52
+ "ALLOWED_INTERPOLATIONS",
53
+ "DTYPES_MAX",
54
+ "ALLOWED_COLOR_CONVERSIONS",
55
+ "ALLOWED_GRIDMASK_MODES",
56
+ ]
@@ -0,0 +1,17 @@
1
+ import cv2
2
+ import numpy as np
3
+
4
+ ALLOWED_PADDINGS = {"z": cv2.BORDER_CONSTANT, "r": cv2.BORDER_REFLECT_101}
5
+ ALLOWED_INTERPOLATIONS = {
6
+ "bilinear": cv2.INTER_LINEAR,
7
+ "bicubic": cv2.INTER_CUBIC,
8
+ "nearest": cv2.INTER_NEAREST,
9
+ "area": cv2.INTER_AREA,
10
+ "lanczos": cv2.INTER_LANCZOS4,
11
+ }
12
+ ALLOWED_CROPS = {"c", "r"}
13
+ ALLOWED_TYPES = {"I", "M", "P", "L"}
14
+ ALLOWED_BLURS = {"g", "m", "mo"}
15
+ ALLOWED_COLOR_CONVERSIONS = {"gs2rgb", "rgb2gs", "none"}
16
+ DTYPES_MAX = {np.dtype("uint8"): 255, np.dtype("uint16"): 65536}
17
+ ALLOWED_GRIDMASK_MODES = {"crop", "reserve", "none"}
solt/core/__init__.py ADDED
@@ -0,0 +1,24 @@
1
+ from ._core import Stream, SelectiveStream
2
+ from ._base_transforms import (
3
+ BaseTransform,
4
+ MatrixTransform,
5
+ )
6
+ from ._base_transforms import (
7
+ PaddingPropertyHolder,
8
+ InterpolationPropertyHolder,
9
+ ImageTransform,
10
+ )
11
+ from ._data import DataContainer, Keypoints
12
+
13
+
14
+ __all__ = [
15
+ "Stream",
16
+ "SelectiveStream",
17
+ "DataContainer",
18
+ "Keypoints",
19
+ "BaseTransform",
20
+ "MatrixTransform",
21
+ "PaddingPropertyHolder",
22
+ "InterpolationPropertyHolder",
23
+ "ImageTransform",
24
+ ]