|
import gradio as gr |
|
import subprocess |
|
import os |
|
|
|
|
|
|
|
|
|
os.system("chmod a+x ./yolov5s-tt100k-static.bin") |
|
print(os.environ.get('LD_LIBRARY_PATH')) |
|
def run_yolov5s(image_filepath): |
|
os.system("./yolov5s-tt100k-static.bin --help") |
|
result = subprocess.run(["./yolov5s-tt100k-static.bin", "-m", "./yolov5s_tt100k_opt_fp32.tmfile", "-i", image_filepath], capture_output=True, text=True, shell=True, env=os.environ) |
|
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() |