-
Notifications
You must be signed in to change notification settings - Fork 21
/
__init__.py
136 lines (125 loc) · 3.85 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""PIX public APIs."""
from dm_pix._src import augment
from dm_pix._src import color_conversion
from dm_pix._src import depth_and_space
from dm_pix._src import interpolation
from dm_pix._src import metrics
from dm_pix._src import patch
__version__ = "0.4.1"
# Augmentations.
adjust_brightness = augment.adjust_brightness
adjust_contrast = augment.adjust_contrast
adjust_gamma = augment.adjust_gamma
adjust_hue = augment.adjust_hue
adjust_saturation = augment.adjust_saturation
affine_transform = augment.affine_transform
center_crop = augment.center_crop
elastic_deformation = augment.elastic_deformation
flip_left_right = augment.flip_left_right
flip_up_down = augment.flip_up_down
gaussian_blur = augment.gaussian_blur
pad_to_size = augment.pad_to_size
random_brightness = augment.random_brightness
random_contrast = augment.random_contrast
random_crop = augment.random_crop
random_flip_left_right = augment.random_flip_left_right
random_flip_up_down = augment.random_flip_up_down
random_gamma = augment.random_gamma
random_hue = augment.random_hue
random_saturation = augment.random_saturation
resize_with_crop_or_pad = augment.resize_with_crop_or_pad
rotate = augment.rotate
rot90 = augment.rot90
solarize = augment.solarize
# Color conversions.
hsl_to_rgb = color_conversion.hsl_to_rgb
hsv_to_rgb = color_conversion.hsv_to_rgb
rgb_to_hsl = color_conversion.rgb_to_hsl
rgb_to_hsv = color_conversion.rgb_to_hsv
rgb_to_grayscale = color_conversion.rgb_to_grayscale
# Depth and space transformations.
depth_to_space = depth_and_space.depth_to_space
space_to_depth = depth_and_space.space_to_depth
# Interpolation functions.
flat_nd_linear_interpolate = interpolation.flat_nd_linear_interpolate
flat_nd_linear_interpolate_constant = (
interpolation.flat_nd_linear_interpolate_constant)
# Metrics.
mae = metrics.mae
mse = metrics.mse
psnr = metrics.psnr
rmse = metrics.rmse
simse = metrics.simse
ssim = metrics.ssim
# Patch extraction functions.
extract_patches = patch.extract_patches
del augment, color_conversion, depth_and_space, interpolation, metrics, patch
__all__ = (
"adjust_brightness",
"adjust_contrast",
"adjust_gamma",
"adjust_hue",
"adjust_saturation",
"affine_transform",
"center_crop",
"depth_to_space",
"elastic_deformation",
"extract_patches",
"flat_nd_linear_interpolate",
"flat_nd_linear_interpolate_constant",
"flip_left_right",
"flip_up_down",
"gaussian_blur",
"hsl_to_rgb",
"hsv_to_rgb",
"mae",
"mse",
"pad_to_size",
"psnr",
"random_brightness",
"random_contrast",
"random_crop",
"random_flip_left_right",
"random_flip_up_down",
"random_gamma",
"random_hue",
"random_saturation",
"resize_with_crop_or_pad",
"rotate",
"rgb_to_hsl",
"rgb_to_hsv",
"rgb_to_grayscale",
"rmse",
"rot90",
"simse",
"ssim",
"solarize",
"space_to_depth",
)
# _________________________________________
# / Please don't use symbols in `_src` they \
# \ are not part of the PIX public API. /
# -----------------------------------------
# \ ^__^
# \ (oo)\_______
# (__)\ )\/\
# ||----w |
# || ||
#
try:
del _src # pylint: disable=undefined-variable
except NameError:
pass