@@ -23,8 +23,13 @@ def check_dtype(img):
23
23
class ImageTransformer (metaclass = ABCMeta ):
24
24
"""
25
25
ImageTransformer takes an image of type uint8 in range [0, 255], or
26
- floating point in range [0, 1] or [0, 255], as input and applies
27
- ImageTransform ops on the image.
26
+ floating point in range [0, 1] or [0, 255] as input.
27
+ It applies image transformation on the image, and optionally
28
+ returns the "transformation parameters" which can be used
29
+ to transform another image, or transform the coordinates in the image.
30
+
31
+ The implementation may choose to modify the input image or coordinates
32
+ in-place for efficient transformation.
28
33
"""
29
34
30
35
def __init__ (self ):
@@ -84,6 +89,7 @@ def _transform_image_get_params(self, img):
84
89
def transform_image_with_params (self , img , param ):
85
90
"""
86
91
Transform the image with the given param.
92
+ The transform is allowed to modify image in-place.
87
93
88
94
Args:
89
95
img: input image
@@ -97,9 +103,7 @@ def transform_image_with_params(self, img, param):
97
103
@abstractmethod
98
104
def _transform_image (self , img , param ):
99
105
"""
100
- Transform with the given param and return the new image.
101
- The transformer is allowed to modify image in-place.
102
-
106
+ Transform the image with the given param.
103
107
Should be overwritten by subclasses
104
108
"""
105
109
0 commit comments