Meloo commited on
Commit
50a2232
·
verified ·
1 Parent(s): f48a07e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -2
app.py CHANGED
@@ -151,7 +151,7 @@ def inference(image, upscale, large_input_flag, color_fix):
151
  output = np.transpose(output[[2, 1, 0], :, :], (1, 2, 0))
152
  output = (output * 255.0).round().astype(np.uint8)
153
 
154
- return image, Image.fromarray(output)
155
 
156
 
157
 
@@ -200,6 +200,26 @@ css = """
200
  }
201
  """
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  demo = gr.Interface(
204
  fn=inference,
205
  inputs=[
@@ -209,10 +229,13 @@ demo = gr.Interface(
209
  gr.Checkbox(value=False, label="Color correction"),
210
  ],
211
 
212
- outputs=ImageSlider(label="Super-Resolved Image",
 
213
  type="pil",
214
  show_download_button=True,
215
  ),
 
 
216
  title=title,
217
  description=description,
218
  article=article,
@@ -220,5 +243,6 @@ demo = gr.Interface(
220
  css=css,
221
  )
222
 
 
223
  if __name__ == "__main__":
224
  demo.launch()
 
151
  output = np.transpose(output[[2, 1, 0], :, :], (1, 2, 0))
152
  output = (output * 255.0).round().astype(np.uint8)
153
 
154
+ return (image, Image.fromarray(output)), output
155
 
156
 
157
 
 
200
  }
201
  """
202
 
203
+ # demo = gr.Interface(
204
+ # fn=inference,
205
+ # inputs=[
206
+ # gr.Image(value="real_testdata/060.png", type="pil", label="Input"),
207
+ # gr.Number(minimum=2, maximum=4, label="Upscaling factor (up to 4)"),
208
+ # gr.Checkbox(value=False, label="Memory-efficient inference"),
209
+ # gr.Checkbox(value=False, label="Color correction"),
210
+ # ],
211
+
212
+ # outputs = ImageSlider(label="Super-Resolved Image",
213
+ # type="pil",
214
+ # show_download_button=True,
215
+ # ),
216
+ # title=title,
217
+ # description=description,
218
+ # article=article,
219
+ # examples=examples,
220
+ # css=css,
221
+ # )
222
+
223
  demo = gr.Interface(
224
  fn=inference,
225
  inputs=[
 
229
  gr.Checkbox(value=False, label="Color correction"),
230
  ],
231
 
232
+ outputs = [
233
+ ImageSlider(label="Super-Resolved Image",
234
  type="pil",
235
  show_download_button=True,
236
  ),
237
+ gr.Image()
238
+ ],
239
  title=title,
240
  description=description,
241
  article=article,
 
243
  css=css,
244
  )
245
 
246
+
247
  if __name__ == "__main__":
248
  demo.launch()