Jangai commited on
Commit
902e00e
·
verified ·
1 Parent(s): fa04c17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
app.py CHANGED
@@ -1,18 +1,14 @@
1
  import gradio as gr
2
  import numpy as np
3
 
4
- def display_sketch(image):
5
- return image
 
6
 
7
  with gr.Blocks() as demo:
8
- gr.Markdown("## Sketchpad Visualization")
9
- with gr.Row():
10
- with gr.Column():
11
- sketchpad = gr.Sketchpad(label="Draw Something")
12
- with gr.Column():
13
- output_image = gr.Image(type="numpy", label="Your Sketch")
14
 
15
- sketchpad.change(fn=display_sketch, inputs=sketchpad, outputs=output_image)
16
 
17
- if __name__ == "__main__":
18
- demo.launch()
 
1
  import gradio as gr
2
  import numpy as np
3
 
4
+ def display_sketch(sketch):
5
+ # Directly return the sketch as it is already an image
6
+ return sketch
7
 
8
  with gr.Blocks() as demo:
9
+ sketchpad = gr.Sketchpad(label="Draw Something")
10
+ output_image = gr.Image(label="Your Sketch")
 
 
 
 
11
 
12
+ sketchpad.submit(display_sketch, inputs=sketchpad, outputs=output_image)
13
 
14
+ demo.launch(share=True)