dwb2023 commited on
Commit
fbaba7f
·
verified ·
1 Parent(s): fcb6651

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -72,12 +72,11 @@ with gr.Blocks() as demo:
72
  info_output = gr.Textbox(label="Image Information", lines=10)
73
 
74
  def update_slider(category_id):
75
- _, _, max_index = draw_annotations(0, category_id)
76
- return gr.Slider.update(maximum=max_index)
77
 
78
  # Update image and info when slider or category changes
79
- category_id_dropdown.change(update_slider, inputs=category_id_dropdown, outputs=image_index)
80
- category_id_dropdown.change(draw_annotations, inputs=[image_index, category_id_dropdown], outputs=[image_output, info_output, image_index])
81
  image_index.change(draw_annotations, inputs=[image_index, category_id_dropdown], outputs=[image_output, info_output, image_index])
82
 
83
  # Display initial image and info
 
72
  info_output = gr.Textbox(label="Image Information", lines=10)
73
 
74
  def update_slider(category_id):
75
+ img, info, max_index = draw_annotations(0, category_id)
76
+ return gr.Slider.update(maximum=max_index), img, info
77
 
78
  # Update image and info when slider or category changes
79
+ category_id_dropdown.change(update_slider, inputs=category_id_dropdown, outputs=[image_index, image_output, info_output])
 
80
  image_index.change(draw_annotations, inputs=[image_index, category_id_dropdown], outputs=[image_output, info_output, image_index])
81
 
82
  # Display initial image and info