Segment Anything for Microscopy 2
Tools for segmentation, tracking and classification in microscopy built on Segment Anything 2 (SAM2). Segment, track and classify objects in microscopy images interactively with a few clicks, or automatically.
We implement a napari plugin for:
- interactive and automatic segmentation of 2d images and 3d volumes
- interactive and automatic tracking of cells in 2d timeseries
- classification of segmented objects, for example into cell types
- pixel classification, for example for tissue or region segmentation
- batch annotation of all images in a folder with any of these tools
This functionality is powered by the micro-sam2 models, which are trained on microscopy data, and the micro_sam python library which enables application to large datasets and finetuning on your data.
The functionality of the previous version, based on the original Segment Anything (SAM1), is still available in the micro_sam.v1 subpackage and in the micro_sam v1 command line tools.
Interactive Cell Segmentation in 2D |
Interactive Mitochondria Segmentation in volumeEM |
Automatic Cell Segmentation in 3D |
Interactive Cell Tracking in 2D+T |
Pixel Classification in Histopathology |
Object Classification with Corrections |
Batch Nucleus Classification in Histopathology |
If you run into any problems or have questions about our tool, please open an issue on GitHub or contact us via image.sc using the tag micro-sam, and tagging @anwai98 and @constantinpape.
You can follow recent updates on micro_sam in our news feed.
Installation and Usage
Please check the documentation for details on how to install and use micro_sam. You can also watch the quickstart video, our virtual I2K workshop video or all video tutorials. The videos show the previous version, so the user interface differs from the current one.
micro_sam works best on a computer with a GPU. It can be used on a normal laptop with a CPU, but will be slow for applications in 3D or for large images.
Note: we are working on improving performance on Macbook with an M-series chip;
it will be much faster there soon!
Contributing
We always welcome new contributions!
If you just want to suggest a documentation edit, you can do this directly here, on GitHub. For more complex changes, see CONTRIBUTING.md or the contributing guide in our documentation for details. The first step is to discuss your idea in a new issue with the current developers.
Everyone participating in this project is expected to follow our Code of Conduct.
Citation
If you use this repository in your research, please cite
- our μSAM2 preprint (if you use μSAM2)
- our μSAM publication (μSAM1)
- If you use automatic tracking, please also cite Trackastra.
Other publications relevant for specific aspects:
- The SAM and SAM2 publications that describe the models we buid on for μSAM1 / μSAM2.
- Our publication on the Automatic Prompt Generation (APG) segmentation mode.
- Our publication on interactive object and pixel classification: μClass
- Our previous special-purpose models for histopathology and medical imaging.
Related Projects
There is one other napari plugin built around Segment Anything 2:
- https://github.com/royerlab/napari-segment-anything-2 (2d and video support)
Compared to this plugin we support more applications (2d, 3d, tracking and classification), and provide finetuning methods and finetuned models for microscopy data. WebKnossos, QuPath and Fiji also integrate Segment Anything 2 for interactive segmentation, mainly in 2d.
Release Overview
You can find an overview of changes introduced in previous releases here.
Metadata
Release files for micro-sam 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| micro_sam-2.0.1.tar.gz | 734.4 kB | With provenance | Details for micro_sam-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| micro_sam-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for micro_sam-2.0.1-py3-none-any.whl |
Total release size: 1.4 MB
Release files / micro_sam-2.0.1.tar.gz
| Download URL | micro_sam-2.0.1.tar.gz |
|---|---|
| Size | 734.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d521a878b28b73df2cc4df5a59be870fb8d5c9260fb170e89dfd7b70fd21accf
|
|
BLAKE2b-256 checksum How to use checksums |
52eb6477a18a73f99623ee933ddc79a26b42425fe408736e9835f82b240a0caf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 19, 2026.
Transparency logRelease files / micro_sam-2.0.1-py3-none-any.whl
| Download URL | micro_sam-2.0.1-py3-none-any.whl |
|---|---|
| Size | 675.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
106f928d572032690b4b9dbeae95878633e0db5c3a2fc0d95afb6474969bbcf4
|
|
BLAKE2b-256 checksum How to use checksums |
54dcab66a0672db7a0c7a408ffd12bc1a41885fac67d6b5889fd00c8776d3c6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 19, 2026.
Transparency logSecurity for micro-sam 2.0.1
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.
Attestation for micro_sam-2.0.1.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 Nov 19, 2026.
Transparency logA 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.