From ce841d7dc07d2a0e838fc0c74115101b10c92094 Mon Sep 17 00:00:00 2001 From: pablovela5620 Date: Sun, 23 Mar 2025 14:12:42 -0500 Subject: [PATCH 1/4] add proper pyproject.toml --- .gitattributes | 2 ++ .gitignore | 4 ++++ pyproject.toml | 49 +++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 7 ------- requirements_demo.txt | 11 ---------- 5 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 .gitattributes create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 requirements_demo.txt diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..887a2c1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# SCM syntax highlighting & preventing 3-way merges +pixi.lock merge=binary linguist-language=YAML linguist-generated=true diff --git a/.gitignore b/.gitignore index 6677453..6c2db43 100644 --- a/.gitignore +++ b/.gitignore @@ -144,3 +144,7 @@ dmypy.json **/tmp/ **/outputs/skyseg.onnx skyseg.onnx + +# pixi environments +.pixi +*.egg-info diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5978fa2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,49 @@ +[project] +authors = [{ name = "Jianyuan Wang", email = "jianyuan@robots.ox.ac.uk" }] +dependencies = [ + "torch==2.3.1", + "torchvision==0.18.1", + "numpy==1.26.1", + "Pillow", + "huggingface_hub", + "einops", + "safetensors", +] +name = "vggt" +requires-python = ">= 3.11" +version = "0.1.0" + +[project.optional-dependencies] +demo = [ + "gradio==5.17.1", + "viser==0.2.23", + "tqdm", + "hydra-core", + "omegaconf", + "opencv-python", + "scipy", + "onnxruntime", + "requests", + "trimesh", + "matplotlib", +] + +[build-system] +build-backend = "hatchling.build" +requires = ["hatchling"] + +[tool.hatch.build.targets.wheel] +packages = ["vggt"] + +[tool.pixi.workspace] +channels = ["conda-forge"] +platforms = ["linux-64"] + +[tool.pixi.pypi-dependencies] +vggt = { path = ".", editable = true } + +[tool.pixi.environments] +default = { solve-group = "default" } +demo = { features = ["demo"], solve-group = "default" } + +[tool.pixi.tasks] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1cb61a2..0000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -torch==2.3.1 -torchvision==0.18.1 -numpy==1.26.1 -Pillow -huggingface_hub -einops -safetensors diff --git a/requirements_demo.txt b/requirements_demo.txt deleted file mode 100644 index efd6f5e..0000000 --- a/requirements_demo.txt +++ /dev/null @@ -1,11 +0,0 @@ -gradio==5.17.1 -viser==0.2.23 -tqdm -hydra-core -omegaconf -opencv-python -scipy -onnxruntime -requests -trimesh -matplotlib From d33e01ee133b0490773ebc452fa6516d62a8ce6a Mon Sep 17 00:00:00 2001 From: pablovela5620 Date: Sun, 23 Mar 2025 14:22:52 -0500 Subject: [PATCH 2/4] update installation instructions in README.md for pip, pixi, and uv --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6997b27..df9fb4b 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,24 @@ First, clone this repository to your local machine, and install the dependencies ```bash git clone git@github.com:facebookresearch/vggt.git cd vggt -pip install -r requirements.txt +``` +### Install with pip +```bash +pip install -e . ``` +### Install and run with pixi +Download [pixi here](https://pixi.sh) + +```bash +pixi run -e python demo_gradio.py +``` + +### Install and run with uv +Download [uv here](https://docs.astral.sh/uv/getting-started/installation/) +```bash +uv run --extra demo demo_gradio.py +``` Now, try the model with just a few lines of code: From a6ba13880002dfdf7899503606fbe79435e74dd6 Mon Sep 17 00:00:00 2001 From: pablovela5620 Date: Sun, 23 Mar 2025 14:27:57 -0500 Subject: [PATCH 3/4] relax torch + torchvision version requirements --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5978fa2..976a91f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [project] authors = [{ name = "Jianyuan Wang", email = "jianyuan@robots.ox.ac.uk" }] dependencies = [ - "torch==2.3.1", - "torchvision==0.18.1", + "torch>=2.3.1", + "torchvision>=0.18.1", "numpy==1.26.1", "Pillow", "huggingface_hub", From f8bf73ac25d5089cca2d6540a185697087fa2255 Mon Sep 17 00:00:00 2001 From: pablovela5620 Date: Sun, 23 Mar 2025 14:28:55 -0500 Subject: [PATCH 4/4] update numpy version constraint to allow for compatibility with future releases --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 976a91f..dda64e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ authors = [{ name = "Jianyuan Wang", email = "jianyuan@robots.ox.ac.uk" }] dependencies = [ "torch>=2.3.1", "torchvision>=0.18.1", - "numpy==1.26.1", + "numpy<2", "Pillow", "huggingface_hub", "einops",