danhtran2mind commited on
Commit
8d9808e
·
verified ·
1 Parent(s): e323c1b

Update apps/gradio_app.py

Browse files
Files changed (1) hide show
  1. apps/gradio_app.py +8 -6
apps/gradio_app.py CHANGED
@@ -65,11 +65,6 @@ with gr.Blocks(css=custom_css) as iface:
65
  interactive=True, # Allow row selection
66
  elem_classes="custom-table"
67
  )
68
- examples_table.change(
69
- fn=select_example,
70
- inputs=[examples_table, examples_table],
71
- outputs=[input_file, input_type, output_image, output_video, output_text]
72
- )
73
 
74
  with gr.Column(scale=2):
75
  with gr.Blocks():
@@ -77,6 +72,13 @@ with gr.Blocks(css=custom_css) as iface:
77
  output_video = gr.Video(label="Processed Output (Video)", visible=False, elem_classes="custom-video")
78
  output_text = gr.Textbox(label="Detected License Plates", lines=10, elem_classes="custom-textbox")
79
 
 
 
 
 
 
 
 
80
  # Update preview and output visibility when input type changes
81
  input_type.change(
82
  fn=update_visibility,
@@ -105,4 +107,4 @@ with gr.Blocks(css=custom_css) as iface:
105
  )
106
 
107
  if __name__ == "__main__":
108
- iface.launch()
 
65
  interactive=True, # Allow row selection
66
  elem_classes="custom-table"
67
  )
 
 
 
 
 
68
 
69
  with gr.Column(scale=2):
70
  with gr.Blocks():
 
72
  output_video = gr.Video(label="Processed Output (Video)", visible=False, elem_classes="custom-video")
73
  output_text = gr.Textbox(label="Detected License Plates", lines=10, elem_classes="custom-textbox")
74
 
75
+ # Bind example selection after all components are defined
76
+ examples_table.change(
77
+ fn=select_example,
78
+ inputs=[examples_table, examples_table],
79
+ outputs=[input_file, input_type, output_image, output_video, output_text]
80
+ )
81
+
82
  # Update preview and output visibility when input type changes
83
  input_type.change(
84
  fn=update_visibility,
 
107
  )
108
 
109
  if __name__ == "__main__":
110
+ iface.launch(share=True)