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

objdetect: call setInputShape in FaceDetectorYN to support ONNX Runtime dynamic input

This commit is contained in:
Samaresh Kumar Singh
2026-04-17 15:26:08 -05:00
parent 924a10069c
commit 75c56661d7
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