summaryrefslogtreecommitdiff
path: root/test/testsuites/machine_learning
diff options
context:
space:
mode:
authorVibhav Aggarwal <v.aggarwal@samsung.com>2023-10-13 18:13:10 +0900
committerKwanghoon Son <k.son@samsung.com>2023-10-25 10:54:03 +0900
commit7b8744943de77d8cb3db19616df4ddfe150fd158 (patch)
tree5e32d68b99128359d1ba03c7efaae7fc0d3ed991 /test/testsuites/machine_learning
parent182b3adf9db4aea5dd17f4c330dbcf2504a20886 (diff)
downloadmediavision-7b8744943de77d8cb3db19616df4ddfe150fd158.tar.gz
mediavision-7b8744943de77d8cb3db19616df4ddfe150fd158.tar.bz2
mediavision-7b8744943de77d8cb3db19616df4ddfe150fd158.zip
mv_machine_learning: return NO_DATA error
[Issue type] : bug fix When the user does not register any face, or unregisters all the faces, inference should return MEDIA_VISION_ERROR_NO_DATA. Change-Id: Ie66ffc8e8ba0357983103125bf6278b79703df2e Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Diffstat (limited to 'test/testsuites/machine_learning')
-rw-r--r--test/testsuites/machine_learning/face_recognition/test_face_recognition.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/test/testsuites/machine_learning/face_recognition/test_face_recognition.cpp b/test/testsuites/machine_learning/face_recognition/test_face_recognition.cpp
index 15131e27..09e7c650 100644
--- a/test/testsuites/machine_learning/face_recognition/test_face_recognition.cpp
+++ b/test/testsuites/machine_learning/face_recognition/test_face_recognition.cpp
@@ -393,7 +393,7 @@ TEST(FaceRecognitionTest, InferenceWithoutLabelShouldBeOk)
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
ret = mv_face_recognition_inference(handle, mv_source);
- ASSERT_NE(ret, MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NO_DATA);
ret = mv_destroy_source(mv_source);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
@@ -513,12 +513,12 @@ TEST(FaceRecognitionTest, RemoveAllLabelsShouldBeOk)
RemoveModelResources();
vector<string> labels = { "3448", "2929", "7779" };
- vector<vector<string> > answers = { { "3448", "3448", "2929", "2929", "3448", "3448", "7779", "2929", "2929",
- "3448", "2929", "7779", "7779", "7779", "7779" },
- { "none", "none", "2929", "2929", "none", "none", "7779", "2929", "2929",
+ vector<vector<string> > answers = { { "none", "none", "2929", "2929", "none", "none", "7779", "2929", "2929",
"none", "2929", "7779", "7779", "7779", "7779" },
{ "none", "none", "none", "none", "none", "none", "7779", "none", "none",
- "none", "none", "7779", "7779", "7779", "7779" } };
+ "none", "none", "7779", "7779", "7779", "7779" },
+ { "none", "none", "none", "none", "none", "none", "none", "none", "none",
+ "none", "none", "none", "none", "none", "none" } };
mv_face_recognition_h handle;
int ret = mv_face_recognition_create(&handle);
@@ -548,6 +548,12 @@ TEST(FaceRecognitionTest, RemoveAllLabelsShouldBeOk)
for (auto label : labels) {
unsigned int image_idx = 0;
unsigned int correct_cnt = 0;
+
+ ret = mv_face_recognition_unregister(handle, label.c_str());
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ cout << "Removed label = " << label.c_str() << endl;
+
auto &answer = answers[label_idx++];
for (auto &image : test_images) {
@@ -596,11 +602,6 @@ TEST(FaceRecognitionTest, RemoveAllLabelsShouldBeOk)
}
cout << "Correct/Total = " << correct_cnt << " / " << image_idx << endl;
-
- ret = mv_face_recognition_unregister(handle, label.c_str());
- ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
-
- cout << "Removed label = " << label.c_str() << endl;
}
ret = mv_face_recognition_destroy(handle);