diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index a04c287..191de5c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -9,8 +9,8 @@ name: Upload Python Package on: - release: - types: [published] + push: + branches: [ "main" ] permissions: contents: read diff --git a/docs/index.html b/docs/index.html index 6eec80e..c1fdbe5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,4 +5,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e2586d2..ce2d27e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,12 +15,13 @@ license = { text = "BSD 3-Clause License" } authors = [ { email = "rhoadesj@hhmi.org", name = "Jeff Rhoades" }, ] -version = "0.0.0" +version = "0.0.1" dependencies = [ 'torch', 'torchvision', 'numpy', - "tqdm", + 'tqdm', + 'cellpose' ] [project.optional-dependencies] @@ -32,8 +33,9 @@ dev = [ 'mypy', 'pdoc', 'pre-commit', - 'cellpose[gui]' ] +pretrained = ['cellpose[gui]'] +all = ["cellmap-models[dev,pretrained]"] [project.urls] homepage = "https://janelia-cellmap.github.io/cellmap-models" diff --git a/src/cellmap_models/pytorch/cosem/README.md b/src/cellmap_models/pytorch/cosem/README.md index 8ff020b..ef9c8e3 100755 --- a/src/cellmap_models/pytorch/cosem/README.md +++ b/src/cellmap_models/pytorch/cosem/README.md @@ -20,12 +20,12 @@ Available models can be seen with the following code: cosem_models.models_list ``` -Each model has a separate unet backbone and single layer prediction head. The `unet` and `head` objects are both PyTorch modules and can be used as such. You can access the separate components of the model using the following code: +Each model has a separate backbone and single layer prediction head. The `backbone` and `head` objects are both PyTorch modules and can be used as such. You can access the separate components of the model using the following code: ```python import cellmap_models.cosem as cosem_models model = cosem_models.load_model('setup04/1820500') -unet = model.unet +backnone = model.backbone head = model.prediction_head ``` diff --git a/src/cellmap_models/pytorch/cosem/load_model.py b/src/cellmap_models/pytorch/cosem/load_model.py index 6be1fe9..5d0c8b6 100755 --- a/src/cellmap_models/pytorch/cosem/load_model.py +++ b/src/cellmap_models/pytorch/cosem/load_model.py @@ -127,7 +127,7 @@ def __init__(self, model_params): kernel_size=(1,) * 3, ) model = torch.nn.Sequential(*layers) - self.unet = model + self.backbone = model self.prediction_head = prediction_head for k, v in model_params.__dict__.items(): setattr(self, k, v) @@ -136,7 +136,7 @@ def __init__(self, model_params): self.compute_minimal_shapes() def forward(self, x): - return self.prediction_head(self.unet(x)) + return self.prediction_head(self.backbone(x)) def compute_minimal_shapes(self): """