2if pyjevois.pro:
import libjevoispro
as jevois
3else:
import libjevois
as jevois
7import onnxruntime
as rt
34 self.
dataroot = jevois.Parameter(self,
'dataroot',
'str',
35 "Root directory to use when config or model parameters are relative paths.",
38 self.
model = jevois.Parameter(self,
'model',
'str',
39 "Path to a binary file of model contains trained weights with .onnx extension. " +
40 "If path is relative, it will be prefixed by dataroot.",
46 self.
intensors = jevois.Parameter(self,
'intensors',
'str',
47 "Specification of input tensors",
61 providers = rt.get_available_providers())
73 raise RuntimeError(
"Cannot process because no loaded network")
75 if len(blobs) != len(self.
inputs):
76 raise ValueError(f
"{len(blobs)} inputs received but network wants {len(self.inputs)}")
80 for i
in range(len(blobs)): ins[self.
inputs[i].name] = blobs[i]
83 outs = self.
session.run(
None, ins)
86 info = [
"* Network",
"Forward pass OK" ]
Simple DNN network invoked from ONNX-Runtime in python.
freeze(self, doit)
[Optional] Freeze some parameters that should not be changed at runtime
load(self)
[Required] Load the network from disk
__init__(self)
[Optional] Constructor
init(self)
[Optional] JeVois parameters initialization
process(self, blobs)
[Required] Main processing function: process input blobs through network and return output blobs blob...