[tflite_run] Update README.md (#1243)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Thu, 17 May 2018 01:26:05 +0000 (10:26 +0900)
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>
Thu, 17 May 2018 01:26:05 +0000 (10:26 +0900)
Update README to reflect latest features

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
tools/tflite_run/README.md

index 61a5a9c..35d2b64 100644 (file)
@@ -1,6 +1,6 @@
 # tflite_run
 
-A simple Tensorflow Lite runner. It measures the elapsed time and optionally dump the output data and compare them.
+A simple Tensorflow Lite runner. It measures the elapsed time and optionally dump the input/output tensors or verify them.
 
 ## Usage
 
@@ -12,12 +12,6 @@ This will run with random input data
 $ ./tflite_run model.tflite
 ```
 
-### Specifying input data
-
-```
-$ ./tflite_run model.tflite
-```
-
 Output would look like:
 
 ```
@@ -28,15 +22,24 @@ Prepare takes 0.00126718 seconds
 Invoke takes 7.09527 seconds
 ```
 
-### Dump the outputs
+### Specifying input feature map
+
+We can specify input feature map, but it only accepts preprocessed data which means that the image files must be converted.
 
-Dump the output tensors to a file.
+TODO : Add input image preprocessing instruction
 
 ```
+$ ./tflite_run model.tflite -i binary_input_file
+```
+
+### Dump the input and output tensors
+
+Dump the input and output tensors to a file.
+```
 $ ./tflite_run model.tflite --dump golden
 ```
 
-The output tensors are written to name "golden".
+Why we do this is usually for later verification. The tensors are written to name "golden".
 
 ### Compare with the saved outputs
 
@@ -73,3 +76,16 @@ Comparing the results with "golden2".
 ```
 
 If `--compare` option is on, the exit code will be depend on its compare result. 0 for matched, other number for unmatched.
+
+## How Verification Works
+
+For verification, we may follow these steps:
+
+1. Generate and store the verfication data (run with option `--dump`)
+    1. Input Tensor does not matter as we will keep inputs along with outputs
+    1. Interpreter.Invoke()
+    1. Dump input tensors and output tensors to a file
+1. Give the dumped file for other runtime that we want to verify (run with option `--compare`)
+    1. Set interpreter's input to input tensor data from the file
+    1. Interpreter.Invoke()
+    1. Compare the results with output tensor data from the file