Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
c7580e7
1
Parent(s):
a97fda4
Removed extra spaces.GPU() decorator.
Browse files
app.py
CHANGED
@@ -55,12 +55,12 @@ def load_yolo_model(model_name, confidence_threshold=0.5):
|
|
55 |
global model
|
56 |
model_path = model_name
|
57 |
model = AutoDetectionModel.from_pretrained(
|
58 |
-
model_type="ultralytics", model_path=model_path, device=
|
59 |
confidence_threshold=confidence_threshold, image_size=IMAGE_SIZE
|
60 |
)
|
61 |
return model
|
62 |
|
63 |
-
@spaces.GPU()
|
64 |
def sahi_yolo_inference(
|
65 |
image,
|
66 |
yolo_model_name,
|
|
|
55 |
global model
|
56 |
model_path = model_name
|
57 |
model = AutoDetectionModel.from_pretrained(
|
58 |
+
model_type="ultralytics", model_path=model_path, device=None, # auto device selection
|
59 |
confidence_threshold=confidence_threshold, image_size=IMAGE_SIZE
|
60 |
)
|
61 |
return model
|
62 |
|
63 |
+
@spaces.GPU(duration=60)
|
64 |
def sahi_yolo_inference(
|
65 |
image,
|
66 |
yolo_model_name,
|