Skip to content

Commit

Permalink
set task type for runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
almazgimaev committed Nov 26, 2024
1 parent f9bdaff commit 757c08f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion serve/src/yolov8.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,14 @@ def _load_runtime(self, weights_path: str, format: str, **kwargs):
self._dump_yaml_checkpoint_info(model, os.path.dirname(weights_path))
else:
exported_weights_path = weights_path
model = YOLO(exported_weights_path)

task_type_map = {
"object detection": "detect",
"instance segmentation": "segment",
"pose estimation": "pose",
}

model = YOLO(exported_weights_path, task=task_type_map[self.task_type])
return model

def _load_onnx(self, weights_path: str):
Expand Down

0 comments on commit 757c08f

Please sign in to comment.