2if pyjevois.pro:
import libjevoispro
as jevois
3else:
import libjevois
as jevois
7import onnxruntime
as rt
36 self.
dataroot = jevois.Parameter(self,
'dataroot',
'str',
37 "Root directory to use when config or model parameters are relative paths.",
40 self.
model = jevois.Parameter(self,
'model',
'str',
41 "Path to a binary file of model contains trained weights with .onnx extension. " +
42 "If path is relative, it will be prefixed by dataroot.",
48 self.
intensors = jevois.Parameter(self,
'intensors',
'str',
49 "Specification of input tensors",
52 self.
exposure = jevois.Parameter(self,
'exposure',
'float',
53 "Exposure ratio for URetinex-Net, with typical values 3 to 5",
67 providers = rt.get_available_providers())
78 if self.
session is None:
raise RuntimeError(
"Cannot process because no loaded network")
79 if len(blobs) != 1:
raise ValueError(f
"{len(blobs)} inputs received but network wants 1")
85 ins = { self.
inputs[0].name: blobs[0],
86 self.
inputs[1].name: np.asarray(expo, dtype=np.float32).reshape(self.
inputs[1].shape) }
89 outs = self.
session.run(
None, ins)
92 info = [
"* Network",
"Forward pass OK", f
"Exposure ratio: {expo}" ]
Simple DNN network invoked from ONNX-Runtime in python for URetinex-Net.
load(self)
[Required] Load the network from disk
init(self)
[Optional] JeVois parameters initialization
process(self, blobs)
[Required] Main processing function: process input blobs through network and return output blobs blob...
__init__(self)
[Optional] Constructor
freeze(self, doit)
[Optional] Freeze some parameters that should not be changed at runtime