Skip to content

Commit 53a326c

Browse files
ppwwyyxxfacebook-github-bot
authored andcommitted
Small docs update
Differential Revision: D13951213 fbshipit-source-id: 416d0a300b2dbd02b6956f5abeb2dd2bcdba320b
1 parent 610f273 commit 53a326c

File tree

1 file changed

+9
-5
lines changed
  • maskrcnn_benchmark/data/transforms

1 file changed

+9
-5
lines changed

maskrcnn_benchmark/data/transforms/base.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ def check_dtype(img):
2323
class ImageTransformer(metaclass=ABCMeta):
2424
"""
2525
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.
2833
"""
2934

3035
def __init__(self):
@@ -84,6 +89,7 @@ def _transform_image_get_params(self, img):
8489
def transform_image_with_params(self, img, param):
8590
"""
8691
Transform the image with the given param.
92+
The transform is allowed to modify image in-place.
8793
8894
Args:
8995
img: input image
@@ -97,9 +103,7 @@ def transform_image_with_params(self, img, param):
97103
@abstractmethod
98104
def _transform_image(self, img, param):
99105
"""
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.
103107
Should be overwritten by subclasses
104108
"""
105109

0 commit comments

Comments
 (0)