Skip to main content

一个基于 SAM2 和 Tkinter 的交互式图像分割与标注工具。

Project description

SAM2 交互式图像标注工具

PyPI version Python versions License

一个基于 Meta 的 Segment Anything Model 2 (SAM2) 和 Tkinter 构建的图形化、交互式图像分割与标注工具。它旨在提供一个简单易用、开箱即用的方式,利用强大的AI模型来辅助进行高精度的图像标注工作。

(注意:上面的徽章在你将包成功发布到 PyPI 后才会生效。请将 interactive-sam2-annotator 替换为你在 pyproject.toml 中设定的最终包名)

软件截图

(强烈建议您将下方占位符替换为一张或多张实际的软件运行截图,这能极大地帮助用户理解工具的功能)

软件运行截图

主要功能

  • ✨ 智能分割: 集成强大的 SAM2 模型,通过点击正/负点进行高质量的掩码预测,极大提升标注效率。
  • ✏️ 手动微调: 支持手动绘制多边形进行精确标注,或对AI生成的掩码进行补充和修正。
  • 📝 标签编辑: 方便地对已完成的标注区域进行标签修改、删除和管理。
  • 🖱️ 多模式操作: 在 "SAM标注"、"多边形" 和 "编辑标签" 模式间自由切换,应对不同标注场景。
  • 🖼️ 便捷的视图控制: 支持图像的无级缩放与平移,轻松处理高分辨率大图。
  • 💾 会话管理: 自动保存和加载上一次的标注会话,方便随时中断和继续工作。
  • 📄 格式兼容: 以与 LabelMe 兼容的 JSON 格式保存标注结果,便于下游任务处理。
  • 🚀 自动下载: 首次运行时自动从网络下载所需的模型权重,无需手动配置。

安装

安装过程分为两个必要步骤。请务必按顺序执行。

⚠️ 步骤 1: 安装前提依赖 segment-anything-2

本工具依赖于 Meta 官方的 segment-anything-2 库,它需要从其 GitHub 仓库直接安装。请打开你的终端(命令行/CMD/PowerShell)并运行以下命令:

pip install git+[https://github.com/facebookresearch/segment-anything-2.git](https://github.com/facebookresearch/segment-anything-2.git)

步骤 2: 安装本工具

完成上一步后,你可以通过 PyPI 直接安装本工具:

pip install interactive-sam2-annotator

(请将 interactive-sam2-annotator 替换为你在 PyPI 上发布的实际包名)

注意:在首次启动本工具时,程序会自动从网络下载所需的 SAM2 模型权重文件(大小可能为几GB),此过程可能需要一些时间,具体取决于你的网络状况。下载完成后,模型将被缓存,未来启动时将不再需要下载。

快速开始

安装完成后,你的系统中就有了一个新的命令行指令。直接在终端中运行它即可启动程序:

sam2-annotator

(同样,请将 sam2-annotator 替换为你在 pyproject.toml 中定义的 [project.scripts] 命令名)

程序启动后,会显示图形界面。你可以通过点击 "加载图像" 按钮来选择一个包含多张图片的文件夹,然后开始你的标注工作。

许可证

本项目采用 MIT 许可证。详情请见 LICENSE 文件。

致谢

本项目的开发离不开以下这些优秀的项目和社区:


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

eebd_gesam2-0.1.2.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eebd_gesam2-0.1.2-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file eebd_gesam2-0.1.2.tar.gz.

File metadata

  • Download URL: eebd_gesam2-0.1.2.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for eebd_gesam2-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3647fc4ec04380002d771c20b953828e1fdc4f3d732f3cac122249fb906eba53
MD5 5180d356b701764b13b0a316db0bee4e
BLAKE2b-256 cbf1ebbb43c4b4dd6cb432e67b8fc529660d47b5af589cac419b64adfa5a9238

See more details on using hashes here.

File details

Details for the file eebd_gesam2-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: eebd_gesam2-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for eebd_gesam2-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7d94bd4c21733a772d5e7448b0099bafeb8b32f2f0451c971a2d74ff94037767
MD5 8f118bcbdea14f7f9c9f13066220d6db
BLAKE2b-256 f077fa73eee67f4f5d1cb98d8dad2f1d4d302a0672a66bae9b1532bc284905c5

See more details on using hashes here.

Supported by

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