ANSFR: configurable slow-attribute refresh interval
New API SetANSRFAttributeInterval(Handle, frames) / UpdateAttributeInterval (1..60, default 5) controls how often the slow attributes (age/gender + emotions) refresh per camera; head pose and recognition are unaffected. GetANSRFModelInfo now reports "attribute_interval". The adaptive logic's stable-scene branch previously capped at a hardcoded 10 - it now doubles the configured interval instead (default behaviour 10/5/2 unchanged). Motivation: the v1.4 ViT age-gender model is heavier per attribute frame than the old OpenVINO IR. Interval sweep on RTX 3070 (classroom.mp4, ~3.1 faces/frame) vs the v1.1 baseline at 16.0 ms / 62 fps: interval 5 (default): 19.9 ms / 50 fps (+3.9 ms) interval 10: 17.1 ms / 58 fps (+1.1 ms) interval 20: 16.5 ms / 61 fps (parity) Recommendation: default on 8 GB GPUs; interval 10 on small-VRAM machines. ANSFR-UnitTest: --bench old|new [interval] runs the sweep. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1330,6 +1330,18 @@ extern "C" ANSFR_API int GetANSRFModelInfo(ANSCENTER::ANSFacialRecognit
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" ANSFR_API int SetANSRFAttributeInterval(ANSCENTER::ANSFacialRecognition** Handle, int frames) {
|
||||
ANS_DBG("ANSFR","SetANSRFAttributeInterval: HandlePtr=%p, *Handle=%p, frames=%d",
|
||||
(void*)Handle, (void*)(Handle ? *Handle : nullptr), frames);
|
||||
try {
|
||||
if (!Handle || !*Handle) return -1;
|
||||
return (*Handle)->UpdateAttributeInterval(frames) ? 1 : -1;
|
||||
}
|
||||
catch (const std::exception&) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" ANSFR_API int RunInferenceComplete_LV(
|
||||
ANSCENTER::ANSFacialRecognition** Handle,
|
||||
cv::Mat** cvImage,
|
||||
|
||||
Reference in New Issue
Block a user