(self, config, numId=0)
| 236 | global_config) |
| 237 | |
| 238 | def _init_torch_model(self, config, numId=0): |
| 239 | |
| 240 | from opendet.modeling import build_model as build_det_model |
| 241 | from tools.utils.ckpt import load_ckpt |
| 242 | |
| 243 | # build model |
| 244 | self.model = build_det_model(config['Architecture']) |
| 245 | self.model.eval() |
| 246 | load_ckpt(self.model, config) |
| 247 | if config['Architecture']['algorithm'] == 'DB_mobile': |
| 248 | replace_batchnorm(self.model.backbone) |
| 249 | self.device = set_device(config['Global']['device'], numId=numId) |
| 250 | self.model.to(device=self.device) |
| 251 | |
| 252 | def _inference_onnx(self, images): |
| 253 | # ONNX输入需要为numpy数组 |
no test coverage detected