SMD00 commited on
Commit
a9beaea
·
1 Parent(s): 38e90aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -301,7 +301,7 @@ def visualize(model, data, dims):
301
  real_imgs = lab_to_rgb(L, real_color)
302
  # img=cv.resize(fake_imgs[0], dsize=(dims[1], dims[0]), interpolation=cv.INTER_CUBIC)
303
  img=fake_imgs[0]
304
- # return np.resize(img,(dims[1], dims[0]))
305
  return fake_imgs[0]
306
  for i in range(1):
307
  # t_img = transforms.Resize((dims[0], dims[1]))(t_img)
@@ -369,15 +369,14 @@ def main_func(filepath):
369
  model.setup_input(data)
370
  model.optimize()
371
  img=visualize(model, data, a)
372
- img=img.resize(a)
373
- return (size_text,img)
374
 
375
  title = "Image Colorization"
376
  description = "Gradio demo for Image Colorization project. You can give an image as input on the left side and then click on the submit button. The program would recolorize the image"
377
  gr.Interface(
378
  main_func,
379
  [gr.Image(type="filepath", label="Input Image") ],
380
- [gr.Textbox(label="Image Size"),gr.Image(type="pil", label="Output Image")],
381
  title=title,
382
  description=description,
383
  examples=[ ['face.jpg'], ['montains.jpg'],['tree.jpg'] ]
 
301
  real_imgs = lab_to_rgb(L, real_color)
302
  # img=cv.resize(fake_imgs[0], dsize=(dims[1], dims[0]), interpolation=cv.INTER_CUBIC)
303
  img=fake_imgs[0]
304
+ return np.resize(img,(dims[1], dims[0]))
305
  return fake_imgs[0]
306
  for i in range(1):
307
  # t_img = transforms.Resize((dims[0], dims[1]))(t_img)
 
369
  model.setup_input(data)
370
  model.optimize()
371
  img=visualize(model, data, a)
372
+ return (size_text,img,img,img)
 
373
 
374
  title = "Image Colorization"
375
  description = "Gradio demo for Image Colorization project. You can give an image as input on the left side and then click on the submit button. The program would recolorize the image"
376
  gr.Interface(
377
  main_func,
378
  [gr.Image(type="filepath", label="Input Image") ],
379
+ [gr.Textbox(label="Image Size"),gr.Image(type="pil", label="Output Image"),gr.Image( label="Output Image2"),"image"],
380
  title=title,
381
  description=description,
382
  examples=[ ['face.jpg'], ['montains.jpg'],['tree.jpg'] ]