lksshw / SRNet

A pytorch implementation of the SRNet architecture from the paper Editing text in the wild (Liang Wu et al.)
152 stars 35 forks source link

about F.to_pil_image #4

Closed CCC-123 closed 4 years ago

CCC-123 commented 4 years ago

Hi, i encounter some problem in image saving. https://github.com/Niwhskal/SRNet/blob/30bb6a5370b2a087e87ac71e255272491c87f1c6/predict.py#L88-L90 I found in F.to_pil_image it multiplies with 255 if input is floattensor, and save result will be noise. And

 o_t = F.to_pil_image((o_t + 1)/2)

will work.

lksshw commented 4 years ago

True, this is a bug. Thanks for pointing it out. . I've updated the predict file.