Skip to main content

DOC PyPI Conda codecov Image.sc forum DOI

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

Other publications relevant for specific aspects:

There is one other napari plugin built around Segment Anything 2:

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)

Source distribution for micro-sam 2.0.1
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)

Table of built distributions (wheels) for micro-sam 2.0.1
File Interpreter ABI Platform Actions
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 log

Release 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 log

Security 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.

Select from 2 files

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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page