MCPcopy Create free account
hub / github.com/ARM-software/armnn / DecodeOutput

Method DecodeOutput

samples/SpeechRecognition/include/Decoder.hpp:35–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 */
34 template<typename T>
35 std::string DecodeOutput(std::vector<T>& contextToProcess)
36 {
37 int rowLength = 29;
38
39 std::vector<char> unfilteredText;
40
41 for(int row = 0; row < contextToProcess.size()/rowLength; ++row)
42 {
43 std::vector<int16_t> rowVector;
44 for(int j = 0; j < rowLength; ++j)
45 {
46 rowVector.emplace_back(static_cast<int16_t>(contextToProcess[row * rowLength + j]));
47 }
48
49 int maxIndex = std::distance(rowVector.begin(), std::max_element(rowVector.begin(), rowVector.end()));
50 unfilteredText.emplace_back(this->m_labels.at(maxIndex)[0]);
51 }
52
53 std::string filteredText = FilterCharacters(unfilteredText);
54 return filteredText;
55 }
56
57 /**
58 * @brief Function to filter out unwanted characters

Callers 1

PostProcessingMethod · 0.80

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected