code error
morestart opened this issue · comments
TianLun Cui commented
class RandomNoise:
def __init__(self, random_rate):
self.random_rate = random_rate
def __call__(self, data: dict):
"""
对图片加噪声
:param data: {'img':,'text_polys':,'texts':,'ignore_tags':}
:return:
"""
if random.random() > self.random_rate:
return data
data['img'] = (random_noise(data['img'], mode='gaussian', clip=True) * 255).astype(im.dtype)
return data
astype(im.dtype), im is not found, may be is data['img'].dtype?
Tao Luo commented
you are right,could you PR your correct code to me?
TianLun Cui commented
ok, i will create a pr
TianLun Cui commented
PR submitted