Complete RTMPOSE

This commit is contained in:
2026-05-14 21:16:35 +10:00
parent 71404affb7
commit a43a99834a
2 changed files with 268 additions and 45 deletions
+50 -32
View File
@@ -443,15 +443,20 @@ extern "C" ANSODENGINE_API std::string CreateANSODHandle(ANSCENTER::ANSODBase**
modelType = onNvidia ? 31 /* RTYOLO */ : 30 /* ONNXYOLO */;
break;
// ── Pose ─────────────────────────────────────────────────────────────
case 21: // ONNXPOSE
case 22: // RTPOSE
modelType = onNvidia ? 22 /* RTPOSE */ : 21 /* ONNXPOSE */;
break;
// Intentionally NOT auto-routed. The user picks the backend explicitly:
// 21 → ANSONNXPOSE (ONNX Runtime)
// 22 → ANSTENSORRTPOSE (TensorRT, falls back to ONNX on non-NVIDIA
// via the case-22 body)
// Removing the rewrite makes 21 vs 22 comparisons meaningful — the
// previous behavior silently upgraded 21 → 22 on any NVIDIA box.
// ── RTMPose (top-down SimCC pose) ────────────────────────────────────
case 32: // ONNXRTMPOSE
case 33: // RTRTMPOSE
modelType = onNvidia ? 33 /* RTRTMPOSE */ : 32 /* ONNXRTMPOSE */;
break;
// Intentionally NOT auto-routed (unlike 21/22 ONNXPOSE/RTPOSE).
// The user picks the backend explicitly:
// 32 → ANSONNXRTMPOSE (ONNX Runtime)
// 33 → ANSRTRTMPOSE (TensorRT, falls back to ONNX on non-NVIDIA
// via the intra-case check inside case 33)
// This keeps 32 vs 33 comparisons meaningful — without it, picking
// 32 on an NVIDIA box silently gets rewritten to 33 here.
// ── Segmentation ─────────────────────────────────────────────────────
case 23: // ONNXSEG
case 24: // RTSEG
@@ -820,15 +825,20 @@ extern "C" ANSODENGINE_API int CreateANSODHandleEx(ANSCENTER::ANSODBase** Handl
modelType = onNvidia ? 31 /* RTYOLO */ : 30 /* ONNXYOLO */;
break;
// ── Pose ─────────────────────────────────────────────────────────────
case 21: // ONNXPOSE
case 22: // RTPOSE
modelType = onNvidia ? 22 /* RTPOSE */ : 21 /* ONNXPOSE */;
break;
// Intentionally NOT auto-routed. The user picks the backend explicitly:
// 21 → ANSONNXPOSE (ONNX Runtime)
// 22 → ANSTENSORRTPOSE (TensorRT, falls back to ONNX on non-NVIDIA
// via the case-22 body)
// Removing the rewrite makes 21 vs 22 comparisons meaningful — the
// previous behavior silently upgraded 21 → 22 on any NVIDIA box.
// ── RTMPose (top-down SimCC pose) ────────────────────────────────────
case 32: // ONNXRTMPOSE
case 33: // RTRTMPOSE
modelType = onNvidia ? 33 /* RTRTMPOSE */ : 32 /* ONNXRTMPOSE */;
break;
// Intentionally NOT auto-routed (unlike 21/22 ONNXPOSE/RTPOSE).
// The user picks the backend explicitly:
// 32 → ANSONNXRTMPOSE (ONNX Runtime)
// 33 → ANSRTRTMPOSE (TensorRT, falls back to ONNX on non-NVIDIA
// via the intra-case check inside case 33)
// This keeps 32 vs 33 comparisons meaningful — without it, picking
// 32 on an NVIDIA box silently gets rewritten to 33 here.
// ── Segmentation ─────────────────────────────────────────────────────
case 23: // ONNXSEG
case 24: // RTSEG
@@ -1243,15 +1253,19 @@ extern "C" __declspec(dllexport) int LoadModelFromFolder(ANSCENTER::ANSODBase**
modelType = onNvidia ? 31 /* RTYOLO */ : 30 /* ONNXYOLO */;
break;
// ── Pose ─────────────────────────────────────────────────────────
case 21: // ONNXPOSE
case 22: // RTPOSE
modelType = onNvidia ? 22 /* RTPOSE */ : 21 /* ONNXPOSE */;
break;
// Intentionally NOT auto-routed. The user picks the backend explicitly:
// 21 → ANSONNXPOSE (ONNX Runtime)
// 22 → ANSTENSORRTPOSE (TensorRT, falls back to ONNX on
// non-NVIDIA via the case-22 body)
// Removing the rewrite makes 21 vs 22 comparisons meaningful.
// ── RTMPose (top-down SimCC pose) ────────────────────────────────
case 32: // ONNXRTMPOSE
case 33: // RTRTMPOSE
modelType = onNvidia ? 33 /* RTRTMPOSE */ : 32 /* ONNXRTMPOSE */;
break;
// Intentionally NOT auto-routed (unlike 21/22 ONNXPOSE/RTPOSE).
// The user picks the backend explicitly:
// 32 → ANSONNXRTMPOSE (ONNX Runtime)
// 33 → ANSRTRTMPOSE (TensorRT, falls back to ONNX on
// non-NVIDIA via the case-33 body)
// This keeps 32 vs 33 comparisons meaningful — without it,
// picking 32 on an NVIDIA box silently gets rewritten to 33.
// ── Segmentation ─────────────────────────────────────────────────
case 23: // ONNXSEG
case 24: // RTSEG
@@ -1585,15 +1599,19 @@ ANSODENGINE_API int OptimizeModelStr(const char* modelFilePath, const char* mode
modelType = onNvidia ? 31 /* RTYOLO */ : 30 /* ONNXYOLO */;
break;
// ── Pose ─────────────────────────────────────────────────────────
case 21: // ONNXPOSE
case 22: // RTPOSE
modelType = onNvidia ? 22 /* RTPOSE */ : 21 /* ONNXPOSE */;
break;
// Intentionally NOT auto-routed. The user picks the backend explicitly:
// 21 → ANSONNXPOSE (ONNX Runtime)
// 22 → ANSTENSORRTPOSE (TensorRT, falls back to ONNX on
// non-NVIDIA via the case-22 body)
// Removing the rewrite makes 21 vs 22 comparisons meaningful.
// ── RTMPose (top-down SimCC pose) ────────────────────────────────
case 32: // ONNXRTMPOSE
case 33: // RTRTMPOSE
modelType = onNvidia ? 33 /* RTRTMPOSE */ : 32 /* ONNXRTMPOSE */;
break;
// Intentionally NOT auto-routed (unlike 21/22 ONNXPOSE/RTPOSE).
// The user picks the backend explicitly:
// 32 → ANSONNXRTMPOSE (ONNX Runtime)
// 33 → ANSRTRTMPOSE (TensorRT, falls back to ONNX on
// non-NVIDIA via the case-33 body)
// This keeps 32 vs 33 comparisons meaningful — without it,
// picking 32 on an NVIDIA box silently gets rewritten to 33.
// ── Segmentation ─────────────────────────────────────────────────
case 23: // ONNXSEG
case 24: // RTSEG