{"name":"napari-SAM4IS","display_name":"napari-SAM4IS","visibility":"public","icon":"","categories":[],"schema_version":"0.2.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-SAM4IS.make_sam_widget","title":"Make SAM Widget","python_name":"napari_sam4is._widget:SAMWidget","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"napari-SAM4IS.make_sam_widget","display_name":"SAM Widget","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"napari-SAM4IS","version":"0.0.5","dynamic":null,"platform":null,"supported_platform":null,"summary":"Create annotations for instance segmentation using Segment Anything models","description":"# napari-SAM4IS\n\n[![License Apache Software License 2.0](https://img.shields.io/pypi/l/napari-SAM4IS.svg?color=green)](https://github.com/hiroalchem/napari-SAM4IS/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-SAM4IS.svg?color=green)](https://pypi.org/project/napari-SAM4IS)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-SAM4IS.svg?color=green)](https://python.org)\n[![tests](https://github.com/hiroalchem/napari-SAM4IS/workflows/tests/badge.svg)](https://github.com/hiroalchem/napari-SAM4IS/actions)\n[![codecov](https://codecov.io/gh/hiroalchem/napari-SAM4IS/branch/main/graph/badge.svg)](https://codecov.io/gh/hiroalchem/napari-SAM4IS)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-SAM4IS)](https://napari-hub.org/plugins/napari-SAM4IS)\n\n\n### napari plugin for instance and semantic segmentation annotation using Segment Anything Model (SAM)\n\nThis is a plugin for [napari](https://napari.org/), a multi-dimensional image viewer for Python, that allows for instance and semantic segmentation annotation. This plugin provides an easy-to-use interface for annotating images with the option to output annotations as COCO format.\n\n----------------------------------\n\nThis [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.\n\n\n\n## Installation\n\nTo use this plugin, you'll need to install the [napari](https://napari.org/stable/tutorials/fundamentals/installation.html) multi-dimensional image viewer and the [Segment Anything Model (SAM)](https://github.com/facebookresearch/segment-anything) library.\n\n### napari Installation\n\nYou can install napari using pip:\n\n```\npip install \"napari[all]\"\n```\n\nAlternatively, you can install napari and all of its dependencies with conda:\n\n```\nconda install -c conda-forge napari\n```\n\nFor more detailed instructions, please refer to the [napari installation guide](https://napari.org/stable/tutorials/fundamentals/installation.html).\n\n### SAM Installation\n\nYou can install SAM from the [official GitHub repository](https://github.com/facebookresearch/segment-anything) using pip:\n\n```\npip install git+https://github.com/facebookresearch/segment-anything.git\n```\n\nOr you can install from source by cloning the repository:\n\n```\ngit clone https://github.com/facebookresearch/segment-anything.git\ncd segment-anything\npip install -e .\n```\n\nFor more detailed instructions, please refer to the [SAM installation guide](https://github.com/facebookresearch/segment-anything#installation).\n\n### napari-SAM4IS Installation\n\nYou can install `napari-SAM4IS` via [pip]:\n\n pip install napari-SAM4IS\n\n\n\nTo install latest development version :\n\n pip install git+https://github.com/hiroalchem/napari-SAM4IS.git\n\n## Usage\n### Preparation\n1. Open an image in napari and launch the plugin. (Opening an image after launching the plugin is also possible.)\n2. Upon launching the plugin, three layers will be automatically created: SAM-Box, SAM-Predict, and Accepted. The usage of these layers will be explained later.\n3. In the widget that appears, select the model you want to use and click the load button. (The default option is recommended.)\n4. Next, select the image layer you want to annotate.\n5. Then, select whether you want to do instance segmentation or semantic segmentation. (Note that for 3D images, semantic segmentation should be chosen in the current version.)\n6. Finally, select the output layer as \"shapes\" for instance segmentation or \"labels\" for semantic segmentation. (For instance segmentation, the \"Accept\" layer can also be used.)\n\n### Annotation\n1. Select the SAM-Box layer and use the rectangle tool to enclose the object you want to segment.\n2. An automatic segmentation mask will be created and output to the SAM-Predict layer.\n3. If you want to make adjustments, do so in the SAM-Predict layer.\n4. To accept or reject the annotation, press \"a\" or \"r\" on the keyboard, respectively.\n5. If you accept the annotation, it will be output as label 1 for semantic segmentation or converted to a polygon and output to the designated layer for instance segmentation.\n6. If you reject the annotation, the segmentation mask in the SAM-Predict layer will be discarded.\n7. After accepting or rejecting the annotation, the SAM-Predict layer will automatically reset to blank and return to the SAM-Box layer.\n\n### Saving\n1. If you have output to the labels layer, use napari's standard functionality to save the mask.\n2. If you have output to the shapes layer, you can save the shapes layer using napari's standard functionality, or you can click the \"save\" button to output a JSON file in COCO format for each image in the folder. (The JSON file will have the same name as the image.)\n\n\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox], please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [Apache Software License 2.0] license,\n\"napari-SAM4IS\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n[napari]: https://github.com/napari/napari\n[Cookiecutter]: https://github.com/audreyr/cookiecutter\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin\n\n[file an issue]: https://github.com/hiroalchem/napari-SAM4IS/issues\n\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n","description_content_type":"text/markdown","keywords":null,"home_page":"https://github.com/hiroalchem/napari-SAM4IS","download_url":null,"author":"Hiroki Kawai","author_email":"h.kawai888@gmail.com","maintainer":null,"maintainer_email":null,"license":"Apache-2.0","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: Apache Software License","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.8","Programming Language :: Python :: 3.9","Programming Language :: Python :: 3.10","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["numpy","magicgui","qtpy","torch","torchvision","scikit-image","tox ; extra == 'testing'","pytest ; extra == 'testing'","pytest-cov ; extra == 'testing'","pytest-qt ; extra == 'testing'","napari ; extra == 'testing'","pyqt5 ; extra == 'testing'"],"requires_python":">=3.8","requires_external":null,"project_url":["Bug Tracker, https://github.com/hiroalchem/napari-SAM4IS/issues","Documentation, https://github.com/hiroalchem/napari-SAM4IS#README.md","Source Code, https://github.com/hiroalchem/napari-SAM4IS","User Support, https://github.com/hiroalchem/napari-SAM4IS/issues"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}