Files
hand-motion-pipeline/docs/FOUNDATIONPOSE_SETUP.md
T

2.2 KiB

FoundationPose local setup

Validated 2026-09-16 for model-based RGB-D inference using an existing STL.

  • Source: third_party/FoundationPose, upstream commit a1b694b83e633c2cb6115b9063d940a687759392.
  • Interpreter: existing .venv/bin/python; reused Torch 2.7.1+cu128 and PyTorch3D.
  • CUDA toolkit: existing .cuda/usr/local/cuda-12.8; GPU architecture 8.6.
  • Installed upstream Python requirements, pybind11, ninja, and locally built nvdiffrast 0.4.0.
  • Compiled third_party/FoundationPose/mycpp/build/mycpp.cpython-311-x86_64-linux-gnu.so.
  • Obtain weights from the official research-release entry in EXTERNAL_RESOURCES.md. Current Git does not distribute model payloads. Reference hashes retain historical mirror provenance; no independent official-file match is claimed.

Run the verified smoke check

From the HandFlow root, in a shell with NVIDIA GPU access:

source scripts/foundationpose_env.sh
python scripts/verify_foundationpose_setup.py

The environment script clears ROS-related Python/library overrides and selects the existing project environment/toolkit. It does not install Torch or CUDA.

The check exercises actual CUDA rasterization, loads both pretrained networks and executes their forward passes, and initializes FoundationPose with docs/上半.stl, including compiled C++ rotation clustering. Results: output/foundationpose_setup/runtime_verification.json; installation/build logs are in the same directory.

This does not validate pose accuracy or contact constraints on the recorded video. Optional BundleSDF mycuda/NeRF extensions are not required for the existing-STL path and were not built.

Rebuild compiled modules

source scripts/foundationpose_env.sh
python -m pip install --no-build-isolation --no-deps ./third_party/nvdiffrast
cmake -S third_party/FoundationPose/mycpp -B third_party/FoundationPose/mycpp/build \
  -DCMAKE_BUILD_TYPE=Release \
  -Dpybind11_DIR="$FP_ROOT/.venv/lib/python3.11/site-packages/pybind11/share/cmake/pybind11" \
  -DPYTHON_EXECUTABLE="$FP_ROOT/.venv/bin/python" \
  -DPython_EXECUTABLE="$FP_ROOT/.venv/bin/python"
cmake --build third_party/FoundationPose/mycpp/build -j2