Skip to content

Commit

Permalink
Merge pull request #22 from TheJacksonLaboratory/dev
Browse files Browse the repository at this point in the history
Removed limitation on cellpose version
  • Loading branch information
fercer authored Nov 20, 2024
2 parents a2e6b98 + e825397 commit bbb9764
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies = [

[project.optional-dependencies]
cellpose = [
"cellpose>=3.0.0,<=3.0.10"
"cellpose>=3.0.0"
]
testing = [
"tox",
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
tensorstore==0.1.59
ome-zarr==0.9.0
cellpose-napari==0.1.5
magicgui==0.8.3
qtpy==2.4.1
scikit-image==0.24.0
Expand Down
8 changes: 6 additions & 2 deletions src/napari_activelearning/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ def _run_pred(self, img, *args, **kwargs):
x = self._transform(img)

with torch.no_grad():
y, _ = core.run_net(self._model_dropout.net, x)
logits = torch.from_numpy(y[:, :, 2])
try:
y, _ = core.run_net(self._model_dropout.net, x)
logits = torch.from_numpy(y[:, :, 2])
except ValueError:
y, _ = core.run_net(self._model_dropout.net, x[None, ...])
logits = torch.from_numpy(y[0, :, :, 2])
probs = logits.sigmoid().numpy()

return probs
Expand Down

0 comments on commit bbb9764

Please sign in to comment.