You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the GaussianBlur to filter the input images, the outputs are always the same as the inputs.
Here is a snippet to reproduce the problem.
importnumpyasnpfrommmpretrain.datasets.transformsimportGaussianBlur# Create a simple imageimg_ori=np.zeros((128, 128), dtype=np.uint8)
img_ori[32:96, 32:96] =255results= {'img': img_ori.copy()}
# Run the GaussianBlurblur=GaussianBlur(radius=10, prob=1.0)
results=blur.transform(results)
img_blur=results['img']
# `img_blur` is expected to be different from `img_ori`# but actually `img_blur` is exactly equal to `img_ori`np.all(img_blur==img_ori) # False expected, but got True!
I think the image is blurred, but the result is not properly saved.
The GaussianBlur class is in "mmpretrain/mmpretrain/datasets/transforms/auto_augment.py".
In the GaussianBlur.transform method, the blurred image returned by the following code is not properly saved,
pil_img=Image.fromarray(img)
pil_img.filter(ImageFilter.GaussianBlur(radius=radius)) # This is not an in-place operation.results['img'] =np.array(pil_img, dtype=img.dtype)
It should be
pil_img=Image.fromarray(img)
pil_img=pil_img.filter(ImageFilter.GaussianBlur(radius=radius)) # The result should be savedresults['img'] =np.array(pil_img, dtype=img.dtype)
The text was updated successfully, but these errors were encountered:
Branch
main branch (mmpretrain version)
Describe the bug
When I use the
GaussianBlur
to filter the input images, the outputs are always the same as the inputs.Here is a snippet to reproduce the problem.
Environment
Other information
I think the image is blurred, but the result is not properly saved.
The
GaussianBlur
class is in "mmpretrain/mmpretrain/datasets/transforms/auto_augment.py".In the
GaussianBlur.transform
method, the blurred image returned by the following code is not properly saved,It should be
The text was updated successfully, but these errors were encountered: