From 22f82dd712216234f46b71fc4922e364dd3c3399 Mon Sep 17 00:00:00 2001 From: Inki Dae Date: Tue, 30 Jan 2024 15:38:04 +0900 Subject: mv_machine_learning: move frame_number to get_result_count API [Issue type] : parameter change Move frame_number parameter to get_result_count API because frame_number depends on input data. The frame_number will be used to check if current result coresponds to which input data. And minor typo fixup. Change-Id: I0774c0d18b8fde459dda60f7a42763ab4c672651 Signed-off-by: Inki Dae --- .../image_classification/test_image_classification.cpp | 6 +++--- .../image_classification/test_image_classification_async.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test/testsuites/machine_learning/image_classification') diff --git a/test/testsuites/machine_learning/image_classification/test_image_classification.cpp b/test/testsuites/machine_learning/image_classification/test_image_classification.cpp index 05f15eec..33ffa2c3 100644 --- a/test/testsuites/machine_learning/image_classification/test_image_classification.cpp +++ b/test/testsuites/machine_learning/image_classification/test_image_classification.cpp @@ -130,16 +130,16 @@ TEST(ImageClassificationTest, InferenceShouldBeOk) ret = mv_image_classification_inference(handle, mv_source); ASSERT_EQ(ret, 0); + unsigned long frame_number; unsigned int cnt; - ret = mv_image_classification_get_result_count(handle, &cnt); + ret = mv_image_classification_get_result_count(handle, &frame_number, &cnt); ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE); for (unsigned long idx = 0; idx < cnt; ++idx) { - unsigned long frame_number; const char *label = NULL; - ret = mv_image_classification_get_result(handle, idx, &frame_number, &label); + ret = mv_image_classification_get_result(handle, idx, &label); ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE); cout << "frame number = " << frame_number << " label = " << label << endl; diff --git a/test/testsuites/machine_learning/image_classification/test_image_classification_async.cpp b/test/testsuites/machine_learning/image_classification/test_image_classification_async.cpp index ad9e98fc..e56df025 100644 --- a/test/testsuites/machine_learning/image_classification/test_image_classification_async.cpp +++ b/test/testsuites/machine_learning/image_classification/test_image_classification_async.cpp @@ -45,9 +45,10 @@ void image_classification_callback(void *user_data) bool is_loop_exit = false; while (!is_loop_exit) { + unsigned long frame_number; unsigned int cnt; - int ret = mv_image_classification_get_result_count(handle, &cnt); + int ret = mv_image_classification_get_result_count(handle, &frame_number, &cnt); if (ret == MEDIA_VISION_ERROR_INVALID_OPERATION) break; @@ -55,9 +56,8 @@ void image_classification_callback(void *user_data) for (unsigned long idx = 0; idx < cnt; ++idx) { const char *label = NULL; - unsigned long frame_number; - ret = mv_image_classification_get_result(handle, idx, &frame_number, &label); + ret = mv_image_classification_get_result(handle, idx, &label); ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE); if (frame_number > MAX_INFERENCE_ITERATION - 10) -- cgit v1.2.3