ONE - On-device Neural Engine
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
w
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
i
k
l
m
n
o
p
q
r
s
t
u
Enumerator
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
u
v
w
y
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerations
a
c
d
e
f
g
i
k
l
m
o
p
r
s
t
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Related Symbols
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
Variables
_
b
c
d
f
g
i
k
m
n
o
p
s
t
v
Typedefs
a
d
f
g
i
l
m
n
o
s
t
u
v
Enumerations
f
g
n
o
p
r
Enumerator
a
k
n
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
model_runner_onnx.py
Go to the documentation of this file.
1
from
common_place
import
*
2
3
import
onnx
4
import
caffe2.python.onnx.backend
5
6
7
def
run_onnx
(model, input_path, output_path=''):
#args.model[0] , args.input
8
path = model
9
10
#I'll leave it in case anyone needs to read the .pb file.
11
#proto_arr = onnx.TensorProto()
12
#with open(input_path, 'rb') as f:
13
# proto_arr.ParseFromString(f.read())
14
# input_arr = onnx.numpy_helper.to_array(proto_arr)
15
16
modelFile = onnx.load(path,
'rb'
)
17
input_arr =
read_input
(input_path)
18
output = caffe2.python.onnx.backend.run_model(modelFile, input_arr)
19
20
print(output)
21
save_result
(output_path, output)
22
23
7
def
run_onnx
(model, input_path, output_path=''):
#args.model[0] , args.input
…
24
if
__name__ ==
'__main__'
:
25
args =
regular_step
()
26
27
run_onnx
(args.model[0], args.input, args.output_path)
common_place.regular_step
regular_step()
Definition
common_place.py:6
common_place.read_input
read_input(input_path)
Definition
common_place.py:64
common_place.save_result
save_result(output_path, output_data)
Definition
common_place.py:50
model_runner_onnx.run_onnx
run_onnx(model, input_path, output_path='')
Definition
model_runner_onnx.py:7
compiler
nnc
utils
model_runner
model_runner_onnx.py
Generated by
1.9.8