feat(tracker-native): multi-scale acquisition substitutes for the float16 detector
The pose_detector.tflite is float16-quantized, which tf2onnx 1.16.1/1.17/git-main all fail to convert (misreads float16 constants -> 'reshape 96 into (16,1,1,24)'). Rather than block on that upstream tool bug for an acquisition-only model, PoseEstimator::acquire() runs the landmark model over a few candidate ROIs (scales x vertical positions) and keeps the best presence. Headless on grace_hopper it reaches 0.730 presence - matching the detector's 0.731 - so acquisition quality is recovered. Worker now acquire()s until locked, then single-run tracks via the aux-landmark ROI.
This commit is contained in:
1 parent
f2783ce903
commit
5239ae5b81
4 files changed
+29
-3
No files matched your search
@@ -65,6 +65,25 @@ PoseEstimator::PoseEstimator(const char* landmark_model_path) {
|
||||
|
||||
PoseEstimator::~PoseEstimator() = default;
|
||||
|
||||
PoseResult PoseEstimator::acquire(const uint8_t* rgb, int width, int height) {
|
||||
const float longest = static_cast<float>(std::max(width, height));
|
||||
const float scales[] = {0.8f, 1.1f, 1.5f};
|
||||
const float cy_fracs[] = {0.4f, 0.55f};
|
||||
PoseResult best;
|
||||
float best_presence = -1.0f;
|
||||
for (float scale : scales) {
|
||||
for (float cy : cy_fracs) {
|
||||
Roi roi{width * 0.5f, height * cy, longest * scale, 0.0f};
|
||||
PoseResult r = run(rgb, width, height, roi);
|
||||
if (r.presence > best_presence) {
|
||||
best_presence = r.presence;
|
||||
best = std::move(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
Roi PoseEstimator::bootstrap_roi(int width, int height) {
|
||||
Roi r;
|
||||
r.cx = width * 0.5f;
|
||||
|
||||
Reference in new issue
Block a user