Changed ImageEditor block to match gradio docs
Browse files
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
3 |
def predict(im):
|
4 |
-
return im
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
demo = gr.Interface(fn=predict, inputs="imageeditor", outputs="text")
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
|
4 |
def predict(im):
|
5 |
+
return im["composite"]
|
6 |
+
|
7 |
+
|
8 |
+
with gr.Blocks(fill_height=true, fill_width=True) as demo:
|
9 |
+
with gr.Row():
|
10 |
+
im = gr.ImageEditor(
|
11 |
+
type="numpy",
|
12 |
+
crop_size="1:1"
|
13 |
+
)
|
14 |
+
im_preview = gr.Image()
|
15 |
|
|
|
16 |
demo.launch()
|