18 const std::vector<LabelCategoryNames>& modelOutputLabels)
19 : m_GroundTruthLabelSet(validationLabels)
20 , m_ModelOutputLabels(modelOutputLabels)
27 ARMNN_LOG(
warning) <<
"Accuracy Tool only supports a maximum of Top 10 Accuracy. "
28 "Printing Top 10 Accuracy result!";
31 unsigned int total = 0;
32 for (
unsigned int i = k; i > 0; --i)
36 return static_cast<float>(total * 100) /
static_cast<float>(m_ImagesProcessed);
40 std::vector<std::string>
41 SplitBy(
const std::string& originalString,
const std::string& delimiter,
bool includeEmptyToken)
43 std::vector<std::string> tokens;
46 while ((next = originalString.find(delimiter, cur)) != std::string::npos)
49 if (next - cur > 0 || includeEmptyToken)
51 tokens.push_back(originalString.substr(cur, next - cur));
53 cur = next + delimiter.size();
57 if (originalString.size() - cur > 0 || includeEmptyToken)
59 tokens.push_back(originalString.substr(cur, originalString.size() - cur));
65 std::string
Strip(
const std::string& originalString,
const std::string& characterSet)
67 if (characterSet.empty())
71 const std::size_t firstFound = originalString.find_first_not_of(characterSet);
72 const std::size_t lastFound = originalString.find_last_not_of(characterSet);
74 if (firstFound == std::string::npos || lastFound == std::string::npos)
78 return originalString.substr(firstFound, lastFound + 1 - firstFound);