add nnc section into readme (#607)
authorEfimov Alexander/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Mon, 16 Jul 2018 12:43:14 +0000 (15:43 +0300)
committerSergey Vostokov/AI Tools Lab /SRR/Staff Engineer/삼성전자 <s.vostokov@samsung.com>
Mon, 16 Jul 2018 12:43:14 +0000 (21:43 +0900)
Add nnc  readme

Adds nnc  README.md file to describe how it works

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
contrib/nnc/README.md [new file with mode: 0644]

diff --git a/contrib/nnc/README.md b/contrib/nnc/README.md
new file mode 100644 (file)
index 0000000..e824c78
--- /dev/null
@@ -0,0 +1,74 @@
+# nnc
+Neural Network Compiler
+
+### DESCRIPTION
+
+nnc is a neural network compiler that transforms neural networks of various formats into source or machine code.
+Most functionality of nnc is stored in dynamically linked plugins.
+> At this moment only two NN are supported (MobileNet and InceptionV3) in Tensorflow Lite or Caffe format.
+
+### SYNOPSIS
+
+nnc [NNC OPTIONS] [PLUGIN OPTIONS]
+
+### OPTIONS
+
+``--plugins-path`` <directory path>
+
+select directory where to search for plugins.
+looks recursively into selected dir and finds all plugins it can load.
+
+``--plugins-verbose``
+
+print info about found plugins
+
+``--plugins-help``
+
+print help messages from plugins
+
+``--help``
+
+print help message
+
+### USAGE
+
+Assuming that current directory is a build root and we have tflite model(for example inceptionv3.tflite)
+
+**1. Running nnc in interpreter mode:**
+```
+./nnc --plugins-path . \
+--input-filename inceptionv3.tflite \
+--filename data.file \
+--input input --output output
+```
+
+
+``--plugins-path .`` is a _general nnc_ option, it sets plugin search root to current directory.
+
+``--input-filename inceptionv3.tflite`` this is a _tflite importer_ option, it feeds importer with inception neural network.
+
+``--filename data.file`` is a _interpreter_ option, it points to file with neural network input data, this file contains array of floats in binary form.
+
+``--input`` is a _interpreter_ option, it sets input node in Computational Graph.
+
+``--output`` is a _interpreter_ option, it sets output node in Computational Graph.
+
+**2. Running to generate C/C++ source code:**
+
+```
+./nnc --plugins-path . \
+--input-filename inceptionv3.tflite \
+--emit-source c++ \
+--out-code nn.cpp \
+--out-header nn.h \
+--out-model param.file</p>
+```
+
+``--emit-source c++`` is a _soft backend_ option that selects target language to emit
+
+``--out-code nn.cpp`` is a _soft backend_ option, it sets path to source code file
+
+``--out-header nn.h`` is a _soft backend_ option, it sets path to header file
+
+``--out-model param.file`` is a _soft backend_ option, it sets path to file with model parameters
+