CAUTION
This Python API is experimental yet. It can be changed later.
Prepare nnpackage
Use nnpackage examples
Use the nnpackage examples to run tutorial code.
Install nnfw python API
Please see nnfw python api for installing nnfw python api.
- Initialize nnfw_session
import onert
session = onert.infer.session(nnpackage_path, backends)
- Prepare Input
input_size = session.input_size()
session.set_inputs(input_size)
- Inference
outputs = session.inference()
Run Inference with app on the target devices
reference app : minimal-python app
$ python3 minimal.py path_to_nnpackage_directory