CuriousDolphin commited on
Commit
64ca84b
·
verified ·
1 Parent(s): 472cba2

Update detr/main_gradio.py

Browse files
Files changed (1) hide show
  1. detr/main_gradio.py +2 -2
detr/main_gradio.py CHANGED
@@ -2,14 +2,14 @@ import gradio as gr
2
  import supervision as sv
3
  import os
4
  from time import perf_counter
5
-
6
  from detr_models import SimpleDetr, PanopticDetrResenet101, SimpleDetrOnnx, ONNX_DIR
7
 
8
  IMAGES_DIR = os.path.abspath(os.curdir) + "/data/images"
9
  ASSETS_DIR = os.path.abspath(os.curdir) + "/data/assets"
10
  print("images:", IMAGES_DIR)
11
 
12
-
13
  def run_inference(image, confidence, model_name, progress=gr.Progress(track_tqdm=True)):
14
  progress(0.1, "loading model..")
15
  if not image:
 
2
  import supervision as sv
3
  import os
4
  from time import perf_counter
5
+ import spaces
6
  from detr_models import SimpleDetr, PanopticDetrResenet101, SimpleDetrOnnx, ONNX_DIR
7
 
8
  IMAGES_DIR = os.path.abspath(os.curdir) + "/data/images"
9
  ASSETS_DIR = os.path.abspath(os.curdir) + "/data/assets"
10
  print("images:", IMAGES_DIR)
11
 
12
+ @spaces.GPU(enable_queue=True)
13
  def run_inference(image, confidence, model_name, progress=gr.Progress(track_tqdm=True)):
14
  progress(0.1, "loading model..")
15
  if not image: