ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
}
+TEST(ObjectDetectionHailo8LTest, YoloXsInferenceShouldBeOk)
+{
+ mv_object_detection_h handle;
+ vector<test_model_input> test_models {
+ {}
+ // TODO.
+ };
+ const int coordinate_answers[3][4] = { { 327, 0, 718, 513 }, { 409, 66, 1001, 601 }, { 24, 29, 311, 546 } };
+
+ mv_source_h mv_source = NULL;
+ int ret = mv_create_source(&mv_source);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ ret = ImageHelper::loadImageToSource(IMG_DOG, mv_source);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ for (const auto &model : test_models) {
+ ret = mv_object_detection_create(&handle);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ ret = mv_object_detection_set_model(handle, model.model_file.c_str(), model.meta_file.c_str(),
+ model.label_file.c_str(), model.model_name.c_str());
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ ret = mv_object_detection_configure(handle);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ ret = mv_object_detection_prepare(handle);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ 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, &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;
+
+ int ret = mv_object_detection_get_bound_box(handle, idx, &left, &top, &right, &bottom);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+
+ ASSERT_EQ(coordinate_answers[idx][0], left);
+ ASSERT_EQ(coordinate_answers[idx][1], top);
+ ASSERT_EQ(coordinate_answers[idx][2], right);
+ ASSERT_EQ(coordinate_answers[idx][3], bottom);
+ }
+
+ ret = mv_object_detection_destroy(handle);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+ }
+
+ ret = mv_destroy_source(mv_source);
+ ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+}
+
TEST(FaceDetectionTest, InferenceShouldBeOk)
{
mv_object_detection_h handle;