We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 179d424 commit 0659ac0Copy full SHA for 0659ac0
demos/classification_benchmark_demo/cpp/main.cpp
@@ -317,7 +317,7 @@ int main(int argc, char* argv[]) {
317
throw std::invalid_argument("Renderer: image provided in metadata is empty");
318
}
319
PredictionResult predictionResult = PredictionResult::Incorrect;
320
- std::string label = classificationResult.topLabels.front().label;
+ std::string label = (classificationResult.topLabels.size() != 0) ? classificationResult.topLabels.front().label : "N/A";
321
if (!FLAGS_gt.empty()) {
322
for (size_t i = 0; i < FLAGS_nt; i++) {
323
unsigned predictedClass = classificationResult.topLabels[i].id;
0 commit comments