Skip to main content

napari-segment-anything

License Apache Software License 2.0 PyPI Python Version tests codecov napari hub

Napari plugin of Segment Anything Model (SAM)

Download the network weights here

https://user-images.githubusercontent.com/21022743/230456433-2fa7bc40-a735-4d73-8d87-ecf776bbe2be.mp4


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

Installation

You can install napari-segment-anything via pip:

pip install napari-segment-anything

We recommend installing the latest development version because this package is being developed:

pip install git+https://github.com/jookuma/napari-segment-anything.git

IMPORTANT: napari won't work if you don't have pyqt5 or pyside2 installed.

Instructions

Opening napari-segment-anything

This software is napari plugin, so once you have napari installed you can open it using the command line:

napari <your image path> -w napari-segment-anything 'Segment Anything'

I noticed that sometimes napari fails to load the plugin widget from the command line, go to step 2 from below to load it.

If you prefer the user interface you need to:

  1. Drag and drop your image into napari to load it;
  2. Go to the "Plugins" file menu in the upper right corner and select the "Segment Anything" plugin.
  3. Follow the instructions below for usage.

IMPORTANT: If you get an error make sure you have pyqt5 or pyside2 installed.

Usage

  • Interactions are done on the "SAM points" and "SAM box" layers using the existing functionalities of napari. Only rectangle shapes trigger the network prediction.
  • For points supervision, left clicks are positive cues (object) and right clicks are negative (background).
  • Press the "Confirm Annot." button (or the "C" key) to propagate the current segmentation mask to the label image.
  • Use the napari labels layer features to delete or edit already confirmed labels.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the Apache Software License 2.0 license, "napari-segment-anything" is a free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Metadata

Release files for napari-segment-anything 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-segment-anything 0.1.4
File Size Uploaded Provenance
napari-segment-anything-0.1.4.tar.gz 13.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-segment-anything 0.1.4
File Interpreter ABI Platform
napari_segment_anything-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / napari-segment-anything-0.1.4.tar.gz

Download URL napari-segment-anything-0.1.4.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b45a479942b0e6aaf6f8a03b7f224aa185eec3e50bbb7d4ea9c4b14a31c1ef3f
BLAKE2b-256 checksum
How to use checksums
b2b288e750bfaa7d1fb599799c2515461071fd60258bc1d3a8c7c5ccbf20592e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / napari_segment_anything-0.1.4-py3-none-any.whl

Download URL napari_segment_anything-0.1.4-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9a068bd51072b8863a2f8f08fcbedee5c3d30a417b70cdadfc9f02d193fbd27
BLAKE2b-256 checksum
How to use checksums
33c7d4da60013206a9193b8b279e76fd9f8681f873f498269a3df2d9c629cc03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for napari-segment-anything 0.1.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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