kadirnar commited on
Commit
e0413c6
1 Parent(s): ea4e87d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,11 +1,14 @@
1
  import gradio as gr
2
  from ultralytics import YOLOv10
3
  import supervision as sv
 
 
4
 
5
  MODEL_PATH = 'yolov10n.pt'
6
  model = YOLOv10(MODEL_PATH)
7
  box_annotator = sv.BoxAnnotator()
8
 
 
9
  def detect(image):
10
  results = model(source=image, conf=0.25, verbose=False)[0]
11
  detections = sv.Detections.from_ultralytics(results)
 
1
  import gradio as gr
2
  from ultralytics import YOLOv10
3
  import supervision as sv
4
+ import spaces
5
+
6
 
7
  MODEL_PATH = 'yolov10n.pt'
8
  model = YOLOv10(MODEL_PATH)
9
  box_annotator = sv.BoxAnnotator()
10
 
11
+ @spaces.GPU(duration=200)
12
  def detect(image):
13
  results = model(source=image, conf=0.25, verbose=False)[0]
14
  detections = sv.Detections.from_ultralytics(results)