From a30128b681e5b614c9cf2b98b9b6f9fe758383bc Mon Sep 17 00:00:00 2001 From: ZhidanLiu Date: Tue, 25 Aug 2020 11:35:30 +0800 Subject: [PATCH] fix issues --- mindarmour/fuzzing/fuzzing.py | 10 ++++------ mindarmour/fuzzing/image_transform.py | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mindarmour/fuzzing/fuzzing.py b/mindarmour/fuzzing/fuzzing.py index 36fa162..3b8bcfc 100644 --- a/mindarmour/fuzzing/fuzzing.py +++ b/mindarmour/fuzzing/fuzzing.py @@ -120,20 +120,18 @@ class Fuzzer: 'FGSM': {'params': {'eps': {'dtype': [float, int], 'range': [0, 1]}, 'alpha': {'dtype': [float, int], 'range': [0, 1]}, - 'bounds': {'dtype': [list, tuple], - 'range': None}}}, + 'bounds': {'dtype': [list, tuple]}}}, 'PGD': {'params': {'eps': {'dtype': [float, int], 'range': [0, 1]}, 'eps_iter': {'dtype': [float, int], 'range': [0, 1e5]}, 'nb_iter': {'dtype': [float, int], 'range': [0, 1e5]}, - 'bounds': {'dtype': [list, tuple], - 'range': None}}}, + 'bounds': {'dtype': [list, tuple]}}}, 'MDIIM': { 'params': {'eps': {'dtype': [float, int], 'range': [0, 1]}, - 'norm_level': {'dtype': [str], 'range': None}, + 'norm_level': {'dtype': [str]}, 'prob': {'dtype': [float, int], 'range': [0, 1]}, - 'bounds': {'dtype': [list, tuple], 'range': None}}}} + 'bounds': {'dtype': [list, tuple]}}}} def fuzzing(self, mutate_config, initial_seeds, coverage_metric='KMNC', eval_metrics='auto', max_iters=10000, mutate_num_per_seed=20): diff --git a/mindarmour/fuzzing/image_transform.py b/mindarmour/fuzzing/image_transform.py index 44e5a6f..77ff6d0 100644 --- a/mindarmour/fuzzing/image_transform.py +++ b/mindarmour/fuzzing/image_transform.py @@ -579,7 +579,7 @@ class Rotate(ImageTransform): """ _, chw, normalized, gray3dim, image = self._check(image) img = to_pil(image) - trans_image = img.rotate(self.angle, expand=True) + trans_image = img.rotate(self.angle, expand=False) trans_image = self._original_format(trans_image, chw, normalized, gray3dim) return trans_image -- GitLab