From d55356b5efeec2ad45e42d7f9ac5d42cfe5ab702 Mon Sep 17 00:00:00 2001 From: sladro Date: Wed, 7 Jan 2026 19:38:10 +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=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/ai_face_det/ai_face_det_node.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/ai_face_det/ai_face_det_node.cpp b/plugins/ai_face_det/ai_face_det_node.cpp index 144600c..49377d5 100644 --- a/plugins/ai_face_det/ai_face_det_node.cpp +++ b/plugins/ai_face_det/ai_face_det_node.cpp @@ -600,6 +600,16 @@ private: DecodeRetinaFace(tensors, src_w, src_h, in_w, in_h, det); frame->face_det = std::make_shared(std::move(det)); + + // Debug: log detection count + static uint64_t dbg_frame_cnt = 0; + ++dbg_frame_cnt; + if (dbg_frame_cnt <= 10 || (dbg_frame_cnt % 100) == 0) { + LogInfo("[ai_face_det] frame=" + std::to_string(dbg_frame_cnt) + + " detected=" + std::to_string(frame->face_det->faces.size()) + + " src=" + std::to_string(src_w) + "x" + std::to_string(src_h) + + " in=" + std::to_string(in_w) + "x" + std::to_string(in_h)); + } } void DecodeRetinaFace(const std::vector& outs, @@ -658,6 +668,17 @@ private: const int n = loc.n; const std::vector priors = GenerateRetinaFacePriors(in_w, in_h, steps_, min_sizes_); + + // Debug: log tensor info once + static bool dbg_tensor_logged = false; + if (!dbg_tensor_logged) { + dbg_tensor_logged = true; + LogInfo("[ai_face_det] decode: loc.n=" + std::to_string(loc.n) + + " conf.n=" + std::to_string(conf.n) + + " priors=" + std::to_string(priors.size()) + + " in=" + std::to_string(in_w) + "x" + std::to_string(in_h)); + } + if (!priors.empty() && static_cast(priors.size()) != n) { // Mismatch: can't reliably decode. std::cerr << "[ai_face_det] prior mismatch: priors=" << priors.size() << " n=" << n << "\n";