Skip to content

Commit 322960f

Browse files
committed
Merge pull request opencv#17297 from dkurt:dnn_yolov3_ocl
2 parents 07c56f1 + b5035ce commit 322960f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

modules/dnn/test/test_common.impl.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,28 @@ void normAssertDetections(
106106
int testClassId = testClassIds[i];
107107
const cv::Rect2d& testBox = testBoxes[i];
108108
bool matched = false;
109+
double topIoU = 0;
109110
for (int j = 0; j < refBoxes.size() && !matched; ++j)
110111
{
111112
if (!matchedRefBoxes[j] && testClassId == refClassIds[j] &&
112113
std::abs(testScore - refScores[j]) < scores_diff)
113114
{
114115
double interArea = (testBox & refBoxes[j]).area();
115116
double iou = interArea / (testBox.area() + refBoxes[j].area() - interArea);
116-
if (std::abs(iou - 1.0) < boxes_iou_diff)
117+
topIoU = std::max(topIoU, iou);
118+
if (1.0 - iou < boxes_iou_diff)
117119
{
118120
matched = true;
119121
matchedRefBoxes[j] = true;
120122
}
121123
}
122124
}
123125
if (!matched)
126+
{
124127
std::cout << cv::format("Unmatched prediction: class %d score %f box ",
125128
testClassId, testScore) << testBox << std::endl;
129+
std::cout << "Highest IoU: " << topIoU << std::endl;
130+
}
126131
EXPECT_TRUE(matched) << comment;
127132
}
128133

modules/dnn/test/test_darknet_importer.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ TEST_P(Test_Darknet_nets, YOLOv3)
464464
1, 2, 0.997412f, 0.647584f, 0.459939f, 0.821038f, 0.663947f); // a car
465465

466466
double scoreDiff = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.006 : 8e-5;
467-
double iouDiff = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.018 : 3e-4;
467+
double iouDiff = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.042 : 3e-4;
468468

469469
std::string config_file = "yolov3.cfg";
470470
std::string weights_file = "yolov3.weights";
@@ -487,15 +487,10 @@ TEST_P(Test_Darknet_nets, YOLOv3)
487487
#if defined(INF_ENGINE_RELEASE)
488488
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
489489
{
490-
if (INF_ENGINE_VER_MAJOR_LE(2018050000) && target == DNN_TARGET_OPENCL)
490+
if (target == DNN_TARGET_OPENCL)
491491
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
492-
else if (INF_ENGINE_VER_MAJOR_EQ(2019020000))
493-
{
494-
if (target == DNN_TARGET_OPENCL)
495-
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
496-
if (target == DNN_TARGET_OPENCL_FP16)
497-
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
498-
}
492+
else if (target == DNN_TARGET_OPENCL_FP16 && INF_ENGINE_VER_MAJOR_LE(202010000))
493+
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
499494
else if (target == DNN_TARGET_MYRIAD &&
500495
getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
501496
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);

0 commit comments

Comments
 (0)