From f0ff9302667885061ea882278da983413b5d986f Mon Sep 17 00:00:00 2001 From: sladro Date: Wed, 7 Jan 2026 19:44:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=BA=E8=84=B8=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=EF=BC=8Co4.5=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/ai_face_det/ai_face_det_node.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plugins/ai_face_det/ai_face_det_node.cpp b/plugins/ai_face_det/ai_face_det_node.cpp index f8fe325..b32ab7a 100644 --- a/plugins/ai_face_det/ai_face_det_node.cpp +++ b/plugins/ai_face_det/ai_face_det_node.cpp @@ -727,6 +727,12 @@ private: constexpr float var0 = 0.1f; constexpr float var1 = 0.2f; + // Debug: track max score and sample conf values + static bool dbg_conf_logged = false; + float dbg_max_score = -999.0f; + float dbg_max_s0 = 0.0f, dbg_max_s1 = 0.0f; + int dbg_above_thresh = 0; + for (int i = 0; i < n; ++i) { const float s0 = conf.data[static_cast(i) * 2 + 0]; const float s1 = conf.data[static_cast(i) * 2 + 1]; @@ -736,6 +742,15 @@ private: } else { score = Softmax2(s0, s1); } + + // Debug: track max + if (score > dbg_max_score) { + dbg_max_score = score; + dbg_max_s0 = s0; + dbg_max_s1 = s1; + } + if (score >= conf_thresh_) ++dbg_above_thresh; + if (score < conf_thresh_) continue; const Prior p = priors.empty() ? Prior{0, 0, 0, 0} : priors[static_cast(i)]; @@ -786,6 +801,15 @@ private: } } + // Debug: log conf score info once + if (!dbg_conf_logged) { + dbg_conf_logged = true; + LogInfo("[ai_face_det] conf stats: max_score=" + std::to_string(dbg_max_score) + + " (s0=" + std::to_string(dbg_max_s0) + " s1=" + std::to_string(dbg_max_s1) + ")" + + " above_thresh=" + std::to_string(dbg_above_thresh) + + " thresh=" + std::to_string(conf_thresh_)); + } + if (boxes.empty()) return; std::vector keep;