Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cellSAM/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def download_training_data(version=None):
- 1.2 (latest)
- 1.0
"""
from . import _auth
from deepcell_auth import _auth

manifest = _auth.load_manifest()

version = "1.2" if version is None else version
record = _auth._data_versions[version]
record = manifest["datasets"]["cellsam"][version]

_auth.fetch_data(
record["asset_key"], cache_subdir="datasets", file_hash=record["asset_hash"]
Expand Down
195 changes: 0 additions & 195 deletions cellSAM/_auth.py

This file was deleted.

10 changes: 6 additions & 4 deletions cellSAM/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
fill_holes_and_remove_small_masks,
subtract_boundaries,
)
from . import _auth
from deepcell_auth import _auth


__all__ = ["segment_cellular_image"]
Expand Down Expand Up @@ -76,13 +76,15 @@ def get_model(model="cellsam_general", version=None) -> nn.Module:
the latest released version will be used.

"""
model_version_dict = _auth.load_manifest()["models"]["cellsam"]

version = "1.2" if version is None else version
if version not in _auth._model_versions:
if version not in model_version_dict:
raise ValueError(
f"Model version {version} not recognized, must be one of:\n"
f"{list(_auth._model_versions)}"
f"{list(model_version_dict)}"
)
record = _auth._model_versions[version]
record = model_version_dict[version]
archive_name = record["asset_key"].split("/")[-1]

cellsam_assets_dir = Path.home() / f".deepcell/models"
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ dependencies = [
'torchvision',
'kornia',
# Model access
'requests',
'tqdm',
'deepcell_auth@git+https://github.com/vanvalenlab/deepcell-auth.git',
# Whole-slide imaging
'dask[distributed]',
'dask-image',
Expand Down