修复人脸检测,o4.5 2
This commit is contained in:
parent
40eaec8c4c
commit
d55356b5ef
@ -600,6 +600,16 @@ private:
|
||||
|
||||
DecodeRetinaFace(tensors, src_w, src_h, in_w, in_h, det);
|
||||
frame->face_det = std::make_shared<FaceDetResult>(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<Tensor>& outs,
|
||||
@ -658,6 +668,17 @@ private:
|
||||
const int n = loc.n;
|
||||
|
||||
const std::vector<Prior> 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<int>(priors.size()) != n) {
|
||||
// Mismatch: can't reliably decode.
|
||||
std::cerr << "[ai_face_det] prior mismatch: priors=" << priors.size() << " n=" << n << "\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user