Views
No views yet
1# Download assets from HuggingFace
2hf download facebook/sam-3d-body-dinov3 --local-dir checkpoints/sam-3d-body-dinov3
3
4# Run demo script
5python demo.py \
6 --image_folder <path_to_images> \
7 --output_folder <path_to_output> \
8 --checkpoint_path ./checkpoints/sam-3d-body-dinov3/model.ckpt \
9 --mhr_path ./checkpoints/sam-3d-body-dinov3/assets/mhr_model.pt1import cv2
2import numpy as np
3from notebook.utils import setup_sam_3d_body
4from tools.vis_utils import visualize_sample_together
5
6# Set up the estimator
7estimator = setup_sam_3d_body(hf_repo_id="facebook/sam-3d-body-dinov3")
8
9# Load and process image
10img_bgr = cv2.imread("path/to/image.jpg")
11outputs = estimator.process_one_image(cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB))
12
13# Visualize and save results
14rend_img = visualize_sample_together(img_bgr, outputs, estimator.faces)
15cv2.imwrite("output.jpg", rend_img.astype(np.uint8))pred_vertices: 3D mesh vertices in camera coordinatespred_keypoints_3d: 3D pose keypointspred_keypoints_2d: 2D pose keypoints projected to imagepred_cam_t: Camera translation parametersfocal_length: Estimated focal lengthbody_pose_params: Body pose parametershand_pose_params: Hand pose parametersshape_params: Body shape parameters1@article{yang2025sam3dbody,
2 title={SAM 3D Body: Robust Full-Body Human Mesh Recovery},
3 author={Yang, Xitong and Kukreja, Devansh and Pinkus, Don and Sagar, Anushka and Fan, Taosha and Park, Jinhyung and Shin, Soyong and Cao, Jinkun and Liu, Jiawei and Ugrinovic, Nicolas and Feiszli, Matt and Malik, Jitendra and Dollar, Piotr and Kitani, Kris},
4 journal={arXiv preprint; identifier to be added},
5 year={2025}
6}