yupikopi commited on
Commit
62062d9
·
1 Parent(s): dcf8cc9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,6 +4,8 @@ import numpy as np
4
  import random
5
  from keras.models import load_model
6
  import cv2
 
 
7
 
8
 
9
  def psnr(y_true, y_pred):
@@ -22,7 +24,8 @@ def sepia(inp):
22
  sepia_img = sepia_img / 255.0
23
  sepia_img = model.predict(sepia_img)
24
  sepia_img = sepia_img*255
25
- sepia_img = sepia_img.reshape(img_height, img_width, 3)
 
26
  return sepia_img
27
 
28
  demo = gr.Interface(fn=sepia, inputs=gr.inputs.Image(256,256),outputs="image").launch()
 
4
  import random
5
  from keras.models import load_model
6
  import cv2
7
+ from PIL import Image
8
+
9
 
10
 
11
  def psnr(y_true, y_pred):
 
24
  sepia_img = sepia_img / 255.0
25
  sepia_img = model.predict(sepia_img)
26
  sepia_img = sepia_img*255
27
+ #sepia_img = sepia_img.reshape(img_height, img_width, 3)
28
+ sepia_img = Image.fromarray(sepia_img)
29
  return sepia_img
30
 
31
  demo = gr.Interface(fn=sepia, inputs=gr.inputs.Image(256,256),outputs="image").launch()