zachwormgoor@gmail.com commited on
Commit
4faf144
β€’
1 Parent(s): 0cf05c7

image preview update

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -111,6 +111,7 @@ with demo:
111
  with gr.Row():
112
  text_r_input = gr.Textbox()
113
  text_r_output = gr.outputs.Label()
 
114
  url_r_button = gr.Button("Predict")
115
  with gr.TabItem("Image - convnext_tiny"):
116
  with gr.Row():
@@ -121,6 +122,7 @@ with demo:
121
  with gr.Row():
122
  text_c_input = gr.Textbox()
123
  text_c_output = gr.outputs.Label()
 
124
  text_c_button = gr.Button("Predict")
125
  with gr.TabItem("URL - debug"):
126
  with gr.Row():
@@ -129,9 +131,9 @@ with demo:
129
  text_d_button = gr.Button("Predict - debug")
130
 
131
  image_r_button.click(classify_image_resnet, inputs=img_r_input, outputs=img_r_output)
132
- url_r_button.click( classify_image_url_resnet, inputs=text_r_input, outputs=[text_r_output,gr.Image()])
133
  image_c_button.click(classify_image_convnext, inputs=img_c_input, outputs=img_c_output)
134
- text_c_button.click( classify_image_url_convnext, inputs=text_c_input, outputs=[text_c_output, gr.Image()])
135
  text_d_button.click( classify_image_url_debug, inputs=text_d_input, outputs=text_d_output)
136
 
137
  demo.launch()
 
111
  with gr.Row():
112
  text_r_input = gr.Textbox()
113
  text_r_output = gr.outputs.Label()
114
+ text_r_preview = gr.Image()
115
  url_r_button = gr.Button("Predict")
116
  with gr.TabItem("Image - convnext_tiny"):
117
  with gr.Row():
 
122
  with gr.Row():
123
  text_c_input = gr.Textbox()
124
  text_c_output = gr.outputs.Label()
125
+ text_c_preview = gr.Image()
126
  text_c_button = gr.Button("Predict")
127
  with gr.TabItem("URL - debug"):
128
  with gr.Row():
 
131
  text_d_button = gr.Button("Predict - debug")
132
 
133
  image_r_button.click(classify_image_resnet, inputs=img_r_input, outputs=img_r_output)
134
+ url_r_button.click( classify_image_url_resnet, inputs=text_r_input, outputs=[text_r_output,text_r_preview])
135
  image_c_button.click(classify_image_convnext, inputs=img_c_input, outputs=img_c_output)
136
+ text_c_button.click( classify_image_url_convnext, inputs=text_c_input, outputs=[text_c_output,text_c_preview])
137
  text_d_button.click( classify_image_url_debug, inputs=text_d_input, outputs=text_d_output)
138
 
139
  demo.launch()