Browse Source

repair parameter problem in Uniform augmentation

tags/v0.3.0-alpha
ms_yan 5 years ago
parent
commit
d6f27f5a4a
2 changed files with 4 additions and 3 deletions
  1. +2
    -2
      mindspore/dataset/transforms/vision/c_transforms.py
  2. +2
    -1
      mindspore/dataset/transforms/vision/validators.py

+ 2
- 2
mindspore/dataset/transforms/vision/c_transforms.py View File

@@ -452,11 +452,11 @@ class Pad(cde.PadOp):


class UniformAugment(cde.UniformAugOp): class UniformAugment(cde.UniformAugOp):
""" """
Tensor operation to perform randomly selected augmentation
Tensor operation to perform randomly selected augmentation.


Args: Args:
operations: list of C++ operations (python OPs are not accepted). operations: list of C++ operations (python OPs are not accepted).
NumOps (int): number of OPs to be selected and applied.
num_ops (int): number of OPs to be selected and applied.


Examples: Examples:
>>> transforms_list = [c_transforms.RandomHorizontalFlip(), >>> transforms_list = [c_transforms.RandomHorizontalFlip(),


+ 2
- 1
mindspore/dataset/transforms/vision/validators.py View File

@@ -23,6 +23,7 @@ from .utils import Inter, Border
from ...transforms.validators import check_pos_int32, check_pos_float32, check_value, check_uint8, FLOAT_MAX_INTEGER, \ from ...transforms.validators import check_pos_int32, check_pos_float32, check_value, check_uint8, FLOAT_MAX_INTEGER, \
check_bool, check_2tuple, check_range, check_list, check_type, check_positive, INT32_MAX check_bool, check_2tuple, check_range, check_list, check_type, check_positive, INT32_MAX



def check_inter_mode(mode): def check_inter_mode(mode):
if not isinstance(mode, Inter): if not isinstance(mode, Inter):
raise ValueError("Invalid interpolation mode.") raise ValueError("Invalid interpolation mode.")
@@ -838,7 +839,7 @@ def check_uniform_augmentation(method):
if num_ops > len(operations): if num_ops > len(operations):
raise ValueError("num_ops is greater than operations list size") raise ValueError("num_ops is greater than operations list size")
if not isinstance(operations, list): if not isinstance(operations, list):
raise ValueError("operations is not a python list")
raise TypeError("operations is not a python list")
for op in operations: for op in operations:
if not isinstance(op, TensorOp): if not isinstance(op, TensorOp):
raise ValueError("operations list only accepts C++ operations.") raise ValueError("operations list only accepts C++ operations.")


Loading…
Cancel
Save