Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update segmentation.py #72

Merged
merged 3 commits into from
Apr 9, 2024
Merged
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
7 changes: 5 additions & 2 deletions ultrack/imgproc/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ def inverted_edt(
class Cellpose:
def __init__(self, **kwargs) -> None:
"""See cellpose.models.Cellpose documentation for details."""
from cellpose.models import Cellpose as _Cellpose
from cellpose.models import CellposeModel as _Cellpose

if "pretrained_model" not in kwargs and "model_type" not in kwargs:
kwargs["model_type"] = "cyto"

self.model = _Cellpose(**kwargs)

Expand All @@ -223,5 +226,5 @@ def __call__(self, image: ArrayLike, **kwargs) -> np.ndarray:
Predicts image labels.
See cellpose.models.Cellpose.eval documentation for details.
"""
labels, _, _, _ = self.model.eval(image, **kwargs)
labels, _, _ = self.model.eval(image, **kwargs)
return labels
Loading