Skip to content

Commit

Permalink
Remove segment-anything in setup.cfg (Project-MONAI#8010)
Browse files Browse the repository at this point in the history
Fixes Project-MONAI#8009

### Description

Remove segment-anything in setup.cfg

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and rcremese committed Sep 2, 2024
1 parent 31a550c commit 61ef0da
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install setuptools
run: |
python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade setuptools wheel packaging
- name: Build and test source archive and wheel file
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
git describe
python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade setuptools wheel packaging
python setup.py build
cat build/lib/monai/_version.py
- name: Upload version
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ all =
nvidia-ml-py
huggingface_hub
pyamg>=5.0.0
segment-anything
nibabel =
nibabel
ninja =
Expand Down Expand Up @@ -168,8 +167,8 @@ huggingface_hub =
huggingface_hub
pyamg =
pyamg>=5.0.0
segment-anything =
segment-anything @ git+https://github.com/facebookresearch/segment-anything@6fdee8f2727f4506cfbbe553e23b895e27956588#egg=segment-anything
# segment-anything =
# segment-anything @ git+https://github.com/facebookresearch/segment-anything@6fdee8f2727f4506cfbbe553e23b895e27956588#egg=segment-anything

[flake8]
select = B,C,E,F,N,P,T4,W,B9
Expand Down
2 changes: 1 addition & 1 deletion tests/ngc_bundle_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_loading_mmar(self, item):
in_channels=1,
img_size=(96, 96, 96),
patch_size=(16, 16, 16),
pos_embed="conv",
proj_type="conv",
hidden_size=768,
mlp_dim=3072,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_handler_ignite_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import torch
from parameterized import parameterized

from monai.handlers import IgniteMetric, IgniteMetricHandler, from_engine
from monai.handlers import IgniteMetricHandler, from_engine
from monai.losses import DiceLoss
from monai.metrics import LossMetric
from tests.utils import SkipIfNoModule, assert_allclose, optional_import
Expand Down Expand Up @@ -172,7 +172,7 @@ def _val_func(engine, batch):
@parameterized.expand(TEST_CASES[0:2])
def test_old_ignite_metric(self, input_param, input_data, expected_val):
loss_fn = DiceLoss(**input_param)
ignite_metric = IgniteMetric(loss_fn=loss_fn, output_transform=from_engine(["pred", "label"]))
ignite_metric = IgniteMetricHandler(loss_fn=loss_fn, output_transform=from_engine(["pred", "label"]))

def _val_func(engine, batch):
pass
Expand Down
12 changes: 6 additions & 6 deletions tests/test_patchembedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"patch_size": (patch_size,) * nd,
"hidden_size": hidden_size,
"num_heads": num_heads,
"pos_embed": proj_type,
"proj_type": proj_type,
"pos_embed_type": pos_embed_type,
"dropout_rate": dropout_rate,
},
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_ill_arg(self):
patch_size=(16, 16, 16),
hidden_size=128,
num_heads=12,
pos_embed="conv",
proj_type="conv",
pos_embed_type="sincos",
dropout_rate=5.0,
)
Expand All @@ -139,7 +139,7 @@ def test_ill_arg(self):
patch_size=(64, 64, 64),
hidden_size=512,
num_heads=8,
pos_embed="perceptron",
proj_type="perceptron",
pos_embed_type="sincos",
dropout_rate=0.3,
)
Expand All @@ -151,7 +151,7 @@ def test_ill_arg(self):
patch_size=(8, 8, 8),
hidden_size=512,
num_heads=14,
pos_embed="conv",
proj_type="conv",
dropout_rate=0.3,
)

Expand All @@ -162,7 +162,7 @@ def test_ill_arg(self):
patch_size=(4, 4, 4),
hidden_size=768,
num_heads=8,
pos_embed="perceptron",
proj_type="perceptron",
dropout_rate=0.3,
)
with self.assertRaises(ValueError):
Expand All @@ -183,7 +183,7 @@ def test_ill_arg(self):
patch_size=(16, 16, 16),
hidden_size=768,
num_heads=12,
pos_embed="perc",
proj_type="perc",
dropout_rate=0.3,
)

Expand Down
12 changes: 6 additions & 6 deletions tests/test_unetr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
for num_heads in [8]:
for mlp_dim in [3072]:
for norm_name in ["instance"]:
for pos_embed in ["perceptron"]:
for proj_type in ["perceptron"]:
for nd in (2, 3):
test_case = [
{
Expand All @@ -42,7 +42,7 @@
"norm_name": norm_name,
"mlp_dim": mlp_dim,
"num_heads": num_heads,
"pos_embed": pos_embed,
"proj_type": proj_type,
"dropout_rate": dropout_rate,
"conv_block": True,
"res_block": False,
Expand Down Expand Up @@ -75,7 +75,7 @@ def test_ill_arg(self):
hidden_size=128,
mlp_dim=3072,
num_heads=12,
pos_embed="conv",
proj_type="conv",
norm_name="instance",
dropout_rate=5.0,
)
Expand All @@ -89,7 +89,7 @@ def test_ill_arg(self):
hidden_size=512,
mlp_dim=3072,
num_heads=12,
pos_embed="conv",
proj_type="conv",
norm_name="instance",
dropout_rate=0.5,
)
Expand All @@ -103,7 +103,7 @@ def test_ill_arg(self):
hidden_size=512,
mlp_dim=3072,
num_heads=14,
pos_embed="conv",
proj_type="conv",
norm_name="batch",
dropout_rate=0.4,
)
Expand All @@ -117,7 +117,7 @@ def test_ill_arg(self):
hidden_size=768,
mlp_dim=3072,
num_heads=12,
pos_embed="perc",
proj_type="perc",
norm_name="instance",
dropout_rate=0.2,
)
Expand Down
10 changes: 5 additions & 5 deletions tests/test_vitautoenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
for in_channels in [1, 4]:
for img_size in [64, 96, 128]:
for patch_size in [16]:
for pos_embed in ["conv", "perceptron"]:
for proj_type in ["conv", "perceptron"]:
for nd in [2, 3]:
test_case = [
{
Expand All @@ -34,7 +34,7 @@
"mlp_dim": 3072,
"num_layers": 4,
"num_heads": 12,
"pos_embed": pos_embed,
"proj_type": proj_type,
"dropout_rate": 0.6,
"spatial_dims": nd,
},
Expand All @@ -54,7 +54,7 @@
"mlp_dim": 3072,
"num_layers": 4,
"num_heads": 12,
"pos_embed": "conv",
"proj_type": "conv",
"dropout_rate": 0.6,
"spatial_dims": 3,
},
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_shape(self, input_param, input_shape, expected_shape):
]
)
def test_ill_arg(
self, in_channels, img_size, patch_size, hidden_size, mlp_dim, num_layers, num_heads, pos_embed, dropout_rate
self, in_channels, img_size, patch_size, hidden_size, mlp_dim, num_layers, num_heads, proj_type, dropout_rate
):
with self.assertRaises(ValueError):
ViTAutoEnc(
Expand All @@ -104,7 +104,7 @@ def test_ill_arg(
mlp_dim=mlp_dim,
num_layers=num_layers,
num_heads=num_heads,
pos_embed=pos_embed,
proj_type=proj_type,
dropout_rate=dropout_rate,
)

Expand Down

0 comments on commit 61ef0da

Please sign in to comment.