Skip to content

Commit

Permalink
Merge pull request #5 from janelia-cellmap/latest
Browse files Browse the repository at this point in the history
Add cellpose[gui] as a main dependency
  • Loading branch information
rhoadesScholar authored Mar 18, 2024
2 parents 95b791f + 9839555 commit 05d3a38
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
name: Upload Python Package

on:
release:
types: [published]
push:
branches: [ "main" ]

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<script type="module" src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@1/src/zero-md.min.js"></script>

<!-- Simply set the `src` attribute to your MD file and win -->
<zero-md src="../README.md"></zero-md>
<zero-md src="https://raw.githubusercontent.com/janelia-cellmap/cellmap-models/main/README.md"></zero-md>
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ license = { text = "BSD 3-Clause License" }
authors = [
{ email = "[email protected]", name = "Jeff Rhoades" },
]
version = "0.0.0"
version = "0.0.1"
dependencies = [
'torch',
'torchvision',
'numpy',
"tqdm",
'tqdm',
'cellpose'
]

[project.optional-dependencies]
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/cellmap_models/pytorch/cosem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
4 changes: 2 additions & 2 deletions src/cellmap_models/pytorch/cosem/load_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
"""
Expand Down

0 comments on commit 05d3a38

Please sign in to comment.