Sovereign 8s.is mirror of standardgalactic/cellSAM
  • Python 93.7%
  • Shell 6.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ross Barnowski 35bc6e0da6
DOC: Add EM image to example gallery. (#100)
Image courtesy Mark Ladinsky / the Newman Lab at Caltech.
2025-11-11 11:47:56 -08:00
.circleci CI: Add a scheduled workflow (#96) 2025-09-23 14:44:51 -07:00
.github/workflows CI: Setup circleci for doc build/preview/deploy (#67) 2025-05-17 09:41:40 -07:00
cellSAM Replace deprecated resource_filename. (#99) 2025-10-10 14:29:07 -07:00
docs Add H&E example to gallery (#97) 2025-10-02 14:41:27 -07:00
examples DOC: Add EM image to example gallery. (#100) 2025-11-11 11:47:56 -08:00
paper_evaluation Update paper_evaluation README after docs update. 2025-09-12 15:20:59 -07:00
sample_imgs add predicted masks 2024-06-05 14:50:21 -07:00
.gitignore Evaluation code for reproducing paper results (#84) 2025-09-04 11:46:24 -07:00
LICENSE.md update w inference code 2024-03-26 16:35:48 -07:00
pyproject.toml Re-work model/data handling for new model/data + versioning scheme. 2025-09-12 15:20:59 -07:00
README.md Update README to reflect v1.2 data/model release. (#91) 2025-09-18 12:14:45 -07:00
requirements.txt Add H&E example to gallery (#97) 2025-10-02 14:41:27 -07:00

CellSAM: A Foundation Model for Cell Segmentation

NOTE Be sure to update to the latest version of the model

Description

This repository provides inference code for CellSAM. CellSAM is described in more detail in the preprint, and is publicly deployed at cellsam.deepcell.org. CellSAM achieves state-of-the-art performance on segmentation across a variety of cellular targets (bacteria, tissue, yeast, cell culture, etc.) and imaging modalities (brightfield, fluorescence, phase, etc.). Feel free to reach out for support/questions! The full dataset used to evaluate CellSAM is available via https://users.deepcell.org. This dataset contains cellpose data which is subject to the cellpose license here. The cellpose data can also be downloaded from here.

Getting started

The easiest way to get started with CellSAM is with pip pip install git+https://github.com/vanvalenlab/cellSAM.git

CellSAM requires python>=3.10, but otherwise uses pure PyTorch. A sample image is included in this repository. Segmentation can be performed as follows

import numpy as np
from cellSAM import segment_cellular_image
img = np.load("sample_imgs/yeaz.npy")
mask, _, _ = segment_cellular_image(img, device='cuda')

For more details, see the tutorial

Napari package

CellSAM includes a basic napari package for annotation functionality. To install the additional napari dependencies, use pip.

pip install "cellSAM[napari] @ git+https://github.com/vanvalenlab/cellSAM@master"

To launch the napari app, run cellsam napari. For further details, check out the napari plugin docs

Citation

Please cite us if you use CellSAM.

@article{israel2023foundation,
  title={A Foundation Model for Cell Segmentation},
  author={Israel, Uriah and Marks, Markus and Dilip, Rohit and Li, Qilin and Schwartz, Morgan and Pradhan, Elora and Pao, Edward and Li, Shenyi and Pearson-Goulart, Alexander and Perona, Pietro and others},
  journal={bioRxiv},
  publisher={Cold Spring Harbor Laboratory Preprints},
  doi = {10.1101/2023.11.17.567630},
}