Bhaskar Saranga commited on
Commit
d4c1aca
1 Parent(s): 58e86c5

markdown dynamic update

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -183,10 +183,13 @@ examples_videos = ['data/video/1.mp4','data/video/2.mp4']
183
 
184
  models = ['yolov8m','yolov7','yolov7t']
185
 
 
 
 
186
  with gr.Blocks() as demo:
187
  gr.Markdown("## IDD Inference on Yolo V7 and V8 ")
188
  with gr.Tab("Image"):
189
- gr.Markdown("## Yolo V7 and V8 Inference on Image")
190
  with gr.Row():
191
  image_input = gr.Image(type='pil', label="Input Image", source="upload")
192
  image_output = gr.Image(type='pil', label="Output Image", source="upload")
@@ -196,6 +199,7 @@ with gr.Blocks() as demo:
196
  image_conf_threshold = gr.Slider(label="Confidence Threshold",interactive=True, minimum=0.0, maximum=1.0, value=0.25)
197
  gr.Examples(examples=examples_images,inputs=image_input,outputs=image_output)
198
  text_button = gr.Button("Detect")
 
199
  with gr.Tab("Video"):
200
  gr.Markdown("## Yolo V7 and V8 Inference on Video")
201
  with gr.Row():
 
183
 
184
  models = ['yolov8m','yolov7','yolov7t']
185
 
186
+ def update_markdown(value):
187
+ return f"## {value} Inference on Image"
188
+
189
  with gr.Blocks() as demo:
190
  gr.Markdown("## IDD Inference on Yolo V7 and V8 ")
191
  with gr.Tab("Image"):
192
+ im_md= gr.Markdown("## Yolo V7 and V8 Inference on Image")
193
  with gr.Row():
194
  image_input = gr.Image(type='pil', label="Input Image", source="upload")
195
  image_output = gr.Image(type='pil', label="Output Image", source="upload")
 
199
  image_conf_threshold = gr.Slider(label="Confidence Threshold",interactive=True, minimum=0.0, maximum=1.0, value=0.25)
200
  gr.Examples(examples=examples_images,inputs=image_input,outputs=image_output)
201
  text_button = gr.Button("Detect")
202
+ image_drop.change(update_markdown,image_drop,im_md)
203
  with gr.Tab("Video"):
204
  gr.Markdown("## Yolo V7 and V8 Inference on Video")
205
  with gr.Row():