@@ -229,21 +229,6 @@ void InferenceEngineConfigurator::infer() {
229
229
wasInfered = true ;
230
230
}
231
231
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
-
247
232
std::vector<InferenceResults> InferenceEngineConfigurator::getTopResult (unsigned int topCount) {
248
233
if (!wasInfered) {
249
234
THROW_IE_EXCEPTION << " Cannot get top results!" ;
@@ -272,6 +257,20 @@ std::vector<InferenceResults> InferenceEngineConfigurator::getTopResult(unsigned
272
257
}
273
258
outputResults.push_back (imageResult);
274
259
}
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
+
275
274
return outputResults;
276
275
}
277
276
0 commit comments