Cellpose
a generalist algorithm for cellular segmentation with human-in-the-loop capabilities
Install / Use
/learn @MouseLand/CellposeREADME
<p> <b>Cellpose </b> </p>
<img src="http://www.cellpose.org/static/images/logo.png?raw=True" width="250" title="cellpose" alt="cellpose" align="right" vspace = "50">Cellpose-SAM: cell and nucleus segmentation with superhuman generalization. It can be optimized for your own data, applied in 3D, works on images with shot noise, (an)isotropic blur, undersampling, contrast inversions, regardless of channel order and object sizes.
To learn about Cellpose-SAM read the paper or watch the talk. For info on fine-tuning a model, watch this tutorial talk, and see this example video of human-in-the-loop training. For support, please open an issue.
Please see install instructions below, and also check out the detailed documentation at <font size="4">cellpose.readthedocs.io</font>. The Cellpose-SAM website allows batch processing of images with a free account on Hugging Face.
Example notebooks:
- run_Cellpose-SAM.ipynb
: run Cellpose-SAM on your own data, mounted in google drive
- test_Cellpose-SAM.ipynb
: shows running Cellpose-SAM using example data in 2D and 3D
- train_Cellpose-SAM.ipynb
: train Cellpose-SAM on your own labeled data (also optional example data provided)
:triangular_flag_on_post: The Cellpose-SAM model is trained on data that is licensed under CC-BY-NC. The Cellpose annotated dataset is also CC-BY-NC.
CITATION
If you use Cellpose-SAM, please cite the Cellpose-SAM paper: Pachitariu, M., Rariden, M., & Stringer, C. (2025). Cellpose-SAM: superhuman generalization for cellular segmentation. <em>bioRxiv</em>.
If you use Cellpose 1, 2 or 3, please cite the Cellpose 1.0 paper:
Stringer, C., Wang, T., Michaelos, M., & Pachitariu, M. (2021). Cellpose: a generalist algorithm for cellular segmentation. <em>Nature methods, 18</em>(1), 100-106.
If you use the human-in-the-loop training, please also cite the Cellpose 2.0 paper:
Pachitariu, M. & Stringer, C. (2022). Cellpose 2.0: how to train your own model. <em>Nature methods</em>, 1-8.
If you use the new image restoration models or cyto3, please also cite the Cellpose3 paper:
Stringer, C. & Pachitariu, M. (2025). Cellpose3: one-click image restoration for improved segmentation. <em>Nature Methods</em>.
Old updates
v3.1+ update (Feb 2025)
- support for big data contributed by @GFleishman, usage info here
- new options to improve 3D segmentation like
flow3D_smoothandpretrained_model_ortho, more info here - GPU-accelerated mask creation in 2D and 3D (benchmarks)
- better support for Mac Silicon chips (MPS), although new mask creation code not supported by Mac yet
:star2: v3 (Feb 2024) :star2:
Cellpose3 enables image restoration in the GUI, API and CLI (saved to _seg.npy). To learn more...
:star2: v2.0 (April 2022) :star2:
Cellpose 2.0 allows human-in-the-loop training of models! To learn more, check out the twitter thread, paper, review, short talk, and the tutorial talk which goes through running Cellpose 2.0 in the GUI and a jupyter notebook. Check out the full human-in-the-loop video. See how to use it yourself in the docs and also check out the help info in the Models menu in the GUI.
Installation
You can install cellpose using conda or with native python if you have python3.8+ on your machine.
Local installation (< 2 minutes)
System requirements
Linux, Windows and Mac OS are supported for running the code. For running the graphical interface you will need a Mac OS later than Yosemite. At least 8GB of RAM is required to run the software. 16GB-32GB may be required for larger images and 3D volumes. The software has been heavily tested on Windows 10 and Ubuntu 18.04 and less well-tested on Mac OS. Please open an issue if you have problems with installation.
Dependencies
cellpose relies on the following excellent packages (which are automatically installed with conda/pip if missing):
- pytorch
- pyqtgraph
- PyQt6 or PySide
- numpy (>=1.20.0)
- scipy
- natsort
- tifffile
- imagecodecs
- roifile
- fastremap
- fill_voids
Option 1: Installation Instructions with conda
If you have an older cellpose environment you can remove it with conda env remove -n cellpose before creating a new one.
If you are using a GPU, make sure its drivers and the cuda libraries are correctly installed.
- Install a miniforge distribution of Python. Note you might need to use an anaconda prompt if you did not add anaconda to the path.
- Open an anaconda prompt / command prompt which has
condafor python 3 in the path - Create a new environment with
conda create --name cellpose python=3.10. We recommend python 3.10, but python 3.9 and 3.11 will also work. - To activate this new environment, run
conda activate cellpose - (option 1) To install cellpose with the GUI, run
python -m pip install cellpose[gui]. If you're on a zsh server, you may need to use ' ':python -m pip install 'cellpose[gui]'. - (option 2) To install cellpose without the GUI, run
python -m pip install cellpose.
To upgrade cellpose
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
