GRMenon commited on
Commit
9738334
1 Parent(s): 4df709d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -2,6 +2,7 @@ import numpy as np
2
 
3
  from dehazing_gen import CycleGenerator
4
 
 
5
  import torch
6
  from torchvision import transforms
7
 
@@ -37,7 +38,9 @@ with gr.Blocks() as demo:
37
  dehaze_button = gr.Button("Dehaze")
38
  with gr.Column():
39
  output_image = gr.Image(label="Output Image", type="pil")
40
- for name, file in sample_images:
41
- gr.Button(name).click(dehaze, inputs=input_image, outputs=output_image)
 
 
42
 
43
  demo.launch()
 
2
 
3
  from dehazing_gen import CycleGenerator
4
 
5
+ from PIL import Image
6
  import torch
7
  from torchvision import transforms
8
 
 
38
  dehaze_button = gr.Button("Dehaze")
39
  with gr.Column():
40
  output_image = gr.Image(label="Output Image", type="pil")
41
+ gr.Markdown("### Choose from these sample images below:")
42
+ for name, file_path in sample_images:
43
+ gr.Button(name).click(lambda fp=file_path:Image.open(fp), outputs=input_image)
44
+ dehaze_button.click(dehaze, inputs=input_image, outputs=output_image)
45
 
46
  demo.launch()