Update handler.py
Browse files- handler.py +3 -4
handler.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from ultralyticsplus import YOLO
|
2 |
-
from typing import
|
3 |
from sahi import ObjectPrediction
|
4 |
|
5 |
|
@@ -10,7 +10,7 @@ class EndpointHandler():
|
|
10 |
def __init__(self):
|
11 |
self.model = YOLO('ultralyticsplus/yolov8s')
|
12 |
|
13 |
-
def __call__(self, image
|
14 |
"""
|
15 |
data args:
|
16 |
image: image path to segment
|
@@ -21,8 +21,7 @@ class EndpointHandler():
|
|
21 |
Return:
|
22 |
object_predictions
|
23 |
"""
|
24 |
-
|
25 |
-
config = DEFAULT_CONFIG
|
26 |
# Set model parameters
|
27 |
self.model.overrides['conf'] = config.get('conf')
|
28 |
self.model.overrides['iou'] = config.get('iou')
|
|
|
1 |
from ultralyticsplus import YOLO
|
2 |
+
from typing import List
|
3 |
from sahi import ObjectPrediction
|
4 |
|
5 |
|
|
|
10 |
def __init__(self):
|
11 |
self.model = YOLO('ultralyticsplus/yolov8s')
|
12 |
|
13 |
+
def __call__(self, image: str) -> List[ObjectPrediction]:
|
14 |
"""
|
15 |
data args:
|
16 |
image: image path to segment
|
|
|
21 |
Return:
|
22 |
object_predictions
|
23 |
"""
|
24 |
+
config = DEFAULT_CONFIG
|
|
|
25 |
# Set model parameters
|
26 |
self.model.overrides['conf'] = config.get('conf')
|
27 |
self.model.overrides['iou'] = config.get('iou')
|