Skip to main content

napari-cellposesam cellpose

Documentation Status tests PyPI version Python version License website

A napari plugin for cell segmentation with cellpose, including Cellpose-SAM (cellpose v4).

This is a fork of MouseLand/cellpose-napari, the original plugin by Carsen Stringer. It adds:

  • support for cellpose v4 and the Cellpose-SAM (cpsam) models, while still working with cellpose v3
  • z/channel axis selection for 3D and 4D images
  • compatibility with new napari versions

The cellpose code was written by Carsen Stringer and Marius Pachitariu. To learn about Cellpose, read the paper or watch this talk.

For problems with this plugin, open an issue. For problems with cellpose itself, open an issue on the cellpose repo.

If you use this plugin, please cite the cellpose paper, and the Cellpose-SAM paper if you use the cpsam models (see the cellpose repo for the reference):

@article{stringer2021cellpose,
  title={Cellpose: a generalist algorithm for cellular segmentation},
  author={Stringer, Carsen and Wang, Tim and Michaelos, Michalis and Pachitariu, Marius},
  journal={Nature Methods},
  volume={18},
  number={1},
  pages={100--106},
  year={2021},
  publisher={Nature Publishing Group}
}

napari-cellposesam segmenting the 2D sample image

Installation

Requires Python 3.11 or newer. We recommend a fresh environment, e.g. with conda:

conda create -n napari-cellposesam python=3.12
conda activate napari-cellposesam

Install napari and the plugin with pip:

pip install "napari[all]" napari-cellposesam

Or install the plugin from the napari plugin manager (Plugins > Install/Uninstall Plugins).

To install the latest development version from GitHub:

pip install git+https://github.com/jeskowagner/napari-cellposesam

If you have issues installing cellpose, see the cellpose installation docs.

Cellpose3 models

The plugin uses whichever cellpose version is installed. By default that is cellpose v4, which provides the Cellpose-SAM and CPDINO models. To use the Cellpose3 models (cyto3, nuclei, etc.), install cellpose v3 instead, in a separate environment:

conda create -n napari-cellpose3 python=3.12
conda activate napari-cellpose3
pip install "napari[all]" napari-cellposesam "cellpose<4"

An environment can only hold one cellpose version, so you cannot switch between v3 and v4 models from within the plugin.

Don't install cellpose-napari next to this plugin. It lists the Cellpose3 models, but with cellpose v4 installed it ignores the selected model and runs Cellpose-SAM, thus breaking it.

GPU

cellpose runs on CPU, NVIDIA GPUs (CUDA) and Apple silicon (MPS). For CUDA, install a CUDA build of torch following the PyTorch instructions before or after installing the plugin. The plugin uses the GPU automatically if torch can see one.

Optional: CPDINO models

The CPDINO models need DINOv3, which is not on PyPI and so is not installed automatically. The plugin offers to install it when you run segmentation with a CPDINO model, or install it yourself:

pip install git+https://github.com/facebookresearch/dinov3

Without it, cellpose logs a Could not import CPDINO warning on startup. This is harmless if you don't use those models.

Upgrading

pip install --upgrade napari-cellposesam cellpose

In a cellpose v3 environment, use "cellpose<4" instead of cellpose, or the upgrade moves you to v4.

Usage

Open napari with the plugin docked:

napari -w napari-cellposesam

Sample data is available under File > Open Sample > napari-cellposesam.

Detailed usage is described in the documentation.

Contributing

Contributions are welcome. For development, clone the repo and install it in editable mode with the test dependencies:

pip install -e ".[testing]"
pytest

License

Distributed under the terms of the BSD-3 license, "napari-cellposesam" is free and open source software.

Dependencies

napari-cellposesam relies on:

Metadata

Release files for napari-cellposesam 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-cellposesam 0.1.2
File Size Uploaded Provenance Actions
napari_cellposesam-0.1.2.tar.gz 330.5 kB With provenance Details for napari_cellposesam-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for napari-cellposesam 0.1.2
File Interpreter ABI Platform Actions
napari_cellposesam-0.1.2-py3-none-any.whl Python 3 none any Details for napari_cellposesam-0.1.2-py3-none-any.whl

Total release size: 343.9 kB

Release files / napari_cellposesam-0.1.2.tar.gz

Download URL napari_cellposesam-0.1.2.tar.gz
Size 330.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0c3875da9571d2332ef09ec330e4ccf3b20767ba33d5e099d7ef547b1a1b8e40
BLAKE2b-256 checksum
How to use checksums
e0ca67c6e0f18ae6e8ea9b047bd7663a521ee17713ddf0e8b376dce2ba5dabe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / napari_cellposesam-0.1.2-py3-none-any.whl

Download URL napari_cellposesam-0.1.2-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20704b683f3d38ed53fe2d938c851217cfe4ffcf5b05e5727593d2a50e57fc01
BLAKE2b-256 checksum
How to use checksums
f19f45ada3afc496c538a048f62cfda1e1fe354153769a0b49fd8913a72ef53e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for napari-cellposesam 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for napari_cellposesam-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page