panda1835 commited on
Commit
da92703
1 Parent(s): 1e9b835

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -2
handler.py CHANGED
@@ -1,5 +1,6 @@
1
  from typing import Dict, List, Any
2
  from ultralytics import YOLO
 
3
 
4
  class EndpointHandler():
5
  def __init__(self, path=""):
@@ -7,8 +8,8 @@ class EndpointHandler():
7
  # pseudo:
8
  # self.model= load_model(path)
9
  # yolov8_model_name = 'yolov8_2023-07-19_yolov8m.pt'
10
- print(path)
11
- self.model = YOLO('./yolov8_2023-07-19_yolov8m.pt')
12
 
13
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
14
  """
 
1
  from typing import Dict, List, Any
2
  from ultralytics import YOLO
3
+ import os
4
 
5
  class EndpointHandler():
6
  def __init__(self, path=""):
 
8
  # pseudo:
9
  # self.model= load_model(path)
10
  # yolov8_model_name = 'yolov8_2023-07-19_yolov8m.pt'
11
+ print(os.listdir(path))
12
+ self.model = YOLO(os.path.join(path, 'yolov8_2023-07-19_yolov8m.pt'))
13
 
14
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
15
  """