import gradio as gr | |
import subprocess | |
import os | |
def run_yolov5s(image_filepath): | |
result = subprocess.run(["./yolov5s-tt100k", "-m", "./yolov5s_tt100k_opt_fp32.tmfile", "-i", image_filepath], capture_output=True, text=True) | |
return "yolov5s-tt100k.out.jpg", result.stdout | |
iface = gr.Interface(fn=run_yolov5s, inputs=gr.Image(type="filepath"), outputs=[gr.Image(type="filepath"), gr.Textbox()]) | |
iface.launch() |