Spaces:
Runtime error
Runtime error
Update gradio.app.py
Browse files- gradio.app.py +7 -0
gradio.app.py
CHANGED
@@ -1,9 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
import os
|
|
|
|
|
4 |
|
5 |
def run_yolov5s(image_filepath):
|
|
|
|
|
6 |
result = subprocess.run(["tengine-lite-yolov5s-tt100k/build/yolov5s-tt100k", "-m", "tengine-lite-yolov5s-tt100k/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()])
|
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
import os
|
4 |
+
import time
|
5 |
+
import datetime
|
6 |
|
7 |
def run_yolov5s(image_filepath):
|
8 |
+
print(datetime.datetime.utcnow())
|
9 |
+
start_time = time.time()
|
10 |
result = subprocess.run(["tengine-lite-yolov5s-tt100k/build/yolov5s-tt100k", "-m", "tengine-lite-yolov5s-tt100k/yolov5s_tt100k_opt_fp32.tmfile", "-i", image_filepath], capture_output=True, text=True)
|
11 |
+
elapsed_time = time.time() - start_time
|
12 |
+
print(result.stdout)
|
13 |
+
print("elapsed_time (s)", elapsed_time)
|
14 |
return "yolov5s-tt100k.out.jpg", result.stdout
|
15 |
|
16 |
iface = gr.Interface(fn=run_yolov5s, inputs=gr.Image(type="filepath"), outputs=[gr.Image(type="filepath"), gr.Textbox()])
|