aboutsummaryrefslogtreecommitdiff
path: root/samples/KeywordSpotting/include/Decoder.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'samples/KeywordSpotting/include/Decoder.hpp')
-rw-r--r--samples/KeywordSpotting/include/Decoder.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/samples/KeywordSpotting/include/Decoder.hpp b/samples/KeywordSpotting/include/Decoder.hpp
new file mode 100644
index 0000000000..aca68312bc
--- /dev/null
+++ b/samples/KeywordSpotting/include/Decoder.hpp
@@ -0,0 +1,32 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+# pragma once
+
+#include <string>
+#include <map>
+#include "ArmnnNetworkExecutor.hpp"
+
+namespace kws
+{
+
+/**
+* @brief Decodes quantised last layer of model output
+*
+*/
+class Decoder
+{
+private:
+ int quantisationOffset;
+ float quantisationScale;
+
+public:
+
+ Decoder(int quantisationOffset, float quantisationScale) : quantisationOffset(quantisationOffset),
+ quantisationScale(quantisationScale) {}
+
+ std::pair<int, float> decodeOutput(std::vector<int8_t>& modelOutput);
+
+};
+} // namespace kws \ No newline at end of file