TheoBH commited on
Commit
ecf94bd
·
verified ·
1 Parent(s): 004b372

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -9
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
- image_input = gr.Image(type="numpy", label="Upload Image", interactive=True)
226
- coordinates_output = gr.Textbox(label="Coordinates")
227
- with gr.Row():
228
- prompt_input = gr.Textbox(label="What do you want to change?")
229
- submit_button = gr.Button("Submit")
230
- with gr.Row():
231
- segmented_image_output = gr.Image(type="numpy", label="Segmented Image")
232
- grid_image_output = gr.Image(type="pil", label="Generated Image Grid")
 
233
 
234
  image_input.select(onclick, inputs=[image_input], outputs=coordinates_output)
235
- submit_button.click(fn=callback, inputs=[image_input, coordinates_output, prompt_input], outputs=[segmented_image_output, grid_image_output])
 
 
 
 
 
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)