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/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: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dda64e8 --- /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<2", + "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