Skip to main content

Napari plugin of Segment Anything Model (SAM)

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari-segment-anything-0.1.3.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

napari_segment_anything-0.1.3-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file napari-segment-anything-0.1.3.tar.gz.

File metadata

File hashes

Hashes for napari-segment-anything-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0f396c53eb05c68e116120b7714846614d75b834661239c36146f13b620d1ff8
MD5 0d652f3434b21d74c7fed41686148216
BLAKE2b-256 e816f4a87395ab6c4d4f3d4188313a7b46851aef07f6d84a878fbd2903800de1

See more details on using hashes here.

File details

Details for the file napari_segment_anything-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_segment_anything-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1f3930f1b784f7f711023ccc6336d150ad0b051f8ff6438c6645b1ac73d895b3
MD5 5fdefea20eff0c37b3d02c763ca6a882
BLAKE2b-256 9d866d8e9b9d840a55cb4d1ef7b6d8f22a9ed8a1e7870bd4b4b9a4e77b7a4561

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page