Skip to content

Add pyproject.toml for easy install - #88

Open
alex-bene wants to merge 2 commits into
facebookresearch:mainfrom
alex-bene:pyprojecttoml
Open

Add pyproject.toml for easy install#88
alex-bene wants to merge 2 commits into
facebookresearch:mainfrom
alex-bene:pyprojecttoml

Conversation

@alex-bene

Copy link
Copy Markdown

Add a pyproject.toml file to make the code easier to install for development, but also easy to install as a package.
With this, we can install locally for dev with:

uv sync --extra cu128 # or cu124, cu126, cpu depending on your cuda version

and install as a package with:

uv add git+https://github.com/facebookresearch/sam-3d-body.git

Solves: #43
Related with: #86

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 9, 2025
@victkk

victkk commented Dec 13, 2025

Copy link
Copy Markdown

this doesn't work. it tries to install detectron before torch is installed

@alex-bene

Copy link
Copy Markdown
Author

Hello @victkk , thanks for the comment. Could you share the command you ran to install? Indeed there was an error in the pyproject.toml for me but wasn't related to detectron but rather xtcocotools. Let me know if this fixes your issue.

@lizelive

lizelive commented Dec 29, 2025

Copy link
Copy Markdown

that patch for detectron2 was merged in

@hiAndrewQuinn

hiAndrewQuinn commented May 9, 2026

Copy link
Copy Markdown

Adding some notes from my attempts to build this repository using uv here. I was building this on the cheapest per-hour Runpod pod.

#!/bin/bash

# root assumed!
apt update && apt install -y libgl1-mesa-glx libglib2.0-0 curl git build-essential

# first get uv
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env

# now get the latest commit of this pr
git clone https://github.com/facebookresearch/sam-3d-body
cd sam-3d-body
git fetch origin pull/88/head:pr-88
git checkout pr-88
git reset --hard 7c574e15668c0cb2eb67d714a0a7cdaed6f2fdc5

# now install sam-3d-body with this uv
uv venv

# We must manually inject the build-backend tools, because 
# --no-build-isolation **disables** the automatic provision of these tools.
uv pip install \
    hatchling \
    hatch-vcs \
    editables \
    setuptools \
    wheel \
    torch --extra-index-url https://download.pytorch.org/whl/cu124

uv sync --extra cu124 --no-build-isolation

This took a long time, but it did work eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants