ntsc207 commited on
Commit
76c31e9
·
verified ·
1 Parent(s): 0455a4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -135,6 +135,9 @@ def yolov9_inference(model_id, img_path=None, vid_path=None, tracking_algorithm
135
  return output_image, output_video, fig
136
 
137
  def app():
 
 
 
138
  with gr.Blocks(title="YOLOv9: Real-time Object Detection", css=".gradio-container {background:lightyellow;}"):
139
  with gr.Row():
140
  with gr.Column():
@@ -142,7 +145,7 @@ def app():
142
  img_path = gr.Image(label="Image", height = 260, width = 410)
143
  vid_path = gr.Video(label="Video", height = 260, width = 410)
144
  #gr.HTML("<img src='flie/img_examples/clasess.png'>")
145
- gr.Image(value = "./img_examples/clasess.png", interactive = False)
146
  #gr.Examples(['./img_examples/Exam_1.png','./img_examples/Exam_2.png','./img_examples/Exam_3.png','./img_examples/Exam_4.png','./img_examples/Exam_5.png'], inputs=img_path,label = "Image Example", cache_examples = False)
147
  #gr.Examples(['./video_examples/video_1.mp4', './video_examples/video_2.mp4','./video_examples/video_3.mp4','./video_examples/video_4.mp4','./video_examples/video_5.mp4'], inputs=vid_path, label = "Video Example", cache_examples = False)
148
  with gr.Column(min_width = 270):
 
135
  return output_image, output_video, fig
136
 
137
  def app():
138
+ img = Image.open('./img_examples/classes.png')
139
+ img = img.resize((410, 260), Image.Resampling.LANCZOS)
140
+ img = np.array(img)
141
  with gr.Blocks(title="YOLOv9: Real-time Object Detection", css=".gradio-container {background:lightyellow;}"):
142
  with gr.Row():
143
  with gr.Column():
 
145
  img_path = gr.Image(label="Image", height = 260, width = 410)
146
  vid_path = gr.Video(label="Video", height = 260, width = 410)
147
  #gr.HTML("<img src='flie/img_examples/clasess.png'>")
148
+ gr.Image(value = img, interactive = False, label = "Classes", height = 260, width = 410)
149
  #gr.Examples(['./img_examples/Exam_1.png','./img_examples/Exam_2.png','./img_examples/Exam_3.png','./img_examples/Exam_4.png','./img_examples/Exam_5.png'], inputs=img_path,label = "Image Example", cache_examples = False)
150
  #gr.Examples(['./video_examples/video_1.mp4', './video_examples/video_2.mp4','./video_examples/video_3.mp4','./video_examples/video_4.mp4','./video_examples/video_5.mp4'], inputs=vid_path, label = "Video Example", cache_examples = False)
151
  with gr.Column(min_width = 270):