Add person model into RTMPOSE

This commit is contained in:
2026-05-14 19:05:20 +10:00
parent ee8f0d1163
commit 8e4d9a9e5d
5 changed files with 478 additions and 36 deletions
+16
View File
@@ -5,6 +5,7 @@
#include "engine.h"
#include "ANSGpuFrameRegistry.h"
#include "engine/EnginePoolManager.h"
#include "ANSRTYOLO.h" // internal person-detector front-end (top-down pipeline)
namespace ANSCENTER {
@@ -100,6 +101,21 @@ namespace ANSCENTER {
EnginePoolManager<float>::PoolKey m_poolKey;
bool m_usingSharedPool = false;
// ── Optional internal person detector (top-down pipeline) ───────
// RTMPose is a top-down single-person estimator — feeding it whole
// scenes produces noise. If the model folder bundles person.onnx +
// person.names alongside the pose model, we auto-load a YOLO person
// detector here and run pose ONCE PER DETECTED PERSON. When those
// files are missing the wrapper falls back to whole-image pose so
// that single-person test inputs (selfies, fitness clips) still work.
std::unique_ptr<ANSRTYOLO> m_personDetector;
// Look for person.onnx + person.names in `modelFolder`. Loads
// m_personDetector and returns true on success; returns false
// (without logging an error) if either file is missing — caller
// should treat that as "no detector, fall back to whole-image".
bool TryLoadPersonDetector(const std::string& modelFolder);
ANSCENTER::Options m_options;
// Fixed RTMPose model geometry (overridden from the engine's input dims