Skip to content

Commit 8e8b19e

Browse files
author
laoluo
committed
fix: 将 ADE20K 改为 Mask
1 parent 0715dd2 commit 8e8b19e

File tree

8 files changed

+28
-32
lines changed

8 files changed

+28
-32
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<a href="./README_zh-CN.md" >简体中文</a>
1212
</p>
1313
</article>
14-
<img src="./docs/assets/main.png">
14+
<img src="./docs/assets/main2.png">
1515

1616
</div>
1717

@@ -22,10 +22,10 @@
2222
- 💻 Multiple operating systems: Mac / Linux / Windows
2323
- 🏁 Support Data Formats
2424

25-
| | General Data | COCO | Semantic Segmentation Mask |
26-
| ------- | ------------- |-------| --------------------------- |
27-
| Export | ✔️ | ✔️ | ✔️ |
28-
| Import | ✔️ | | |
25+
| | General Data | COCO | Semantic Segmentation Mask |
26+
| ------ | ------------ | ---- | -------------------------- |
27+
| Export | ✔️ | ✔️ | ✔️ |
28+
| Import | ✔️ || |
2929

3030
## Support Scenes
3131

@@ -39,10 +39,6 @@
3939
<p align="center">
4040
<img src="./docs/assets/annotation-detection-segmentation.gif">
4141
<i style="text-align: center;">Detection / Segmentation </i>
42-
43-
<img src="./docs/assets/annotation-line-point-text.gif">
44-
<i style="text-align: center;">Line / Point / Text </i>
45-
4642
</p>
4743

4844
## Usage

docs/annotation/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ LabelBee-Client 的`目标检测`、`语义分割`支持直接导出 COCO 数据
5757
- 语义的唯一性:语义分割的属性标注配置
5858
- 导出内容:
5959
- JSON 文件: 表示当前语义与颜色的索引关系
60-
- 彩色 Mask
60+
- Mask
61+
- 彩色图(xx_segmentation.png):用于结果校验
62+
- 灰度图(xx_labelTrainIds.png)
6163

6264

6365
```json
@@ -80,14 +82,14 @@ LabelBee-Client 的`目标检测`、`语义分割`支持直接导出 COCO 数据
8082
]
8183
```
8284

