Skip to content

Commit 07df77a

Browse files
authored
[EISeg] Bugfixes and Update translation (#2902)
* [EISeg] Fix tif cannot convert to base64 * [EISeg] FIX load poly after change to det * [EISeg] Update det toolbar * [EISeg] close rect ann in seg * [EISeg] Update translate * [EISeg] Try to fix #2895 * [EISeg] - * [EISeg] Fix save each block * [EISeg] Update label list reorder * [EISeg] Fix yolo format (#2901) * [EISeg] Reload eiseg2paddlex (#2908) * [EISeg] Update save labelme json only * [EISeg] Bugfix * [EISeg] Update eiseg2paddlex in det * [EISeg] Update README
1 parent 6ec7417 commit 07df77a

File tree

13 files changed

+561
-1865
lines changed

13 files changed

+561
-1865
lines changed

EISeg/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<p align="center">
55
<img src="https://user-images.githubusercontent.com/35907364/179460858-7dfb19b1-cabf-4f8a-9e81-eb15b6cc7d5f.png" align="middle" alt="LOGO" width = "500" />
66
</p>
7-
87
**飞桨高效交互式分割标注工具。**
98

109
[![Python 3.6](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/release/python-360/) [![PaddlePaddle 2.2](https://img.shields.io/badge/paddlepaddle-2.2-blue.svg)](https://www.python.org/downloads/release/python-360/) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE) [![Downloads](https://pepy.tech/badge/eiseg)](https://pepy.tech/project/eiseg)
@@ -53,6 +52,7 @@ EISeg(Efficient Interactive Segmentation)基于飞桨开发的一个高效智能
5352
![4a9ed-a91y1](https://user-images.githubusercontent.com/71769312/141130688-e1529c27-aba8-4bf7-aad8-dda49808c5c7.gif)
5453

5554
## <img src="../docs/images/feature.png" width="20"/> 特性
55+
5656
* 高效的半自动标注工具,已上线多个Top标注平台
5757
* 覆盖遥感、医疗、视频、3D医疗等众多垂类场景
5858
* 多平台兼容,简单易用,支持多类别标签管理
@@ -69,8 +69,6 @@ EISeg(Efficient Interactive Segmentation)基于飞桨开发的一个高效智能
6969
<div align="center">
7070
<img src="https://user-images.githubusercontent.com/35907364/184841582-84a3c12d-0b50-48cc-9762-11fdd56b59eb.jpg" width = "200" />
7171
</div>
72-
73-
7472
## <img src="../docs/images/teach.png" width="20"/> 使用教程
7573
* [安装说明](docs/install.md)
7674
* [图像分割标注](docs/image.md)

EISeg/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
[Chinese (Simplified)](README.md) | English
1+
[简体中文](README.md) | English
22

33
<div align="center">
44

55
<p align="center">
66
<img src="https://user-images.githubusercontent.com/35907364/179460858-7dfb19b1-cabf-4f8a-9e81-eb15b6cc7d5f.png" align="middle" alt="LOGO" width = "500" />
77
</p>
8-
98
**An Efficient Interactive Segmentation Tool based on [PaddlePaddle](https://github.com/paddlepaddle/paddle).**
109

1110
[![Python 3.6](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/release/python-360/) [![PaddlePaddle 2.2](https://img.shields.io/badge/paddlepaddle-2.2-blue.svg)](https://www.python.org/downloads/release/python-360/) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE) [![Downloads](https://pepy.tech/badge/eiseg)](https://pepy.tech/project/eiseg)
@@ -61,14 +60,15 @@ EISeg (Efficient Interactive Segmentation) is an efficient and intelligent inter
6160
<div align="center">
6261
<img src="https://user-images.githubusercontent.com/35907364/184841582-84a3c12d-0b50-48cc-9762-11fdd56b59eb.jpg" width = "200" />
6362
</div>
64-
6563
## <img src="../docs/images/teach.png" width="20"/> Tutorials
64+
6665
* [Installation](docs/install_en.md)
6766
* [Image Segmentation Annotation](docs/image_en.md)
6867
* [Video Segmentation Annotation](docs/video_en.md)
6968
* [Remote Sensing Segmentation](docs/remote_sensing_en.md)
7069
* [Medical Treatment](docs/medical_en.md)
7170
* [Detection](docs/det_en.md)
71+
* [Tool script](docs/tools_en.md)
7272

7373
## <img src="../docs/images/anli.png" width="20"/> Version Updates
7474
- 2022.12.16 **1.1.0**: 【1】 Added the annotation ability for detection , which can be marked manually or using the detection model PicoDet-S for labeling. 【2】Detection annotation result supports various formats such as COCO, VOC and YOLO. 【3】Added LabelMe JSON format for segmentation result.

EISeg/docs/tools.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
# 脚本工具相关
1+
简体中文 | [English](tools_en.md)
22

3-
以下内容为EISeg中的相关工具使用。位置位于EISeg/tool
3+
# 工具脚本
4+
5+
以下内容为EISeg中的相关工具使用。位置位于`EISeg/tool`
6+
7+
## EISeg PaddleX 语义分割数据集构建
8+
9+
在使用EISeg对网络爬取的图像标注完成后,通过`tool`中的`eiseg2paddlex`,可以将EISeg标注好的数据快速转换为PaddleX的训练格式。使用以下方法:
10+
```
11+
python eiseg2paddlex.py -d save_folder_path -o image_folder_path [-l label_folder_path] [-m mode -s split_rate]
12+
```
13+
其中:
14+
- `save_folder_path`: 为需要保存PaddleX数据的路径,必填。
15+
- `image_folder_path`: 为图像的路径,必填。
16+
- `label_folder_path`: 为标签的路径,非必填,若不填则为自动保存的位置(`image_folder_path/label`)。
17+
- `mode`:数据集的类型,非必填,默认为“seg”,若是目标检测数据集则可使用“det”。
18+
- `split_rate`: 训练集和验证集划分的比例,非必填,若不填则为0.9。
19+
20+
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f31302f373134633433396139633766613439622e706e67](https://user-images.githubusercontent.com/71769312/141392744-f1a27774-2714-43a2-8808-2fc14a5a6b5a.png)
421

522
## 语义标签转实例标签
623

@@ -12,20 +29,21 @@ python semantic2instance.py -o label_path -d save_path
1229

1330
其中:
1431

15-
- `label_path`: 语义标签存放路径,必填
16-
- `save_path`: 实例标签保存路径,必填
32+
- `label_path`: 语义标签存放路径,必填
33+
- `save_path`: 实例标签保存路径,必填
1734

1835
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f30392f303038633562373638623765343737612e706e67](https://user-images.githubusercontent.com/71769312/141392781-d99ec177-f445-4336-9ab2-0ba7ae75d664.png)
1936

2037
## 视频切分脚本
2138

22-
由于视频数据计算量巨大,为了防止显存不足,推荐将视频切分成100帧以内再标注,脚本位置为`EISeg/tool/cut_video.py`
39+
由于视频数据计算量巨大,为了防止显存不足,推荐将视频切分成100帧以内再标注,脚本位置为`EISeg/tool/cut_video.py`
2340

2441
## 医疗切片图转换成视频脚本
2542

26-
3D医疗标注是基于视频标注算法来实现的,因此在医疗图像标注前,需要将医疗图像转换成`mp4`格式后再进行标注,脚本位置为`EISeg/tool/medical2video.py`
43+
3D医疗标注是基于视频标注算法来实现的,因此在医疗图像标注前,需要将医疗图像转换成`mp4`格式后再进行标注,脚本位置为`EISeg/tool/medical2video.py`
2744

2845
## json格式标签转换成coco格式标签
46+
2947
EISeg在标签保存后的```label```文件夹下会生成一个```labelme```的文件夹,里面是与labelme具有相同格式的json文件和```labels.txt```文件,此时如果想把json文件转换成和labelme相同格式的coco文件,可以执行如下命令:
3048

3149
``` shell
@@ -37,8 +55,8 @@ python labelme-json2labelme-coco.py label_path save_path --labels txt_path.
3755

3856
其中:
3957

40-
- `label_path`: labelme格式的json标签保存的路径,必填
41-
- `save_path`: 转换后的coco格式标签保存的路径,必填
42-
- `txt_path`: labels.txt文件路径,必填
58+
- `label_path`: labelme格式的json标签保存的路径,必填
59+
- `save_path`: 转换后的coco格式标签保存的路径,必填
60+
- `txt_path`: labels.txt文件路径,必填
4361

44-
转换完成后会在```save_path```中生成三个文件,分别是```annotations.json```, ```JPEGImages```, ```Visualization```,格式同labelme。
62+
转换完成后会在```save_path```中生成三个文件,分别是```annotations.json```, ```JPEGImages```, ```Visualization```,格式同labelme。

EISeg/docs/tools_en.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
English | [简体中文](tools.md)
2+
3+
# Tool scripting
4+
5+
There are some tool scriptings in EISeg in path of `EISeg/tool`.
6+
7+
## How to construct segmentation dataset for PaddleX
8+
9+
After completing image anotation by EISeg,by applying `eiseg2paddlex.py` in `tool` file, yoou can quickly convert data to PaddleX format for training. Execute the following command:
10+
11+
```
12+
python eiseg2paddlex.py -d save_folder_path -o image_folder_path [-l label_folder_path] [-m mode -s split_rate]
13+
```
14+
15+
16+
- `save_folder_path`: path to save PaddleX format data.
17+
- `image_folder_path`: path of data to be converted.
18+
- `label_folder_path`: path of the label, optional, default is "image_folder_path/label".
19+
- `mode`:Type of dataset, optional, default is “seg”, if this dataset is detection dataset, please use “det”.
20+
- `split_rate`: The devision ratio of training set and validation set, optional, default is 0.9.
21+
22+
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f31302f373134633433396139633766613439622e706e67](https://user-images.githubusercontent.com/71769312/141392744-f1a27774-2714-43a2-8808-2fc14a5a6b5a.png)
23+
24+
## Semantic labels to instance labels
25+
26+
The semantic segmentation label is converted to the instance segmentation label (the original label is in range \[0,255\], and the result is a single-channel image that uses a palette to color. Through the `semantic2instance.py`, the semantic segmentation data marked by EISeg can be converted into instance segmentation data. Use the following method:
27+
28+
``` shell
29+
python semantic2instance.py -o label_path -d save_path
30+
```
31+
32+
Parameters:
33+
34+
- `label_path`: path to semantic label, required.
35+
- `save_path`: path to instance label, required.
36+
37+
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f30392f303038633562373638623765343737612e706e67](https://user-images.githubusercontent.com/71769312/141392781-d99ec177-f445-4336-9ab2-0ba7ae75d664.png)
38+
39+
## Video Cut
40+
41+
Due to the huge amount of video data calculation, in order to prevent insufficient video memory, it is recommended to segment the video into 100 frames and label it again. You can find this script in `EISeg/tool/cut_video.py`.
42+
43+
## Convert medical slice into video
44+
45+
3D medical annotation is based on video annotation algorithm. Therefore, before medical image annotation, medical image needs to be converted to `mp4` format and then labeled. You can find this script in `EISeg/tool/medical2video.py`.
46+
47+
## Convert json of labelme to COCO
48+
49+
EISeg will generate a `labelme` folder under the `label` folder after the label is saved, which contains json files and `labels. txt` files with the same format as labelme. At this time, if you want to convert json files into coco files with the same format as labelme, you can execute the following command:
50+
51+
```shell
52+
python labelme-json2labelme-coco.py label_path save_path --labels txt_path.
53+
54+
# E.g.
55+
# python labelme-json2labelme-coco.py mydata/label/labelme/ mydata/label/labelme/output --labels mydata/label/labelme/labels.txt
56+
```
57+
58+
Parameters:
59+
60+
- `label_path`: path to json format of label, required.
61+
- `save_path`: path to save coco format data, required.
62+
- `txt_path`: path to labels.txt, required.
63+
64+
After conversion, it will be displayed in `save_ Path` generates three files, namely `annotations. json`, `JPEGImages` and `Visualization`, in the same format as labelme.

0 commit comments

Comments
 (0)