https://github.com/vanvalenlab/cellSAM
Codebase for "A Foundation Model for Cell Segmentation"
https://github.com/vanvalenlab/cellSAM
Last synced: about 1 year ago
JSON representation
Codebase for "A Foundation Model for Cell Segmentation"
- Host: GitHub
- URL: https://github.com/vanvalenlab/cellSAM
- Owner: vanvalenlab
- License: other
- Created: 2024-02-14T22:41:18.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-02T00:22:49.000Z (over 1 year ago)
- Last Synced: 2025-04-07T15:06:19.751Z (over 1 year ago)
- Language: Python
- Size: 15.4 MB
- Stars: 75
- Watchers: 3
- Forks: 12
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-ai-for-science - cellSAM - Foundation model for universal cell segmentation achieving state-of-the-art performance across bacteria, tissue, yeast, cell culture, and diverse imaging modalities (brightfield, fluorescence, phase), with pip-installable inference and Napari plugin (vanvalenlab/Caltech, bioRxiv 2024) (🔬 Domain-Specific Applications / 🧬 Biology & Medicine)
- awesome-biological-image-analysis - CellSAM - A foundation model for cell segmentation trained on a diverse range of cells and data types. (Image processing and segmentation)
README
# CellSAM: A Foundation Model for Cell Segmentation
[
](https://cellsam.deepcell.org/)
## Description
This repository provides inference code for CellSAM. CellSAM is described in more detail in the [preprint](https://www.biorxiv.org/content/10.1101/2023.11.17.567630v3), and is publicly deployed at [cellsam.deepcell.org](https://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](mailto:ulisrael@caltech.edu) for support/questions! The full dataset used to train CellSAM is available [here](https://storage.googleapis.com/cellsam-data/dataset.tar.gz). This dataset contains cellpose data which is subject to the cellpose license [here](https://github.com/mouseland/cellpose?tab=BSD-3-Clause-1-ov-file). The cellpose data can also be downloaded from [here](https://www.cellpose.org/dataset).
## 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 `cellsam_introduction.ipynb`.
### Napari package
CellSAM includes a basic napari package for annotation functionality. To install the additional napari dependencies, use pip.
`pip install git+https://github.com/vanvalenlab/cellSAM.git#egg=cellsam[napari]`
To launch the napari app, run `cellsam napari`.
## 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},
}
```