修复人脸检测,o4.5 5
Some checks are pending
CI / host-build (push) Waiting to run
CI / rk3588-cross-build (push) Waiting to run

This commit is contained in:
sladro 2026-01-07 19:44:38 +08:00
parent a37a5b056b
commit f0ff930266

View File

@ -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<size_t>(i) * 2 + 0];
const float s1 = conf.data[static_cast<size_t>(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<size_t>(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<int> keep;