8000 Merge pull request #21607 from fengyuentau:fix_FaceDetectorYN_dynamic… · opencv/opencv@f77c357 · GitHub
[go: up one dir, main page]

Skip to content

Commit f77c357

Browse files
authored
Merge pull request #21607 from fengyuentau:fix_FaceDetectorYN_dynamic_shape
Use YuNet of fixed input shape to fix not-supported-dynamic-zero-shape for FaceDetectorYN * use yunet with input of fixed shape * update yunet used in face recognition regression
1 parent 5a86592 commit f77c357

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

modules/dnn/src/onnx/onnx_importer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,9 +2614,7 @@ void ONNXImporter::parseShape(LayerParams& layerParams, const opencv_onnx::NodeP
26142614
if (isDynamicShape)
26152615
{
26162616
CV_LOG_ERROR(NULL, "DNN/ONNX(Shape): dynamic 'zero' shapes are not supported, input " << toString(inpShape, node_proto.input(0)));
2617-
// FIXIT repair assertion
2618-
// Disabled to pass face detector tests from #20422
2619-
// CV_Assert(!isDynamicShape); // not supported
2617+
CV_Assert(!isDynamicShape); // not supported
26202618
}
26212619
addConstant(node_proto.output(0), shapeMat);
26222620
}

modules/objdetect/test/test_face.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ TEST(Objdetect_face_detection, regression)
7878
// }
7979

8080
// Initialize detector
81-
std::string model = findDataFile("dnn/onnx/models/yunet-202109.onnx", false);
81+
std::string model = findDataFile("dnn/onnx/models/yunet-202202.onnx", false);
8282
Ptr<FaceDetectorYN> faceDetector = FaceDetectorYN::create(model, "", Size(300, 300));
8383
faceDetector->setScoreThreshold(0.7f);
8484

@@ -178,7 +178,7 @@ TEST(Objdetect_face_recognition, regression)
178178
}
179179

180180
// Initialize detector
181-
std::string detect_model = findDataFile("dnn/onnx/models/yunet-202109.onnx", false);
181+
std::string detect_model = findDataFile("dnn/onnx/models/yunet-202202.onnx", false);
182182
Ptr<FaceDetectorYN> faceDetector = FaceDetectorYN::create(detect_model, "", Size(150, 150), score_thresh, nms_thresh);
183183

184184
std::string recog_model = findDataFile("dnn/onnx/models/face_recognizer_fast.onnx", false);

0 commit comments

Comments
 (0)
0