• Stars
    star
    1,181
  • Rank 39,337 (Top 0.8 %)
  • Language
    Python
  • License
    Other
  • Created over 1 year ago
  • Updated 13 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Labeling tool with SAM(segment anything model),supports SAM, SAM2, sam-hq, MobileSAM EdgeSAM etc.交互式半自动图像标注工具

ISAT with segment anything

交互式半自动图像分割标注工具

标注.gif

如果这个项目给您的工作生活带来了便捷,请给一个Star;如果想对该项目贡献代码,请发Pull requests

[中文] [English]

集成segment anything,实现图片分割快速标注。

演示视频:bilibili

Demo Video:youtube

特点

  • 支持基于SAM的交互式半自动标注
  • 支持手动标注多边形。
  • 支持标注二次修改
  • 支持重叠目标调整遮挡关系。
  • 支持标注结果预览
  • 更多功能详见功能说明

安装

1. 源码运行

(1) 创建虚拟环境

conda create -n ISAT_with_segment_anything python==3.8
conda activate ISAT_with_segment_anything

(2) 安装ISAT_with_segment_anything

git clone https://github.com/yatengLG/ISAT_with_segment_anything.git
cd ISAT_with_segment_anything
pip install -r requirements.txt

(3) 下载Segment anything预训练模型

下载预训练模型,并将模型存放于ISAT_with_segment_anything/segment_any目录下

当前支持的模型有SAM系列,sam-hq系列,MobileSAM系列。

系列 预训练模型 显存占用 文件大小
SAM sam_vit_h_4b8939.pth 7305M 2.6G
sam_vit_l_0b3195.pth 5855M 2.6G
sam_vit_b_01ec64.pth 4149M 375M
sam-hq sam_hq_vit_h.pth 7393M 2.6G
sam_hq_vit_l.pth 5939M 1.3G
sam_hq_vit_b.pth 4207M 379M
sam_hq_vit_tiny.pth 1463M 43M
mobile-sam mobile_sam.pt 1375M 40M

下载好模型后,通过SAM-下拉列表,选择要用的模型。(切换模型需要一定时间,切换h模型大概需要5秒左右,视硬件情况而定。)

(4) 运行软件

python main.py

2. windows下exe运行

(1) 下载打包好的exe文件

下载地址后续放出

(2) 下载Segment anything预训练模型

同上下载预训练模型

使用

软件具体功能可查看:功能说明

1.标注

1. 软件左侧选择类别(工具栏-文件-设置中,进行类别添加或修改)
2. 开始标注
    2.1 半自动标注
        点击工具栏[Segment anything]开始半自动标注(快捷键Q)
        通过鼠标左键(或右键)提示感兴趣区域(或不感兴趣区域),调整目标分割掩码。
    2.2 手动标注
        点击工具栏[绘制多边形]开始手动标注(快捷键C)
        通过鼠标左键添加多边形顶点,框取目标。
    2.3 退上一个状态
        工具栏点击工具栏[回退]按钮(快捷键Z),回退到标注的上一个状态。
        半自动标注时,删除上一个添加的点提示;手动标注时,删除上一个添加的顶点。
3. 点击工具栏[标注完成]按钮,完成标注(快捷键E)。
4. 点击工具栏[保存]按钮(快捷键S),写入json文件。

2.修改

1. 多边形修改
    拖拽多边形顶点,修改多边形形状。
    拖拽多边形,调整多边形位置。
2. 类别修改
    选定目标,点击工具栏[编辑]按钮(快捷键E),在跳出的编辑框中修改类别或添加信息。
3. 遮挡修改
    对于存在重叠部分的目标,选定目标多边形后,点击工具栏[置顶](快捷键T)或[置底](快捷键B)按钮,调整目标遮挡关系。
4. 删除目标
    选定目标,点击工具栏[删除]按钮(快捷键DEL),删除选定目标。

3.查看

1. 结果预览
    点击工具栏[位图]按钮(快捷键SPACE),预览标注结果。
    点击时,以 ‘标注-语义-实例’ 的顺序进行切换。
2. 窗口调整
    点击工具栏[放大](快捷键SPACE),[缩小](快捷键SPACE),[适应窗口](快捷键SPACE)调整图片大小。
