修复人脸画框,xin2,增加了画框人脸识别结果,后面要关闭3
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:11:56 +08:00
parent 36b6e72904
commit 2dd9b35b82
3 changed files with 38 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include "ai_scheduler.h"
#include "face/face_result.h"
#include "node.h"
#include "utils/dma_alloc.h"
#include "utils/logger.h"
namespace rk3588 {
@ -515,6 +516,18 @@ private:
#if defined(RK3588_ENABLE_RKNN)
void Run(FramePtr frame) {
if (!frame->data || frame->data_size == 0) return;
struct ScopedDmaCpuAccess {
int fd = -1;
bool active = false;
explicit ScopedDmaCpuAccess(int f) : fd(f), active(f >= 0) {
if (active) DmaSyncStartFd(fd);
}
~ScopedDmaCpuAccess() {
if (active) DmaSyncEndFd(fd);
}
} sync(frame->dma_fd);
if (frame->format != PixelFormat::RGB && frame->format != PixelFormat::BGR) {
std::cerr << "[ai_face_det] input must be RGB/BGR\n";
return;

View File

@ -15,6 +15,7 @@
#include "ai_scheduler.h"
#include "face/face_result.h"
#include "node.h"
#include "utils/dma_alloc.h"
#include "utils/logger.h"
#if defined(RK3588_ENABLE_SQLITE3)
@ -776,6 +777,18 @@ private:
void Run(FramePtr frame) {
if (!frame->face_det || frame->face_det->faces.empty()) return;
if (!frame->data || frame->data_size == 0) return;
struct ScopedDmaCpuAccess {
int fd = -1;
bool active = false;
explicit ScopedDmaCpuAccess(int f) : fd(f), active(f >= 0) {
if (active) DmaSyncStartFd(fd);
}
~ScopedDmaCpuAccess() {
if (active) DmaSyncEndFd(fd);
}
} sync(frame->dma_fd);
if (frame->format != PixelFormat::RGB && frame->format != PixelFormat::BGR) {
std::cerr << "[ai_face_recog] input must be RGB/BGR\n";
return;

View File

@ -11,6 +11,7 @@
#include "ai_scheduler.h"
#include "node.h"
#include "utils/dma_alloc.h"
#include "utils/logger.h"
#if defined(RK3588_ENABLE_RKNN)
@ -407,6 +408,17 @@ private:
void RunInference(FramePtr frame) {
if (!frame->data || frame->data_size == 0) return;
struct ScopedDmaCpuAccess {
int fd = -1;
bool active = false;
explicit ScopedDmaCpuAccess(int f) : fd(f), active(f >= 0) {
if (active) DmaSyncStartFd(fd);
}
~ScopedDmaCpuAccess() {
if (active) DmaSyncEndFd(fd);
}
} sync(frame->dma_fd);
bool is_rgb = (frame->format == PixelFormat::RGB || frame->format == PixelFormat::BGR);
if (!is_rgb) {
std::cerr << "[ai_yolo] input must be RGB/BGR, got other format\n";