cxeep commited on
Commit
001ff47
·
verified ·
1 Parent(s): 0e9ed99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -2,10 +2,9 @@ import gradio as gr
2
  import subprocess
3
  import os
4
 
5
- def run_yolov5s(image):
6
- image.save("input.jpg")
7
- result = subprocess.run(["./yolov5s-tt100k", "-m", "./yolov5s_tt100k_opt_fp32.tmfile", "-i", "input.jpg"], capture_output=True, text=True)
8
  return "yolov5s-tt100k.out.jpg", result.stdout
9
 
10
- iface = gr.Interface(fn=run_yolov5s, inputs=gr.Image(), outputs=[gr.Image(type="filepath"), gr.Textbox()])
11
  iface.launch()
 
2
  import subprocess
3
  import os
4
 
5
+ def run_yolov5s(image_filepath):
6
+ result = subprocess.run(["./yolov5s-tt100k", "-m", "./yolov5s_tt100k_opt_fp32.tmfile", "-i", image_filepath], capture_output=True, text=True)
 
7
  return "yolov5s-tt100k.out.jpg", result.stdout
8
 
9
+ iface = gr.Interface(fn=run_yolov5s, inputs=gr.Image(type="filepath"), outputs=[gr.Image(type="filepath"), gr.Textbox()])
10
  iface.launch()