From c28cebb2a689bb0c119a32234f995bfd963383ef Mon Sep 17 00:00:00 2001 From: Dmitry Pigasin Date: Fri, 4 Mar 2022 15:41:47 +0300 Subject: [PATCH] [CPP Speech Sample] Fix result saving when batch size is not 1 (#10714) * Fix result saving when batch size is not 1 * Remove useless if statement * improved processing scores for model with more than one outputs * added checking on count of model outputs * improve if statements * divide fix for model with several outputs to other PR Co-authored-by: Maxim Gordeev --- samples/cpp/speech_sample/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/cpp/speech_sample/main.cpp b/samples/cpp/speech_sample/main.cpp index 431bddee3e6..7ebc4adde8c 100644 --- a/samples/cpp/speech_sample/main.cpp +++ b/samples/cpp/speech_sample/main.cpp @@ -494,9 +494,9 @@ int main(int argc, char* argv[]) { if (!FLAGS_o.empty()) { /* Prepare output data for save to file in future */ - auto outputFrame = - &vectorPtrScores[next_output].front() + - numScoresPerOutput[next_output] * sizeof(float) * (inferRequest.frameIndex); + auto outputFrame = &vectorPtrScores[next_output].front() + + numScoresPerOutput[next_output] * sizeof(float) * + (inferRequest.frameIndex) / batchSize; ov::Tensor outputBlob = inferRequest.inferRequest.get_tensor(executableNet.output(outputName)); @@ -653,7 +653,7 @@ int main(int argc, char* argv[]) { uttName, &vectorPtrScores[next_output].front(), numFramesFile, - numScoresPerOutput[next_output]); + numScoresPerOutput[next_output] / batchSize); } if (!FLAGS_r.empty()) { // print statistical score error