iarbel commited on
Commit
5f7cbe3
·
1 Parent(s): e626296

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -4
handler.py CHANGED
@@ -1,5 +1,5 @@
1
  from ultralyticsplus import YOLO
2
- from typing import Dict, Any, Optional, List
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, config: Optional[Dict[str, Any]] = None) -> List[ObjectPrediction]:
14
  """
15
  data args:
16
  image: image path to segment
@@ -21,8 +21,7 @@ class EndpointHandler():
21
  Return:
22
  object_predictions
23
  """
24
- if config is None:
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')