Browse Source

fix issues

tags/v1.2.1
ZhidanLiu 4 years ago
parent
commit
a30128b681
2 changed files with 5 additions and 7 deletions
  1. +4
    -6
      mindarmour/fuzzing/fuzzing.py
  2. +1
    -1
      mindarmour/fuzzing/image_transform.py

+ 4
- 6
mindarmour/fuzzing/fuzzing.py View File

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


+ 1
- 1
mindarmour/fuzzing/image_transform.py View File

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

Loading…
Cancel
Save