aboutsummaryrefslogtreecommitdiff
path: root/src/armnnQuantizer/CommandLineProcessor.hpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2019-02-15 14:45:04 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-02-21 08:26:39 +0000
commit3091b06807257a6db0ff03654681f87526f37955 (patch)
tree30855ced21aa74400d6910040e300d3eda15f269 /src/armnnQuantizer/CommandLineProcessor.hpp
parent30b0020478652e441a5dff4880261f7c7007bb6c (diff)
downloadarmnn-3091b06807257a6db0ff03654681f87526f37955.tar.gz
IVGCVSW-2610 Add Quantization Tool Executable
* Also added TensorInfos to the output slots in the SerializerTests to create valid ArmNN networks for serialization Change-Id: I092b1ac889dd5e05cb1c10c9dfb573acaf1970d9 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/armnnQuantizer/CommandLineProcessor.hpp')
-rw-r--r--src/armnnQuantizer/CommandLineProcessor.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/armnnQuantizer/CommandLineProcessor.hpp b/src/armnnQuantizer/CommandLineProcessor.hpp
new file mode 100644
index 0000000000..f55e7a213f
--- /dev/null
+++ b/src/armnnQuantizer/CommandLineProcessor.hpp
@@ -0,0 +1,37 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#pragma once
+
+#include <string>
+#include <iostream>
+
+namespace armnnQuantizer
+{
+
+// parses the command line to extract
+// * the input file -f containing the serialized fp32 ArmNN input graph (must exist...and be a input graph file)
+// * the directory -d to place the output file into (must already exist and be writable)
+// * the name of the file -o the quantized ArmNN input graph will be written to (must not already exist)
+// * LATER: the min and max overrides to be applied to the inputs
+// specified as -i <int> (input id) -n <float> (minimum) -x <float> (maximum)
+// multiple sets of -i, -n, -x can appear on the command line but they must match
+// in number i.e. a -n and -x for each -i and the id of the input must correspond
+// to an input layer in the fp32 graph when it is loaded.
+class CommandLineProcessor
+{
+public:
+ bool ProcessCommandLine(int argc, char* argv[]);
+
+ std::string GetInputFileName() {return m_InputFileName;}
+ std::string GetOutputDirectoryName() {return m_OutputDirectory;}
+ std::string GetOutputFileName() {return m_OutputFileName;}
+private:
+ std::string m_InputFileName;
+ std::string m_OutputDirectory;
+ std::string m_OutputFileName;
+};
+
+} // namespace armnnQuantizer
+