summaryrefslogtreecommitdiff
path: root/test/testsuites
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2024-01-30 15:38:04 +0900
committerInki Dae <inki.dae@samsung.com>2024-01-31 02:23:21 +0000
commit22f82dd712216234f46b71fc4922e364dd3c3399 (patch)
tree984c80a6d3f823d09bbc0de084fd59e7cafc4bf5 /test/testsuites
parentba0a0d8f812f1e1ececaa693b98314b8e275b062 (diff)
downloadmediavision-22f82dd712216234f46b71fc4922e364dd3c3399.tar.gz
mediavision-22f82dd712216234f46b71fc4922e364dd3c3399.tar.bz2
mediavision-22f82dd712216234f46b71fc4922e364dd3c3399.zip
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 <inki.dae@samsung.com>
Diffstat (limited to 'test/testsuites')
-rw-r--r--test/testsuites/machine_learning/image_classification/test_image_classification.cpp6
-rw-r--r--test/testsuites/machine_learning/image_classification/test_image_classification_async.cpp6
-rw-r--r--test/testsuites/machine_learning/landmark_detection/test_landmark_detection.cpp12
-rw-r--r--test/testsuites/machine_learning/landmark_detection/test_landmark_detection_async.cpp14
-rw-r--r--test/testsuites/machine_learning/object_detection/test_object_detection.cpp14
-rw-r--r--test/testsuites/machine_learning/object_detection/test_object_detection_async.cpp14
6 files changed, 31 insertions, 35 deletions
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)
diff --git a/test/testsuites/machine_learning/landmark_detection/test_landmark_detection.cpp b/test/testsuites/machine_learning/landmark_detection/test_landmark_detection.cpp
index 7988aac2..55f10f5c 100644
--- a/test/testsuites/machine_learning/landmark_detection/test_landmark_detection.cpp
+++ b/test/testsuites/machine_learning/landmark_detection/test_landmark_detection.cpp
@@ -125,16 +125,16 @@ TEST(FacialLandmarkTest, InferenceShouldBeOk)
ret = mv_facial_landmark_inference(handle, mv_source);
ASSERT_EQ(ret, 0);
+ unsigned long frame_number;
unsigned int number_of_objects;
- ret = mv_facial_landmark_get_result_count(handle, &number_of_objects);
+ ret = mv_facial_landmark_get_result_count(handle, &frame_number, &number_of_objects);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
- unsigned long frame_number;
unsigned int pos_x, pos_y;
- ret = mv_facial_landmark_get_result(handle, idx, &frame_number, &pos_x, &pos_y);
+ ret = mv_facial_landmark_get_result(handle, idx, &pos_x, &pos_y);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
int distance_x = pos_x - coordinate_answers[0][idx];
@@ -240,16 +240,16 @@ TEST(PoseLandmarkTest, InferenceShouldBeOk)
ret = mv_pose_landmark_inference(handle, mv_source);
ASSERT_EQ(ret, 0);
+ unsigned long frame_number;
unsigned int number_of_objects;
- ret = mv_pose_landmark_get_result_count(handle, &number_of_objects);
+ ret = mv_pose_landmark_get_result_count(handle, &frame_number, &number_of_objects);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
- unsigned long frame_number;
unsigned int pos_x, pos_y;
- ret = mv_pose_landmark_get_result(handle, idx, &frame_number, &pos_x, &pos_y);
+ ret = mv_pose_landmark_get_result(handle, idx, &pos_x, &pos_y);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
int distance_x = pos_x - coordinate_answers[0][idx];
diff --git a/test/testsuites/machine_learning/landmark_detection/test_landmark_detection_async.cpp b/test/testsuites/machine_learning/landmark_detection/test_landmark_detection_async.cpp
index 34fb6bd3..21674936 100644
--- a/test/testsuites/machine_learning/landmark_detection/test_landmark_detection_async.cpp
+++ b/test/testsuites/machine_learning/landmark_detection/test_landmark_detection_async.cpp
@@ -51,19 +51,19 @@ void pose_landmark_callback(void *user_data)
bool is_loop_exit = false;
while (!is_loop_exit) {
+ unsigned long frame_number;
unsigned int number_of_objects;
- int ret = mv_pose_landmark_get_result_count(handle, &number_of_objects);
+ int ret = mv_pose_landmark_get_result_count(handle, &frame_number, &number_of_objects);
if (ret == MEDIA_VISION_ERROR_INVALID_OPERATION)
break;
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
- unsigned long frame_number;
unsigned int pos_x, pos_y;
- ret = mv_pose_landmark_get_result(handle, idx, &frame_number, &pos_x, &pos_y);
+ ret = mv_pose_landmark_get_result(handle, idx, &pos_x, &pos_y);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
if (frame_number > MAX_INFERENCE_ITERATION - 10)
@@ -80,7 +80,7 @@ void pose_landmark_callback(void *user_data)
}
}
-TEST(PostLandmarkAsyncTest, InferenceShouldBeOk)
+TEST(PoseLandmarkAsyncTest, InferenceShouldBeOk)
{
mv_pose_landmark_h handle;
vector<model_info> test_models {
@@ -197,19 +197,19 @@ void facial_landmark_callback(void *user_data)
bool is_loop_exit = false;
while (!is_loop_exit) {
+ unsigned long frame_number;
unsigned int number_of_objects;
- int ret = mv_facial_landmark_get_result_count(handle, &number_of_objects);
+ int ret = mv_facial_landmark_get_result_count(handle, &frame_number, &number_of_objects);
if (ret == MEDIA_VISION_ERROR_INVALID_OPERATION)
break;
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
- unsigned long frame_number;
unsigned int pos_x, pos_y;
- ret = mv_facial_landmark_get_result(handle, idx, &frame_number, &pos_x, &pos_y);
+ ret = mv_facial_landmark_get_result(handle, idx, &pos_x, &pos_y);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
if (frame_number > MAX_INFERENCE_ITERATION - 10)
diff --git a/test/testsuites/machine_learning/object_detection/test_object_detection.cpp b/test/testsuites/machine_learning/object_detection/test_object_detection.cpp
index 7958f792..edaca80b 100644
--- a/test/testsuites/machine_learning/object_detection/test_object_detection.cpp
+++ b/test/testsuites/machine_learning/object_detection/test_object_detection.cpp
@@ -173,19 +173,18 @@ TEST(ObjectDetectionTest, InferenceShouldBeOk)
ret = mv_object_detection_inference(handle, mv_source);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+ unsigned long frame_number;
unsigned int number_of_objects;
- ret = mv_object_detection_get_result_count(handle, &number_of_objects);
+ ret = mv_object_detection_get_result_count(handle, &frame_number, &number_of_objects);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
int left, top, right, bottom;
- unsigned long frame_number;
float confidence;
const char *label;
- int ret = mv_object_detection_get_result(handle, idx, &frame_number, &confidence, &left, &top, &right,
- &bottom, &label);
+ int ret = mv_object_detection_get_result(handle, idx, &confidence, &left, &top, &right, &bottom, &label);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
cout << "Frame number = " << frame_number << " probability = " << confidence << " " << left << " x " << top
@@ -245,19 +244,18 @@ TEST(FaceDetectionTest, InferenceShouldBeOk)
ret = mv_face_detection_inference(handle, mv_source);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+ unsigned long frame_number;
unsigned int number_of_objects;
- ret = mv_face_detection_get_result_count(handle, &number_of_objects);
+ ret = mv_face_detection_get_result_count(handle, &frame_number, &number_of_objects);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
int left, top, right, bottom;
- unsigned long frame_number;
float confidence;
const char *label;
- int ret = mv_face_detection_get_result(handle, idx, &frame_number, &confidence, &left, &top, &right,
- &bottom, &label);
+ int ret = mv_face_detection_get_result(handle, idx, &confidence, &left, &top, &right, &bottom, &label);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
cout << "Frame number = " << frame_number << " probability = " << confidence << " " << left << " x " << top
diff --git a/test/testsuites/machine_learning/object_detection/test_object_detection_async.cpp b/test/testsuites/machine_learning/object_detection/test_object_detection_async.cpp
index 1b772161..41f80292 100644
--- a/test/testsuites/machine_learning/object_detection/test_object_detection_async.cpp
+++ b/test/testsuites/machine_learning/object_detection/test_object_detection_async.cpp
@@ -50,9 +50,10 @@ void object_detection_callback(void *user_data)
bool is_loop_exit = false;
while (!is_loop_exit) {
+ unsigned long frame_number;
unsigned int number_of_objects;
- int ret = mv_object_detection_get_result_count(handle, &number_of_objects);
+ int ret = mv_object_detection_get_result_count(handle, &frame_number, &number_of_objects);
if (ret == MEDIA_VISION_ERROR_INVALID_OPERATION)
break;
@@ -60,12 +61,10 @@ void object_detection_callback(void *user_data)
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
int left, top, right, bottom;
- unsigned long frame_number;
float confidence;
const char *label;
- int ret = mv_object_detection_get_result(handle, idx, &frame_number, &confidence, &left, &top, &right,
- &bottom, &label);
+ int ret = mv_object_detection_get_result(handle, idx, &confidence, &left, &top, &right, &bottom, &label);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
if (frame_number > MAX_INFERENCE_ITERATION - 10)
@@ -206,9 +205,10 @@ void face_detection_callback(void *user_data)
bool is_loop_exit = false;
while (!is_loop_exit) {
+ unsigned long frame_number;
unsigned int number_of_objects;
- int ret = mv_face_detection_get_result_count(handle, &number_of_objects);
+ int ret = mv_face_detection_get_result_count(handle, &frame_number, &number_of_objects);
if (ret == MEDIA_VISION_ERROR_INVALID_OPERATION)
break;
@@ -216,12 +216,10 @@ void face_detection_callback(void *user_data)
for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
int left, top, right, bottom;
- unsigned long frame_number;
float confidence;
const char *label;
- int ret = mv_face_detection_get_result(handle, idx, &frame_number, &confidence, &left, &top, &right,
- &bottom, &label);
+ int ret = mv_face_detection_get_result(handle, idx, &confidence, &left, &top, &right, &bottom, &label);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
if (frame_number > MAX_INFERENCE_ITERATION - 10)