StevenChen16 commited on
Commit
9505921
1 Parent(s): 9b87511

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import tempfile
4
  from ultralytics import YOLOv10
5
  import supervision as sv
6
  from huggingface_hub import hf_hub_download
 
7
 
8
 
9
  def download_models(model_id):
@@ -30,7 +31,7 @@ category_dict = {
30
  77: 'teddy bear', 78: 'hair drier', 79: 'toothbrush'
31
  }
32
 
33
-
34
  def yolov10_inference(image, video, model_id, image_size, conf_threshold, iou_threshold):
35
  model_path = download_models(model_id)
36
  model = YOLOv10(model_path)
 
4
  from ultralytics import YOLOv10
5
  import supervision as sv
6
  from huggingface_hub import hf_hub_download
7
+ import spaces
8
 
9
 
10
  def download_models(model_id):
 
31
  77: 'teddy bear', 78: 'hair drier', 79: 'toothbrush'
32
  }
33
 
34
+ @spaces.GPU(duration=200)
35
  def yolov10_inference(image, video, model_id, image_size, conf_threshold, iou_threshold):
36
  model_path = download_models(model_id)
37
  model = YOLOv10(model_path)