Browse Source

!384 fix api issues

Merge pull request !384 from JiaqiHuang/master
pull/388/MERGE
i-robot Gitee 2 years ago
parent
commit
f5931e05bd
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 15 additions and 15 deletions
  1. +4
    -4
      mindarmour/natural_robustness/transform/image/blur.py
  2. +3
    -3
      mindarmour/natural_robustness/transform/image/corruption.py
  3. +3
    -3
      mindarmour/natural_robustness/transform/image/luminance.py
  4. +5
    -5
      mindarmour/natural_robustness/transform/image/transformation.py

+ 4
- 4
mindarmour/natural_robustness/transform/image/blur.py View File

@@ -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


+ 3
- 3
mindarmour/natural_robustness/transform/image/corruption.py View File

@@ -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


+ 3
- 3
mindarmour/natural_robustness/transform/image/luminance.py View File

@@ -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


+ 5
- 5
mindarmour/natural_robustness/transform/image/transformation.py View File

@@ -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]]


Loading…
Cancel
Save