Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,16 +29,15 @@ def generate_image_by_description(description):
|
|
29 |
|
30 |
|
31 |
with gr.Blocks() as demo:
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
demo.launch()
|
|
|
29 |
|
30 |
|
31 |
with gr.Blocks() as demo:
|
32 |
+
with gr.Row():
|
33 |
+
with gr.Column(scale=2, min_width=300):
|
34 |
+
selected_image = gr.Image(type="filepath", label="Upload an Image of the Pigeon",height=300)
|
35 |
+
generate_button = gr.Button("Generate Avatar", variant="primary")
|
36 |
+
with gr.Column(scale=2, min_width=300):
|
37 |
+
generated_image = gr.Image(type="numpy", label="Generated Avatar", height=300)
|
38 |
+
def process_and_generate(image):
|
39 |
+
description = generate_description(image)
|
40 |
+
return generate_image_by_description(description)
|
41 |
+
|
42 |
+
generate_button.click(process_and_generate, inputs=selected_image, outputs=generated_image)
|
|
|
43 |
demo.launch()
|