Update app.py
Browse files
app.py
CHANGED
@@ -220,18 +220,25 @@ def callback(image, coordinates, prompt):
|
|
220 |
# Retourner les images résultantes pour l'affichage
|
221 |
return segmented_image, grid_image
|
222 |
|
|
|
223 |
with gr.Blocks() as demo:
|
224 |
with gr.Row():
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
|
|
233 |
|
234 |
image_input.select(onclick, inputs=[image_input], outputs=coordinates_output)
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
236 |
|
237 |
demo.launch(debug=True)
|
|
|
220 |
# Retourner les images résultantes pour l'affichage
|
221 |
return segmented_image, grid_image
|
222 |
|
223 |
+
|
224 |
with gr.Blocks() as demo:
|
225 |
with gr.Row():
|
226 |
+
with gr.Column():
|
227 |
+
image_input = gr.Image(type="numpy", label="Upload Image", interactive=True)
|
228 |
+
coordinates_output = gr.Textbox(label="Coordinates", interactive=False)
|
229 |
+
prompt_input = gr.Textbox(label="What do you want to change?")
|
230 |
+
process_button = gr.Button("Process")
|
231 |
+
|
232 |
+
with gr.Column():
|
233 |
+
segmented_image_output = gr.Image(type="pil", label="Segmented Image")
|
234 |
+
grid_image_output = gr.Image(type="pil", label="Generated Image Grid")
|
235 |
|
236 |
image_input.select(onclick, inputs=[image_input], outputs=coordinates_output)
|
237 |
+
|
238 |
+
process_button.click(
|
239 |
+
fn=callback,
|
240 |
+
inputs=[image_input, coordinates_output, prompt_input],
|
241 |
+
outputs=[segmented_image_output, grid_image_output]
|
242 |
+
)
|
243 |
|
244 |
demo.launch(debug=True)
|