Skip to content

Commit 439dfa8

Browse files
committed
consolidate output
1 parent 6b8bc79 commit 439dfa8

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

dlinfer.cpp

+14-15
Original file line numberDiff line numberDiff line change
@@ -229,21 +229,6 @@ void InferenceEngineConfigurator::infer() {
229229
wasInfered = true;
230230
}
231231

232-
void InferenceEngineConfigurator::printTopResults(std::vector<InferenceResults> results) {
233-
if (results.size()) {
234-
std::cout << std::endl << "Top " << ntop << " results:" << std::endl << std::endl;
235-
for (size_t i = 0; i < results.size(); i++) {
236-
std::cout << "Image " << results.at(i).getName() << std::endl << std::endl;
237-
const std::vector<LabelProbability> imageResults = results.at(i).getResults();
238-
for (size_t j = 0; j < imageResults.size(); j++) {
239-
std::cout << imageResults.at(j).getLabelIndex() << " " << imageResults.at(j).getProbability() << " "
240-
<< imageResults.at(j).getLabel() << std::endl;
241-
}
242-
std::cout << std::endl;
243-
}
244-
}
245-
}
246-
247232
std::vector<InferenceResults> InferenceEngineConfigurator::getTopResult(unsigned int topCount) {
248233
if (!wasInfered) {
249234
THROW_IE_EXCEPTION << "Cannot get top results!";
@@ -272,6 +257,20 @@ std::vector<InferenceResults> InferenceEngineConfigurator::getTopResult(unsigned
272257
}
273258
outputResults.push_back(imageResult);
274259
}
260+
261+
if (outputResults.size()) {
262+
std::cout << std::endl << "Top " << ntop << " results:" << std::endl << std::endl;
263+
for (size_t i = 0; i < outputResults.size(); i++) {
264+
std::cout << "Image " << outputResults.at(i).getName() << std::endl << std::endl;
265+
const std::vector<LabelProbability> imageResults = outputResults.at(i).getResults();
266+
for (size_t j = 0; j < imageResults.size(); j++) {
267+
std::cout << imageResults.at(j).getLabelIndex() << " " << imageResults.at(j).getProbability() << " "
268+
<< imageResults.at(j).getLabel() << std::endl;
269+
}
270+
std::cout << std::endl;
271+
}
272+
}
273+
275274
return outputResults;
276275
}
277276

dlinfer.h

-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ class InferenceEngineConfigurator {
137137

138138
std::vector<InferenceResults> getTopResult(unsigned int topCount);
139139

140-
void printTopResults(std::vector<LabelResults>);
141-
142140
/**
143141
* Function prints perfomance counts
144142
* @param stream - output stream

0 commit comments

Comments
 (0)