Cellpose
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 cellpose.readthedocs.io. The Cellpose-SAM website allows batch processing of images with a free account on Hugging Face.
Example notebooks:
:star2: v4.2+ update (June 2026) :star2:
New Cellpose4 models added! We have included new Cellpose models based on DINOv3, cpdino and cpdino-vitb.
We have also updated the CellposeSAM model (cpsam_v2), and it now predicts fewer spurious masks in low-contrast regions.
To use the new models, pip install cellpose --upgrade and pip install git+https://github.com/facebookresearch/dinov3, and find more details here.
:triangular_flag_on_post: All Cellpose models are 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. bioRxiv.
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. Nature methods, 18(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. Nature methods, 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. Nature Methods.
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_smooth and pretrained_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...
- Check out the paper
- Tutorial talk about the algorithm and how to use it
- API documentation here
: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):
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
conda for python 3 in the path
- Create a new environment with
conda create --name cellpose python=3.12. We recommend python 3.12, 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.
- Install the DINOv3 package to use the CellposeDINO models with
python -m pip install git+https://github.com/facebookresearch/dinov3.
To upgrade cellpose (package here), run the following in the environment:
python -m pip install cellpose --upgrade
Note you will always have to run conda activate cellpose before you run cellpose. If you want to run jupyter notebooks in this environment, then also python -m pip install notebook and python -m pip install matplotlib.
You can also try to install cellpose and the GUI dependencies from your base environment using the command
python -m pip install cellpose[gui]
If you have issues with installation, see the docs for more details. You can also use the cellpose environment file included in the repository and create a cellpose environment with conda env create -f environment.yml which may solve certain dependency issues.
If these suggestions fail, open an issue.
Option 2: Installation Instructions with python's venv
Venv (tutorial, for those interested) is a built-in tool in python for creating virtual environments. It is a good alternative if you don't want to install conda and already have python3 on your machine. The main difference is that you will need to choose where to install the environment and the packages. Cellpose will then live in this environment and not be accessible from other environments. You will need to navigate to the environment directory and activate it each time before running cellpose. The steps are similar to the conda installation:
If you are using a GPU, make sure its drivers and the cuda libraries are correctly installed.
- Install python3.8 or later from python.org. This will be the version of python that will be used in the environment. You can check your python version with
python --version.
- Navigate to the directory where you want to create the environment and run
python3 -m venv cellpose to create a new environment called cellpose.
- Activate the environment with
source cellpose/bin/activate on Mac/Linux or cellpose\Scripts\activate on Windows. A prefix (cellpose) should appear in the terminal.
- Install cellpose into the
cellpose venv using pip with python -m pip install cellpose.
- Install the cellpose GUI, with
python -m pip install cellpose[gui]. Depending on your terminal software, you may need to use quotes like this: python -m pip install 'cellpose[gui]'.
- You can now run cellpose from this environment with
python -m cellpose or cellpose if you are in the cellpose directory.
- To deactivate the environment, run
deactivate.
GPU version (CUDA) on Windows or Linux
If you plan on running many images, you may want to install a GPU version of torch. To use your NVIDIA GPU with python, you will need to make sure the NVIDIA driver for your GPU is installed, check out this website to download it. You can also install the CUDA toolkit, or use the pytorch cudatoolkit (installed below with conda). If you have trouble with the below install, we recommend installing the CUDA toolkit yourself, choosing one of the 11.x releases here.
With the latest versions of pytorch on Linux, as long as the NVIDIA drivers are installed, the GPU version is installed by default with pip. You can check if the GPU support is working by opening the GUI. If the GPU is working then the GPU box will be checked and the CUDA version will be displayed in the command line.
If it's not working, we will need to remove the CPU version of torch:
pip uninstall torch