diff --git a/mindarmour/natural_robustness/transform/image/blur.py b/mindarmour/natural_robustness/transform/image/blur.py index e63b52f..f53a13f 100644 --- a/mindarmour/natural_robustness/transform/image/blur.py +++ b/mindarmour/natural_robustness/transform/image/blur.py @@ -34,7 +34,7 @@ class GaussianBlur(_NaturalPerturb): ksize (int): Size of gaussian kernel, this value must be non-negnative. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> ksize = 5 @@ -74,11 +74,11 @@ class MotionBlur(_NaturalPerturb): Args: degree (int): Degree of blur. This value must be positive. Suggested value range in [1, 15]. - angle: (union[float, int]): Direction of motion blur. Angle=0 means up and down motion blur. Angle is + angle (union[float, int]): Direction of motion blur. Angle=0 means up and down motion blur. Angle is counterclockwise. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> angle = 0 @@ -132,7 +132,7 @@ class GradientBlur(_NaturalPerturb): center (bool): Blurred or clear at the center of a specified point. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('xx.png') >>> img = np.array(img) >>> number = 5 diff --git a/mindarmour/natural_robustness/transform/image/corruption.py b/mindarmour/natural_robustness/transform/image/corruption.py index e80019b..0e66c19 100644 --- a/mindarmour/natural_robustness/transform/image/corruption.py +++ b/mindarmour/natural_robustness/transform/image/corruption.py @@ -35,7 +35,7 @@ class UniformNoise(_NaturalPerturb): [0.001, 0.15]. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> factor = 0.1 @@ -80,7 +80,7 @@ class GaussianNoise(_NaturalPerturb): [0.001, 0.15]. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> factor = 0.1 @@ -124,7 +124,7 @@ class SaltAndPepperNoise(_NaturalPerturb): [0.001, 0.15]. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> factor = 0.1 diff --git a/mindarmour/natural_robustness/transform/image/luminance.py b/mindarmour/natural_robustness/transform/image/luminance.py index da9063d..89e9827 100644 --- a/mindarmour/natural_robustness/transform/image/luminance.py +++ b/mindarmour/natural_robustness/transform/image/luminance.py @@ -28,16 +28,16 @@ TAG = 'Image Luminance' class Contrast(_NaturalPerturb): - """ + r""" Contrast of an image. Args: - alpha (Union[float, int]): Control the contrast of an image. :math:`out_image = in_image*alpha+beta`. + alpha (Union[float, int]): Control the contrast of an image. :math:`out\_image = in\_image*alpha+beta`. Suggested value range in [0.2, 2]. beta (Union[float, int]): Delta added to alpha. Default: 0. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> alpha = 0.1 diff --git a/mindarmour/natural_robustness/transform/image/transformation.py b/mindarmour/natural_robustness/transform/image/transformation.py index 0a90fed..73e157c 100644 --- a/mindarmour/natural_robustness/transform/image/transformation.py +++ b/mindarmour/natural_robustness/transform/image/transformation.py @@ -37,7 +37,7 @@ class Translate(_NaturalPerturb): in [-0.1, 0.1]. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> x_bias = 0.1 @@ -84,7 +84,7 @@ class Scale(_NaturalPerturb): abs(factor_y - factor_x) < 0.5. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> factor_x = 0.7 @@ -131,7 +131,7 @@ class Shear(_NaturalPerturb): direction (str): Direction of deformation. Optional value is 'vertical' or 'horizontal'. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> factor = 0.2 @@ -186,7 +186,7 @@ class Rotate(_NaturalPerturb): angle (Union[float, int]): Degrees of counter clockwise. Suggested value range in [-60, 60]. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> angle = 20 @@ -240,7 +240,7 @@ class Perspective(_NaturalPerturb): dst_pos (list): The point coordinates of the 4 points in ori_pos after perspective transformation. auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. - Example: + Examples: >>> img = cv2.imread('1.png') >>> img = np.array(img) >>> ori_pos = [[0, 0], [0, 800], [800, 0], [800, 800]]