* Fix issue 1711. GaussianBlur. * Fix UT --------- Co-authored-by: mzr1996 <mzr1996@163.com>pull/1728/head
parent
60d780f99e
commit
2b8d8eecb2
|
@ -1169,7 +1169,7 @@ class GaussianBlur(BaseAugTransform):
|
|||
|
||||
img = results['img']
|
||||
pil_img = Image.fromarray(img)
|
||||
pil_img.filter(ImageFilter.GaussianBlur(radius=radius))
|
||||
pil_img = pil_img.filter(ImageFilter.GaussianBlur(radius=radius))
|
||||
results['img'] = np.array(pil_img, dtype=img.dtype)
|
||||
|
||||
return results
|
||||
|
|
|
@ -1285,9 +1285,10 @@ class TestGaussianBlur(TestCase):
|
|||
|
||||
def test_transform(self):
|
||||
transform_func = 'PIL.ImageFilter.GaussianBlur'
|
||||
from PIL.ImageFilter import GaussianBlur
|
||||
|
||||
# test params inputs
|
||||
with patch(transform_func, autospec=True) as mock:
|
||||
with patch(transform_func, wraps=GaussianBlur) as mock:
|
||||
cfg = {
|
||||
**self.DEFAULT_ARGS,
|
||||
'radius': 0.5,
|
||||
|
@ -1297,7 +1298,7 @@ class TestGaussianBlur(TestCase):
|
|||
mock.assert_called_once_with(radius=0.5)
|
||||
|
||||
# test prob
|
||||
with patch(transform_func, autospec=True) as mock:
|
||||
with patch(transform_func, wraps=GaussianBlur) as mock:
|
||||
cfg = {
|
||||
**self.DEFAULT_ARGS,
|
||||
'radius': 0.5,
|
||||
|
@ -1307,7 +1308,7 @@ class TestGaussianBlur(TestCase):
|
|||
mock.assert_not_called()
|
||||
|
||||
# test magnitude_range
|
||||
with patch(transform_func, autospec=True) as mock:
|
||||
with patch(transform_func, wraps=GaussianBlur) as mock:
|
||||
cfg = {
|
||||
**self.DEFAULT_ARGS,
|
||||
'magnitude_range': (0.1, 2),
|
||||
|
|
Loading…
Reference in New Issue