Tonic commited on
Commit
b2dbd13
1 Parent(s): 0f77d88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -20,13 +20,15 @@ def process_image(img):
20
 
21
  return '\n'.join(results) if isinstance(results, list) else results
22
 
23
- iface = gr.Interface(
24
- gr.Markdown(title),
25
- gr.Markdown(description),
26
- fn=process_image,
27
- inputs=gr.Image(type="pil"),
28
- outputs="text"
29
- )
 
 
30
 
31
  if __name__ == "__main__":
32
- iface.launch()
 
20
 
21
  return '\n'.join(results) if isinstance(results, list) else results
22
 
23
+ with gr.Blocks() as app:
24
+ gr.Markdown(title)
25
+ gr.Markdown(description)
26
+ with gr.Row():
27
+ with gr.Column():
28
+ image_input = gr.Image(type="pil")
29
+ with gr.Column():
30
+ output = gr.Textbox()
31
+ image_input.change(process_image, inputs=image_input, outputs=output)
32
 
33
  if __name__ == "__main__":
34
+ app.launch()