Fixed ngraph sample logical errors (#2600)

* Fixed ngrapth sample logical errors

- added batch size, because sample accepts several images
- set label file as optional
This commit is contained in:
Mikhail Ryzhov 2020-10-26 15:36:49 +03:00 committed by GitHub
parent 166ab89b95
commit 0267cbd286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,7 +272,8 @@ int main(int argc, char* argv[]) {
}
/** Setting batch size using image count **/
size_t batchSize = 1;
network.setBatchSize(imagesData.size());
size_t batchSize = network.getBatchSize();
slog::info << "Batch size is " << std::to_string(batchSize) << slog::endl;
// --------------------------- Prepare output blobs -----------------------------------------------------
@ -383,8 +384,6 @@ int main(int argc, char* argv[]) {
labels.push_back(strLine);
}
inputFile.close();
} else {
throw std::logic_error("Cannot read label file");
}
ClassificationResult classificationResult(outputBlob, images, batchSize, FLAGS_nt, labels);