cxeep commited on
Commit
6f91bae
·
verified ·
1 Parent(s): a8363ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -12,8 +12,11 @@ os.system(f"chmod a+x {BIN}")
12
  os.system(f"{BIN} -h")
13
  # os.system("ldd ./yolov5s-tt100k-static.bin")
14
  def run_yolov5s(image_filepath):
 
15
  result = subprocess.run([BIN, "-m", "./yolov5s_tt100k_opt_fp32.tmfile", "-i", image_filepath], capture_output=True, text=True)
 
16
  print(result.stdout)
 
17
  return "yolov5s-tt100k.out.jpg", result.stdout
18
 
19
  iface = gr.Interface(fn=run_yolov5s, inputs=gr.Image(type="filepath"), outputs=[gr.Image(type="filepath"), gr.Textbox()])
 
12
  os.system(f"{BIN} -h")
13
  # os.system("ldd ./yolov5s-tt100k-static.bin")
14
  def run_yolov5s(image_filepath):
15
+ start_time = time.time()
16
  result = subprocess.run([BIN, "-m", "./yolov5s_tt100k_opt_fp32.tmfile", "-i", image_filepath], capture_output=True, text=True)
17
+ elapsed_time = time.time() - start_time
18
  print(result.stdout)
19
+ print("elapsed_time (s)", elapsed_time)
20
  return "yolov5s-tt100k.out.jpg", result.stdout
21
 
22
  iface = gr.Interface(fn=run_yolov5s, inputs=gr.Image(type="filepath"), outputs=[gr.Image(type="filepath"), gr.Textbox()])