MCPcopy Create free account
hub / github.com/MultimediaTechLab/YOLO / load_model

Method load_model

yolo/utils/deploy_utils.py:30–37  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

28 self.compiler = None
29
30 def load_model(self, device):
31 if self.compiler == "onnx":
32 return self._load_onnx_model(device)
33 elif self.compiler == "trt":
34 return self._load_trt_model().to(device)
35 elif self.compiler == "deploy":
36 self.cfg.model.model.auxiliary = {}
37 return create_model(self.cfg.model, class_num=self.class_num, weight_path=self.cfg.weight).to(device)
38
39 def _load_onnx_model(self, device):
40 from onnxruntime import InferenceSession

Callers 1

mainFunction · 0.80

Calls 3

_load_onnx_modelMethod · 0.95
_load_trt_modelMethod · 0.95
create_modelFunction · 0.90

Tested by

no test coverage detected