@@ -209,14 +209,15 @@ class Test_Model : public DNNTestLayer
209
209
normAssertTextDetections (gt, contours, " " , 0 .05f );
210
210
}
211
211
212
- void testTextDetectionModelByEAST (const std::string& weights, const std::string& cfg,
213
- const std::string& imgPath, const std::vector<RotatedRect>& gt,
214
- float confThresh, float nmsThresh,
215
- const Size& size = {-1 , -1 }, Scalar mean = Scalar(),
216
- double scale = 1.0, bool swapRB = false, bool crop = false)
212
+ void testTextDetectionModelByEAST (
213
+ const std::string& weights, const std::string& cfg,
214
+ const std::string& imgPath, const std::vector<RotatedRect>& gt,
215
+ float confThresh, float nmsThresh,
216
+ const Size& size = {-1 , -1 }, Scalar mean = Scalar(),
217
+ double scale = 1.0, bool swapRB = false, bool crop = false,
218
+ double eps_center = 5/* pixels*/ , double eps_size = 5/* pixels*/ , double eps_angle = 1
219
+ )
217
220
{
218
- const double EPS_PIXELS = 3 ;
219
-
220
221
checkBackend ();
221
222
222
223
Mat frame = imread (imgPath);
@@ -255,11 +256,11 @@ class Test_Model : public DNNTestLayer
255
256
waitKey(0);
256
257
#endif
257
258
const RotatedRect& gtBox = gt[i];
258
- EXPECT_NEAR (box.center .x , gtBox.center .x , EPS_PIXELS );
259
- EXPECT_NEAR (box.center .y , gtBox.center .y , EPS_PIXELS );
260
- EXPECT_NEAR (box.size .width , gtBox.size .width , EPS_PIXELS );
261
- EXPECT_NEAR (box.size .height , gtBox.size .height , EPS_PIXELS );
262
- EXPECT_NEAR (box.angle , gtBox.angle , 1 );
259
+ EXPECT_NEAR (box.center .x , gtBox.center .x , eps_center );
260
+ EXPECT_NEAR (box.center .y , gtBox.center .y , eps_center );
261
+ EXPECT_NEAR (box.size .width , gtBox.size .width , eps_size );
262
+ EXPECT_NEAR (box.size .height , gtBox.size .height , eps_size );
263
+ EXPECT_NEAR (box.angle , gtBox.angle , eps_angle );
263
264
}
264
265
}
265
266
};
@@ -642,9 +643,6 @@ TEST_P(Test_Model, TextDetectionByDB)
642
643
643
644
TEST_P (Test_Model, TextDetectionByEAST)
644
645
{
645
- if (target == DNN_TARGET_OPENCL_FP16)
646
- applyTestTag (CV_TEST_TAG_DNN_SKIP_OPENCL_FP16);
647
-
648
646
std::string imgPath = _tf (" text_det_test2.jpg" );
649
647
std::string weightPath = _tf (" frozen_east_text_detection.pb" , false );
650
648
@@ -663,7 +661,20 @@ TEST_P(Test_Model, TextDetectionByEAST)
663
661
float confThresh = 0.5 ;
664
662
float nmsThresh = 0.4 ;
665
663
666
- testTextDetectionModelByEAST (weightPath, " " , imgPath, gt, confThresh, nmsThresh, size, mean, scale, swapRB);
664
+ double eps_center = 5 /* pixels*/ ;
665
+ double eps_size = 5 /* pixels*/ ;
666
+ double eps_angle = 1 ;
667
+
668
+ if (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_CUDA_FP16 || target == DNN_TARGET_MYRIAD)
669
+ {
670
+ eps_center = 10 ;
671
+ eps_size = 25 ;
672
+ eps_angle = 3 ;
673
+ }
674
+
675
+ testTextDetectionModelByEAST (weightPath, " " , imgPath, gt, confThresh, nmsThresh, size, mean, scale, swapRB, false /* crop*/ ,
676
+ eps_center, eps_size, eps_angle
677
+ );
667
678
}
668
679
669
680
INSTANTIATE_TEST_CASE_P (/* */ , Test_Model, dnnBackendsAndTargets());
0 commit comments