(file_path: str, from_framework: NetworkFramework=NetworkFramework.ONNX, **kwargs)
| 26 | |
| 27 | |
| 28 | def load_graph(file_path: str, from_framework: NetworkFramework=NetworkFramework.ONNX, **kwargs) -> BaseGraph: |
| 29 | parser = PFL.Parser(from_framework) |
| 30 | assert isinstance(parser, GraphBuilder), 'Unexpected Parser found.' |
| 31 | if from_framework == NetworkFramework.CAFFE: |
| 32 | assert 'caffemodel_path' in kwargs, ('parameter "caffemodel_path" is required here for loading caffe model from file, ' |
| 33 | 'however it is missing from your invoking.') |
| 34 | graph = parser.build(prototxt_path=file_path, caffemodel_path=kwargs['caffemodel_path']) |
| 35 | else: |
| 36 | graph = parser.build(file_path) |
| 37 | return graph |
| 38 | |
| 39 | def load_onnx_graph(onnx_import_file: str) -> BaseGraph: |
| 40 | """ |
no test coverage detected