修复人脸画框,xin2,增加了画框人脸识别结果,后面要关闭3
This commit is contained in:
parent
36b6e72904
commit
2dd9b35b82
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user