3. 显示/隐藏目标
    点击工具栏[显示/隐藏]按钮(快捷键V),显示或隐藏当前已标注目标。
    也可以在右侧标注栏中,通过勾选框显示/隐藏单个目标。
4. 背景清晰度调整(仅半自动标注时)
    半自动标注时,会调暗背景,凸显mask。
    通过工具栏[mask alpha]数值条,调整背景与mask混合比例。

4.数据转换

本软件用json文件保存标注结果。 使用时,可以手动解析json文件,或转换为其他数据格式。

软件内置了转换工具
1. ISAT转VOC
    转换ISAT格式json为png单通道图片。语义分割中,像素值为类别index;实例分割中,像素值为实例id(软件中的group id)。
2. ISAT转COCO
    转换ISAT格式json为COCO格式json。(转换后,会丢失图层信息,如最终使用coco格式,标注时尽可能避免目标重叠)
3. ISAT转LABELME
    转换ISAT格式json为labelme格式json。(转换后,会丢失图层信息)
4. COCO转ISAT
    转换COCO格式json为ISAT格式json。

引用

@misc{ISAT with segment anything,
  title={{ISAT with segment anything}: Image segmentation annotation tool with segment anything},
  url={https://github.com/yatengLG/ISAT_with_segment_anything},
  note={Open source software available from https://github.com/yatengLG/ISAT_with_segment_anything},
  author={yatengLG, Alias-z and horffmanwang},
  year={2023},
}

More Repositories

1

Focal-Loss-Pytorch

全中文注释.(The loss function of retinanet based on pytorch).(You can use it on one-stage detection task or classifical task, to solve data imbalance influence).用于one-stage目标检测算法,提升检测效果.你也可以在分类任务中使用该损失函数,解决数据不平衡问题.
Jupyter Notebook
450
star
2

SSD-Pytorch

SSD目标检测算法(Single Shot MultiBox Detector)(简单,明了,易用,全中文注释,单机多卡训练,视频检测)( If you train the model on a single computer and mutil GPU, this program will be your best choice , easier to use and easier to understand )
Python
392
star
3

Retinanet-Pytorch

Retinanet目标检测算法(简单,明了,易用,全中文注释,单机多卡训练,视频检测)(based on pytorch,Simple, Clear, Mutil GPU)
Python
264
star
4

ISAT

ISAT - Image segmentation annotation tool.(图像分割标注工具,支持语义分割与实例分割)
Python
45
star
5

PSAT

PSAT - Point cloud segmentation annotation tool. (点云分割标注工具,同时支持语义分割与实例分割)
Python
28
star
6

pointnet2

pointnet2(点云分割, 基于pytorch,全中文注释)
Python
24
star
7

Simple-Local-QA

用最简单的代码带你实现基于大模型的本地知识库问答系统
Python
22
star
8

darknet19-pytorch

中英文注释,采用torchvision.models中模型的实现结构.带权重
Python
13
star
9

dota2-autochess-KG

dota2游廊自走棋关系图谱
Python
13
star
10

Changeable

基于pytorch的目标检测数据增强工具包。
Python
12
star
11

leetcode-python

python刷leetcode记录。项目含有详细的代码注释和解题思路,并配有对应的leetcode中英文题目。The project contains detailed code comments and solution ideas(chinese), and has corresponding leetcode question content(Chinese and English).
Python
12
star
12

Machine-Learning

机器学习算法实现(python)(详细的实现过程备注以及丰富的例子)
Jupyter Notebook
10
star
13

freeproxy

可扩展的自动化个人代理ip池
Python
5
star
14

Patterns-Python

设计模式python版本
Python
4
star
15

website

一个基于flask编写的内容分享网站,练手项目。你可以以此项目作为入门flask的学习项目。flask + bootstrap + 七牛云 + nginx + uwsgi
TypeScript
2
star
16

FarmTogetherTool

Farm Together resource modification tool
Python
2
star
17

Sorting-Algorithm-python

排序算法实现(基于python, 带动图展示)All Sorting-Algorithm Implementation based on Python. (GIF display)
Jupyter Notebook
1
star
18

flask-learning

flask学习笔记以及对应的代码.涵盖了狗书、狼书等.
Python
1
star
19

IDAT

IDAT(图像目标检测标注工具)
Python
1
star
20

navigate

个人导航页面- 基于WebStack-Hugo
JavaScript
1
star