From 6ad98f1a9721d94d0996b5a3ba3785a969dcdd70 Mon Sep 17 00:00:00 2001 From: Corentin Vannier Date: Thu, 29 Feb 2024 11:44:38 +0100 Subject: [PATCH] fix(ci): Make SAM and MobileSAM optional dependencies --- .github/workflows/lint.yml | 2 +- pyproject.toml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 34d5a6b..4dc55f6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,7 +47,7 @@ jobs: python -m pip install pylint python -m pip install torch~=2.2.0 torchaudio~=2.2.0 torchvision~=0.17.0 --index-url https://download.pytorch.org/whl/cpu python -m pip install tensorflow-cpu~=2.15.0 - python -m pip install . + python -m pip install .[sam] - name: Lint backend code with Pylint run: | diff --git a/pyproject.toml b/pyproject.toml index e0bb3b4..58af3ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,8 +29,6 @@ dependencies = [ "torchvision ~= 0.17.0", "tensorflow ~= 2.15.0", "tensorflow-hub ~= 0.15.0", - "segment-anything@git+https://github.com/facebookresearch/segment-anything", - "mobile-sam@git+https://github.com/ChaoningZhang/MobileSAM", "transformers >= 4.33.0", "timm >= 0.9.12", "gitpython >= 3.1.30", @@ -51,6 +49,10 @@ documentation = [ "mkdocs-literate-nav ~= 0.6.0", "mkdocs-redirects ~= 1.2.1", ] +sam = [ + "segment-anything@git+https://github.com/facebookresearch/segment-anything", + "mobile-sam@git+https://github.com/ChaoningZhang/MobileSAM", +] [project.urls] Documentation = "https://github.com/pixano/pixano-inference#readme"