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
Hi, I encouter autoaugmented images below, and i locate the problem is caused by that the pic_array shape used in augmentations is in wrong oder and my image shape is not square.
make it correct
the size of PIL img is(width,height)
the shape of np.array which can be converted to PIL img should by (height,width,c), so the right way is s = pil_img.size pic_array = (np.array(pil_img.getdata()).reshape((s[1], s[0], 4)) / 255.0)
make it faster
I find np.array(pil_img.getdata()).reshape() is really slow, the much faster way is np.array(pil_img)
By the way, i have a question: why 'RGBA' format is used? Is 'RGBA' format image necessary? I checked the valued of 'A’ channel of my images are all 255.
Thank you.
The text was updated successfully, but these errors were encountered:
silencelamb
changed the title
pic_array shape used in augmentations is in wrong order, the augmented images are messy when the image shape is not square
encouter messy augmented images when the image shape is not square
May 24, 2020
Hi, I encouter autoaugmented images below, and i locate the problem is caused by that the pic_array shape used in augmentations is in wrong oder and my image shape is not square.
fixmatch/third_party/auto_augment/augmentations.py
Lines 160 to 161 in 08d9b83
make it correct
the size of PIL img is(width,height)
the shape of np.array which can be converted to PIL img should by (height,width,c), so the right way is
s = pil_img.size
pic_array = (np.array(pil_img.getdata()).reshape((s[1], s[0], 4)) / 255.0)
make it faster
I find
np.array(pil_img.getdata()).reshape()
is really slow, the much faster way isnp.array(pil_img)
By the way, i have a question: why 'RGBA' format is used? Is 'RGBA' format image necessary? I checked the valued of 'A’ channel of my images are all 255.
Thank you.
The text was updated successfully, but these errors were encountered: