修复人脸检车,最新
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-08 10:00:10 +08:00
parent 7b0171f48a
commit 8bb5b51574
3 changed files with 8 additions and 6 deletions

View File

@ -24,8 +24,8 @@
"type": "preprocess",
"role": "filter",
"enable": true,
"dst_w": 640,
"dst_h": 640,
"dst_w": 320,
"dst_h": 320,
"dst_format": "rgb",
"keep_ratio": false,
"use_rga": true

Binary file not shown.

View File

@ -165,12 +165,14 @@ bool ExtractNc(const Tensor& t, int c, NcTensor& out) {
// Common: [1, C, N] or [1, N, C]
const uint32_t d1 = t.dims[1];
const uint32_t d2 = t.dims[2];
if (static_cast<int>(d1) == c) {
n = static_cast<int>(d2);
transposed = true; // CxN
} else if (static_cast<int>(d2) == c) {
if (static_cast<int>(d2) == c) {
n = static_cast<int>(d1);
transposed = false; // NxC
} else if (static_cast<int>(d1) == c) {
n = static_cast<int>(d2);
transposed = true; // CxN
} else {
return false; // 明确拒绝,不 fallback
}
} else if (t.dims.size() == 2) {
// [N, C] or [C, N]