1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #28826 from ssam18:fix/yunet-dynamic-input-onnxruntime

objdetect: fix FaceDetectorYN dynamic input size for ONNX Runtime backend
This commit is contained in:
Alexander Smorkalov
2026-04-27 12:50:52 +03:00
committed by GitHub
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -43,6 +43,9 @@ public:
padW = (int((inputW - 1) / divisor) + 1) * divisor;
padH = (int((inputH - 1) / divisor) + 1) * divisor;
if (!net.getMainGraph())
net.setInputShape("input", MatShape({1, 3, padH, padW}));
scoreThreshold = score_threshold;
nmsThreshold = nms_threshold;
topK = top_k;
@@ -72,6 +75,9 @@ public:
padW = (int((inputW - 1) / divisor) + 1) * divisor;
padH = (int((inputH - 1) / divisor) + 1) * divisor;
if (!net.getMainGraph())
net.setInputShape("input", MatShape({1, 3, padH, padW}));
scoreThreshold = score_threshold;
nmsThreshold = nms_threshold;
topK = top_k;
@@ -83,6 +89,8 @@ public:
inputH = input_size.height;
padW = ((inputW - 1) / divisor + 1) * divisor;
padH = ((inputH - 1) / divisor + 1) * divisor;
if (!net.getMainGraph())
net.setInputShape("input", MatShape({1, 3, padH, padW}));
}
Size getInputSize() override