Zilong-Zhang003 commited on
Commit
528fad1
·
1 Parent(s): ad63267
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -107,6 +107,7 @@ def restore_image(pil_img: Image.Image) -> Image.Image:
107
  output = normalize(output, -1 * mean / std, 1 / std)
108
  output = output.data.squeeze().float().cpu().clamp_(0, 1).numpy() # (3,H,W)
109
  output = (output * 255.0).round().astype(np.uint8)
 
110
  out_pil = Image.fromarray(output, mode="RGB")
111
  return out_pil
112
  except Exception as e:
 
107
  output = normalize(output, -1 * mean / std, 1 / std)
108
  output = output.data.squeeze().float().cpu().clamp_(0, 1).numpy() # (3,H,W)
109
  output = (output * 255.0).round().astype(np.uint8)
110
+ output = np.transpose(output, (1, 2, 0))
111
  out_pil = Image.fromarray(output, mode="RGB")
112
  return out_pil
113
  except Exception as e: