Scaffold the zero-Python native tracker. Convert the real MediaPipe BlazePose landmark weights (from pose_landmarker_full.task) to ONNX and prove the ONNX Runtime C++ API runs them bit-identically to Python (ort_smoke vs ort_smoke_ref.py; landmarks match to 6dp, mask <=1.2% prob vs TFLite). Reproducible setup scripts (setup_models.sh, fetch_ort.sh) and a Linux build. No binaries committed (ORT + onnx/tflite are fetched/generated).
18 lines
683 B
Bash
Executable File
18 lines
683 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
TASK="${1:-${HERE}/../tracker/models/pose_landmarker_full.task}"
|
|
PY="${PY:-${HERE}/../tracker/.venv/bin/python}"
|
|
mkdir -p "${HERE}/models"
|
|
|
|
"${PY}" -c "import zipfile; zipfile.ZipFile('${TASK}').extractall('${HERE}/models')"
|
|
|
|
for m in pose_detector pose_landmarks_detector; do
|
|
if [ -f "${HERE}/models/${m}.onnx" ]; then continue; fi
|
|
if ! "${PY}" -m tf2onnx.convert --tflite "${HERE}/models/${m}.tflite" \
|
|
--output "${HERE}/models/${m}.onnx" --opset 17; then
|
|
echo "note: ${m} tflite->onnx conversion not supported by tf2onnx; skipping" >&2
|
|
fi
|
|
done
|
|
ls -la "${HERE}/models"
|