This project integrates Meta's SAM 3D Body model (facebookresearch/sam-3d-body) with a Python desktop application for single-image full-body 3D human mesh recovery.
SAM 3D Body (3DB) is a promptable model that reconstructs a full-body 3D human mesh from a single image. It uses a DINOv3 encoder-decoder architecture and outputs a Momentum Human Rig (MHR) mesh covering body, feet, and hands. Auxiliary prompts (2D keypoints, segmentation masks) can be supplied to guide inference, similar to the SAM family of models.
git clone https://github.com/facebookresearch/sam-3d-body
cd sam-3d-body
pip install -e .
Follow INSTALL.md to request access to the gated Hugging Face checkpoints.
cd /path/to/this/repo
pip install -r requirements.txt
Alternatively, use the provided helper scripts:
# Linux / macOS
bash setup_venv.sh
# Windows
setup_venv.bat
huggingface-cli download facebook/sam-3d-body-dinov3 \
--local-dir checkpoints/sam-3d-body-dinov3
import cv2
from src.model.sam3d_processor import SAM3DProcessor
processor = SAM3DProcessor.from_pretrained(
hf_repo_id="facebook/sam-3d-body-dinov3"
)
img_bgr = cv2.imread("path/to/image.jpg")
outputs = processor.process_frame(img_bgr)
vertices = outputs["vertices"] # Vx3 float32 – MHR mesh vertices
faces = outputs["faces"] # Fx3 int32 – triangle faces
joints = outputs["joints"] # Jx3 float32 – 3-D joint positions
python src/main.py
from src.visualization.body_viewer import BodyMeshViewer
viewer = BodyMeshViewer(vertices=outputs["vertices"], faces=outputs["faces"])
viewer.visualize()
src/
├── main.py # Application entry point
├── model/
│ └── sam3d_processor.py # SAM 3D Body processor (wraps Meta's estimator)
├── ui/
│ └── app.py # SAM3DApp – PyQt6 main window
└── visualization/
└── body_viewer.py # BodyMeshViewer / BodyPointCloudViewer (Open3D)
16 commits
2 commits
Python
92.4%
Shell
6.3%
Batchfile
1.2%
This project integrates Meta's SAM 3D Body model (facebookresearch/sam-3d-body) with a Python desktop application for single-image full-body 3D human mesh recovery.
SAM 3D Body (3DB) is a promptable model that reconstructs a full-body 3D human mesh from a single image. It uses a DINOv3 encoder-decoder architecture and outputs a Momentum Human Rig (MHR) mesh covering body, feet, and hands. Auxiliary prompts (2D keypoints, segmentation masks) can be supplied to guide inference, similar to the SAM family of models.
git clone https://github.com/facebookresearch/sam-3d-body
cd sam-3d-body
pip install -e .
Follow INSTALL.md to request access to the gated Hugging Face checkpoints.
cd /path/to/this/repo
pip install -r requirements.txt
Alternatively, use the provided helper scripts:
# Linux / macOS
bash setup_venv.sh
# Windows
setup_venv.bat
huggingface-cli download facebook/sam-3d-body-dinov3 \
--local-dir checkpoints/sam-3d-body-dinov3
import cv2
from src.model.sam3d_processor import SAM3DProcessor
processor = SAM3DProcessor.from_pretrained(
hf_repo_id="facebook/sam-3d-body-dinov3"
)
img_bgr = cv2.imread("path/to/image.jpg")
outputs = processor.process_frame(img_bgr)
vertices = outputs["vertices"] # Vx3 float32 – MHR mesh vertices
faces = outputs["faces"] # Fx3 int32 – triangle faces
joints = outputs["joints"] # Jx3 float32 – 3-D joint positions
python src/main.py
from src.visualization.body_viewer import BodyMeshViewer
viewer = BodyMeshViewer(vertices=outputs["vertices"], faces=outputs["faces"])
viewer.visualize()
src/
├── main.py # Application entry point
├── model/
│ └── sam3d_processor.py # SAM 3D Body processor (wraps Meta's estimator)
├── ui/
│ └── app.py # SAM3DApp – PyQt6 main window
└── visualization/
└── body_viewer.py # BodyMeshViewer / BodyPointCloudViewer (Open3D)
16 commits
2 commits
Python
92.4%
Shell
6.3%
Batchfile
1.2%