83-
| 名称 | 描述 |
84-
| --------- | ------------------------------ |
85-
| attribute | 当前语义 |
86-
| color | 当前语义颜色 |
87-
| trainIds | 训练使用的 ID (灰度值 1 - N) |
85+
| 名称 | 描述 |
86+
| --------- | ------------------------------------------ |
87+
| attribute | 当前语义 |
88+
| color | 当前语义颜色 |
89+
| trainIds | 训练使用的 ID (灰度值 1 - N,0 表示背景|
8890

8991

90-
- 可使用下方脚本将导出的 Mask 按照上方 JSON 文件 Color => TrainIds 的映射转换为灰度图,以用于[mmsegmentation](https://github.com/open-mmlab/mmsegmentation) 训练
92+
- 可使用下方脚本将导出的 Mask (xxx_labelTrainIds.png 四通道图片)转换为(单通道)灰度图,以用于[mmsegmentation](https://github.com/open-mmlab/mmsegmentation) 训练
9193

9294

9395
```python
@@ -97,7 +99,7 @@ from pathlib import Path, PurePath
9799
folder_path = './img/' # Your Export Folder
98100

99101
p = Path(folder_path)
100-
files = [x for x in p.iterdir() if PurePath(x).match('*.png')]
102+
files = [x for x in p.iterdir() if PurePath(x).match('*_labelTrainIds.png')]
101103

102104
for file in files:
103105
p_path = file

docs/assets/main2.png

5.52 MB
Loading

electron/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ipcListen } from './ipcEvent';
22
const electron = require('electron');
33
const platform = require('os').platform(); // 获取平台:https://nodejs.org/api/os.html#os_os_platform
4-
const version = '1.1.4';
4+
const version = '0.1.0';
55

66
// 控制app生命周期.
77
const app = electron.app;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"main": "./electron/dist/electron/main.js",
1111
"dependencies": {
1212
"@ant-design/icons": "^4.6.2",
13-
"@labelbee/lb-components": "^1.2.1",
14-
"@labelbee/lb-annotation": "^1.5.2",
13+
"@labelbee/lb-components": "^1.2.2",
14+
"@labelbee/lb-annotation": "^1.5.3",
1515
"antd": "~4.15.0",
1616
"classnames": "^2.3.1",
1717
"fs-extra": "^8.1.0",
@@ -249,4 +249,4 @@
249249
},
250250
"publish": null
251251
}
252-
}
252+
}

src/ProjectPlatform/ProjectList/ExportData/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const ExportData = (props: IProps) => {
3939
projectInfo?.toolName === EToolName.Rect || projectInfo?.toolName === EToolName.Polygon;
4040

4141
/**
42-
* 是否允许被转换的成 ADE20K
42+
* 是否允许被转换的成 Mask
4343
*/
4444
const isTransfer2ACE20k = projectInfo?.toolName === EToolName.Polygon;
4545
const onOk = () => {
@@ -66,8 +66,8 @@ const ExportData = (props: IProps) => {
6666
name = `${projectInfo.name}-coco`;
6767
break;
6868

69-
case 'ADE20K':
70-
name = `${projectInfo.name}-ADE20K`;
69+
case 'Mask':
70+
name = `${projectInfo.name}-Mask`;
7171
suffix = 'png';
7272

7373
fileList.forEach((file, i) => {
@@ -170,11 +170,11 @@ const ExportData = (props: IProps) => {
170170
)}
171171
</Radio.Button>
172172
<Radio.Button value='default'>{t('StandardFormat')}</Radio.Button>
173-
<Radio.Button value='ADE20K' disabled={!isTransfer2ACE20k}>
173+
<Radio.Button value='Mask' disabled={!isTransfer2ACE20k}>
174174
{isTransfer2ACE20k ? (
175-
'ADE20K'
175+
'Mask'
176176
) : (
177-
<Popover content={t('ExportADE20KLimitMsg')}>ADE20K</Popover>
177+
<Popover content={t('ExportMaskLimitMsg')}>Mask</Popover>
178178
)}
179179
</Radio.Button>
180180
</Radio.Group>

src/i18n.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@ const resources = {
8383
SelectExportFormat: 'Select export Format',
8484
ExportFormat: 'Export format',
8585
StandardFormat: 'LabelBee format',
86-
ADE20kFormat: 'ADE20K format',
8786
ExportSuccess: 'Export successfully',
8887
ExportCOCOLimitMsg: 'Only rectTool and polygonTool can realize the conversion of coco data',
89-
ExportADE20KLimitMsg: 'Only polygonTool can realize the conversion of ADE20K data',
88+
ExportMaskLimitMsg: 'Only polygonTool can realize the conversion of Mask',
9089
SelectedExportPath: 'Choose Export path',
9190
MultiSelect: 'multi-select',
9291
DefaultOption: 'Default Option',
@@ -171,10 +170,9 @@ const resources = {
171170
SelectExportFormat: '选择导出格式',
172171
ExportFormat: '导出格式',
173172
StandardFormat: 'labelbee 格式',
174-
ADE20kFormat: 'ADE20K 格式',
175173
ExportSuccess: '导出成功',
176174
ExportCOCOLimitMsg: '仅限拉框、多边形工具可以实现 coco 数据的转换',
177-
ExportADE20KLimitMsg: '仅限多边形工具可以实现 ADE20K 数据的转换',
175+
ExportMaskLimitMsg: '仅限多边形工具可以实现 Mask 数据的转换',
178176
SelectedExportPath: '选择导出的路径',
179177
MultiSelect: '多选',
180178
DefaultOption: '默认选择',

src/utils/DataTransfer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export default class DataTransfer {
262262
}
263263

264264
/**
265-
* 导出 ADE20K 的格式数据
265+
* 导出 Mask 的格式数据
266266
* @param width
267267
* @param height
268268
* @param polygon

0 commit comments

Comments
 (0)