@@ -17,7 +17,7 @@ | |||||
import numpy as np | import numpy as np | ||||
import cv2 | import cv2 | ||||
from mindarmour.natural_robustness.image import Translate, Curve, Perspective, Scale, Shear, Rotate, SaltAndPepperNoise, \ | |||||
from mindarmour.natural_robustness.transform.image import Translate, Curve, Perspective, Scale, Shear, Rotate, SaltAndPepperNoise, \ | |||||
NaturalNoise, GaussianNoise, UniformNoise, MotionBlur, GaussianBlur, GradientBlur, Contrast, GradientLuminance | NaturalNoise, GaussianNoise, UniformNoise, MotionBlur, GaussianBlur, GradientBlur, Contrast, GradientLuminance | ||||
@@ -21,7 +21,7 @@ import cv2 | |||||
import numpy as np | import numpy as np | ||||
from PIL import Image | from PIL import Image | ||||
from mindspore_serving.server import register | from mindspore_serving.server import register | ||||
from mindarmour.natural_robustness.image import Contrast, GaussianBlur, SaltAndPepperNoise, Scale, Shear, \ | |||||
from mindarmour.natural_robustness.transform.image import Contrast, GaussianBlur, SaltAndPepperNoise, Scale, Shear, \ | |||||
Translate, Rotate, MotionBlur, GradientBlur, GradientLuminance, NaturalNoise, Curve, Perspective | Translate, Rotate, MotionBlur, GradientBlur, GradientLuminance, NaturalNoise, Curve, Perspective | ||||
@@ -0,0 +1,16 @@ | |||||
# Copyright 2022 Huawei Technologies Co., Ltd | |||||
# | |||||
# Licensed under the Apache License, Version 2.0 (the "License"); | |||||
# you may not use this file except in compliance with the License. | |||||
# You may obtain a copy of the License at | |||||
# | |||||
# http://www.apache.org/licenses/LICENSE-2.0 | |||||
# | |||||
# Unless required by applicable law or agreed to in writing, software | |||||
# distributed under the License is distributed on an "AS IS" BASIS, | |||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
# See the License for the specific language governing permissions and | |||||
# limitations under the License. | |||||
""" | |||||
Image Transform Method for Natural Robustness. | |||||
""" |
@@ -18,7 +18,7 @@ Image Blur | |||||
import numpy as np | import numpy as np | ||||
import cv2 | import cv2 | ||||
from mindarmour.natural_robustness.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.natural_robustness.transform.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.utils._check_param import check_param_multi_types, check_int_positive, check_param_type | from mindarmour.utils._check_param import check_param_multi_types, check_int_positive, check_param_type | ||||
from mindarmour.utils.logger import LogUtil | from mindarmour.utils.logger import LogUtil | ||||
@@ -18,7 +18,7 @@ import math | |||||
import numpy as np | import numpy as np | ||||
import cv2 | import cv2 | ||||
from mindarmour.natural_robustness.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.natural_robustness.transform.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.utils._check_param import check_param_multi_types, check_param_type | from mindarmour.utils._check_param import check_param_multi_types, check_param_type | ||||
from mindarmour.utils.logger import LogUtil | from mindarmour.utils.logger import LogUtil | ||||
@@ -18,7 +18,7 @@ import math | |||||
import numpy as np | import numpy as np | ||||
import cv2 | import cv2 | ||||
from mindarmour.natural_robustness.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.natural_robustness.transform.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.utils._check_param import check_param_multi_types, check_param_in_range, check_param_type, \ | from mindarmour.utils._check_param import check_param_multi_types, check_param_in_range, check_param_type, \ | ||||
check_value_non_negative | check_value_non_negative | ||||
from mindarmour.utils.logger import LogUtil | from mindarmour.utils.logger import LogUtil |
@@ -18,7 +18,7 @@ import math | |||||
import numpy as np | import numpy as np | ||||
import cv2 | import cv2 | ||||
from mindarmour.natural_robustness.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.natural_robustness.transform.image.natural_perturb import _NaturalPerturb | |||||
from mindarmour.utils._check_param import check_param_multi_types, check_param_type, check_value_non_negative | from mindarmour.utils._check_param import check_param_multi_types, check_param_type, check_value_non_negative | ||||
from mindarmour.utils.logger import LogUtil | from mindarmour.utils.logger import LogUtil | ||||
@@ -18,8 +18,9 @@ import pytest | |||||
import numpy as np | import numpy as np | ||||
from mindspore import context | from mindspore import context | ||||
from mindarmour.natural_robustness.image import Translate, Curve, Perspective, Scale, Shear, Rotate, SaltAndPepperNoise, \ | |||||
NaturalNoise, GaussianNoise, UniformNoise, MotionBlur, GaussianBlur, GradientBlur, Contrast, GradientLuminance | |||||
from mindarmour.natural_robustness.transform.image import Translate, Curve, Perspective, Scale, Shear, Rotate, \ | |||||
SaltAndPepperNoise, NaturalNoise, GaussianNoise, UniformNoise, MotionBlur, GaussianBlur, GradientBlur, Contrast,\ | |||||
GradientLuminance | |||||
@pytest.mark.level0 | @pytest.mark.level0 | ||||