ONE
ONE copied to clipboard
NNPkg Scripting via Micropython(or proper script language)
Why?
To support user-defined scripting inside nnpackage to provide inter-model level control, What do we need ?
Example application :
- Investigate logic of MTCNN model(https://arxiv.org/abs/1604.02878). MTCNN may be a good candidate for model-level logic script.
Originally posted by @chunseoklee in https://github.com/Samsung/ONE/issues/9300#issuecomment-1162600017
What?
- define nnpackage structure
nnpackage
├── metadata
│ ├── MANIFEST
│ ├── config.cfg
│ └── user-script.py
├─── model1.circle
├─── model2.circle
└─── model3.tvn
- write down user-script.py example
Here I assume python as scripting language. But subject to change
import nnfw
# at this point, we should assume that nnpkg load and prepare are done.
# Thus, before entering here, load and prepare are done implicitly by runtime.
m1, m2, m3 = nnfw.get_models()
o1, o2 = m1.run(input1)
# Several Code for manipulating t1
if o1 == o2:
t3 = m2.run(o1)
else:
t3 = m3.run(o2)
- Which language is good for this feature? TBD