Skip to content

Commit 65f5076

Browse files
authored
[Improvement] Use new codestyle (PaddlePaddle#1897)
1 parent b602c44 commit 65f5076

File tree

287 files changed

+3558
-3584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+3558
-3584
lines changed

EISeg/README.md

+189-189
Large diffs are not rendered by default.

EISeg/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Start the annotation when the above are all set up. Here are the commonly used k
165165

166166
## Version Updates
167167

168-
- 2021.12.14 **0.4.1**: 【1】Fix the bug of crashing; 【2】Newly add the post-labeling operation of remote sensing building images.
168+
- 2021.12.14 **0.4.1**: 【1】Fix the bug of crashing; 【2】Newly add the post-labeling operation of remote sensing building images.
169169
- 2021.11.16 **0.4.0**: 【1】 Convert dynamic graph inference into static graph inference with ten times' increase in the speed of single click; 【2】 Add the function of remote sensing image labeling, support the selection of multi-spectral data channels; 【3】 Support the processing of slicing (multi squre division) of large size data; 【4】 Add medical image labeling function, support the reading dicom format and the selection of window width and position.
170170
- 2021.09.16 **0.3.0**:【1】Complete the function of polygon editing with support for editing the results of interactive annotation;【2】Support CH/EN interface;【3】Support saving as grayscale/pseudo-color labels and COCO format;【4】More flexible interface dragging;【5】Achieve the dragging of label bar, and the generated mask is overwritten from top to bottom.
171171
- 2021.07.07 **0.2.0**: Newly added contrib:EISeg,which enables rapid interactive annotation of portrait and generic images.

EISeg/docs/medical_en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Click Yes and there appears the setting panel of the image window width and posi
2626

2727
The window width and position serve to limit the intensity range for easy observation of the CT scanning. The value stored at each pixel point in the CT scan represents the density of the human body at that location, so the higher the density the larger the value. The data range of the image is usually -1024 to 1024. However, the human eye cannot distinguish 2048 shades of gray when viewing the scan, so a smaller intensity range is usually adopted to increase the grayscale differences of the images within, thus facilitating the observation. This is done by selecting the section ranging from Window - Window Width/2 to Window + Window Width/2, and presenting the data in a 256-grayscale image.
2828

29-
For inference, EISeg provides the [pre-trained model for liver segmentation](https://paddleseg.bj.bcebos.com/eiseg/0.4/static_hrnet18s_ocr48_lits.zip) for medical scenarios, with recommended window widths of 400, 0. This model performs best for liver segmentation and can also be used for other tissues or organs.
29+
For inference, EISeg provides the [pre-trained model for liver segmentation](https://paddleseg.bj.bcebos.com/eiseg/0.4/static_hrnet18s_ocr48_lits.zip) for medical scenarios, with recommended window widths of 400, 0. This model performs best for liver segmentation and can also be used for other tissues or organs.

EISeg/docs/remote_sensing.md

+76-76
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
# 遥感相关
2-
3-
以下内容为EISeg中遥感垂类相关的文档,主要包括环境配置和功能介绍两大方面。
4-
5-
## 1 环境配置
6-
7-
EISeg中对遥感数据的支持来自GDAL/OGR,GDAL是一个在X/MIT许可协议下的开源栅格空间数据转换库,OGR与其功能类似但主要提供对矢量数据的支持。同时需要安装rasterio。
8-
9-
### 1.1 依赖安装
10-
11-
关于GDAL的安装,可参考如下安装方式:
12-
13-
#### 1.1.1 Windows
14-
15-
Windows用户可以通过[这里](https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal)下载对应Python和系统版本的二进制文件(*.whl)到本地,以GDAL‑3.3.3‑cp39‑cp39‑win_amd64.whl为例,进入下载目录:
16-
17-
```shell
18-
cd download
19-
```
20-
21-
安装依赖:
22-
23-
```shell
24-
pip install GDAL‑3.3.3‑cp39‑cp39‑win_amd64.whl
25-
```
26-
27-
#### 1.1.2 Linux/Mac安装
28-
29-
Mac用户建议利用conda安装,如下:
30-
31-
```shell script
32-
conda install gdal
33-
```
34-
#### 1.1.3 rasterio 安装
35-
36-
建议用户利用conda安装,如下
37-
38-
```shell script
39-
conda install rasterio
40-
```
41-
42-
## 2 功能介绍
43-
44-
目前EISeg中的遥感垂类功能建设还比较简单,基本完成了GTiff类数据加载、大幅遥感影像切片与合并、地理栅格/矢量数据(GTiff/ESRI Shapefile)导出。并基于各类建筑提取数据集40余万张数据训练了一个建筑分割的交互式模型。
45-
46-
### 2.1 数据加载
47-
48-
目前EISeg仅支持了*.tif/tiff图像后缀的的遥感影像读取,由于训练数据都是来自于RGB三通道的遥感图像切片,因此交互分割也仅在RGB三通道上完成,也就表示EISeg支持多波段数据的波段选择。
49-
50-
当使用EISeg打开GTiff图像时,会获取当前波段数,可通过波段设置的下拉列表进行设置。默认为[b1, b1, b1]。下例展示的是天宫一号多光谱数据设置真彩色:
51-
52-
![yd6fa-hqvvb](https://user-images.githubusercontent.com/71769312/141137443-a327309e-0987-4b2a-88fd-f698e08d3294.gif)
53-
54-
### 2.2 大幅数据切片
55-
56-
目前EISeg对于大幅遥感图像(目前最大尝试为900M,17000*10000大小三通道图像),支持切片预测后合并,其中切片的重叠区域overlap为24。
57-
58-
![140916007-86076366-62ce-49ba-b1d9-18239baafc90](https://user-images.githubusercontent.com/71769312/141139282-854dcb4f-bcab-4ccc-aa3c-577cc52ca385.png)
59-
60-
61-
下面是一副来自谷歌地球的重庆部分地区的切片演示:
62-
63-
![7kevx-q90hv](https://user-images.githubusercontent.com/71769312/141137447-60b305b1-a8ef-4b06-a45e-6db0b1ef2516.gif)
64-
65-
### 2.3 地理数据保存
66-
67-
当打开标注的GTiff图像带有地理参考,可设置EISeg保存时保存为带有地理参考的GTiff和ESRI Shapefile。
68-
69-
- GTiff:已成为GIS和卫星遥感应用的行业图像标准文件。
70-
- ESRI Shapefile:是最常见的的矢量数据格式,Shapefile文件是美国环境系统研究所(ESRI)所研制的GIS文件系统格式文件,是工业标准的矢量数据文件。 所有的商业和开源GIS软件都支持。无处不在的它已成为行业标准。
71-
72-
![82jlu-no59o](https://user-images.githubusercontent.com/71769312/141137726-76457454-5e9c-4ad0-85d6-d03f658ee63c.gif)
73-
74-
### 2.4 遥感标注模型选择
75-
76-
建筑物标注建议使用[static_hrnet18_ocr48_rsbuilding_instance](https://paddleseg.bj.bcebos.com/eiseg/0.4/static_hrnet18_ocr48_rsbuilding_instance.zip)
1+
# 遥感相关
2+
3+
以下内容为EISeg中遥感垂类相关的文档,主要包括环境配置和功能介绍两大方面。
4+
5+
## 1 环境配置
6+
7+
EISeg中对遥感数据的支持来自GDAL/OGR,GDAL是一个在X/MIT许可协议下的开源栅格空间数据转换库,OGR与其功能类似但主要提供对矢量数据的支持。同时需要安装rasterio。
8+
9+
### 1.1 依赖安装
10+
11+
关于GDAL的安装,可参考如下安装方式:
12+
13+
#### 1.1.1 Windows
14+
15+
Windows用户可以通过[这里](https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal)下载对应Python和系统版本的二进制文件(*.whl)到本地,以GDAL‑3.3.3‑cp39‑cp39‑win_amd64.whl为例,进入下载目录:
16+
17+
```shell
18+
cd download
19+
```
20+
21+
安装依赖:
22+
23+
```shell
24+
pip install GDAL‑3.3.3‑cp39‑cp39‑win_amd64.whl
25+
```
26+
27+
#### 1.1.2 Linux/Mac安装
28+
29+
Mac用户建议利用conda安装,如下:
30+
31+
```shell script
32+
conda install gdal
33+
```
34+
#### 1.1.3 rasterio 安装
35+
36+
建议用户利用conda安装,如下
37+
38+
```shell script
39+
conda install rasterio
40+
```
41+
42+
## 2 功能介绍
43+
44+
目前EISeg中的遥感垂类功能建设还比较简单,基本完成了GTiff类数据加载、大幅遥感影像切片与合并、地理栅格/矢量数据(GTiff/ESRI Shapefile)导出。并基于各类建筑提取数据集40余万张数据训练了一个建筑分割的交互式模型。
45+
46+
### 2.1 数据加载
47+
48+
目前EISeg仅支持了*.tif/tiff图像后缀的的遥感影像读取,由于训练数据都是来自于RGB三通道的遥感图像切片,因此交互分割也仅在RGB三通道上完成,也就表示EISeg支持多波段数据的波段选择。
49+
50+
当使用EISeg打开GTiff图像时,会获取当前波段数,可通过波段设置的下拉列表进行设置。默认为[b1, b1, b1]。下例展示的是天宫一号多光谱数据设置真彩色:
51+
52+
![yd6fa-hqvvb](https://user-images.githubusercontent.com/71769312/141137443-a327309e-0987-4b2a-88fd-f698e08d3294.gif)
53+
54+
### 2.2 大幅数据切片
55+
56+
目前EISeg对于大幅遥感图像(目前最大尝试为900M,17000*10000大小三通道图像),支持切片预测后合并,其中切片的重叠区域overlap为24。
57+
58+
![140916007-86076366-62ce-49ba-b1d9-18239baafc90](https://user-images.githubusercontent.com/71769312/141139282-854dcb4f-bcab-4ccc-aa3c-577cc52ca385.png)
59+
60+
61+
下面是一副来自谷歌地球的重庆部分地区的切片演示:
62+
63+
![7kevx-q90hv](https://user-images.githubusercontent.com/71769312/141137447-60b305b1-a8ef-4b06-a45e-6db0b1ef2516.gif)
64+
65+
### 2.3 地理数据保存
66+
67+
当打开标注的GTiff图像带有地理参考,可设置EISeg保存时保存为带有地理参考的GTiff和ESRI Shapefile。
68+
69+
- GTiff:已成为GIS和卫星遥感应用的行业图像标准文件。
70+
- ESRI Shapefile:是最常见的的矢量数据格式,Shapefile文件是美国环境系统研究所(ESRI)所研制的GIS文件系统格式文件,是工业标准的矢量数据文件。 所有的商业和开源GIS软件都支持。无处不在的它已成为行业标准。
71+
72+
![82jlu-no59o](https://user-images.githubusercontent.com/71769312/141137726-76457454-5e9c-4ad0-85d6-d03f658ee63c.gif)
73+
74+
### 2.4 遥感标注模型选择
75+
76+
建筑物标注建议使用[static_hrnet18_ocr48_rsbuilding_instance](https://paddleseg.bj.bcebos.com/eiseg/0.4/static_hrnet18_ocr48_rsbuilding_instance.zip)

EISeg/docs/tools.md

-2
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,3 @@ Parameters:
2929
- `save_path`: path to instance label, required.
3030

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

EISeg/docs/tools_cn.md

+33-34
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
简体中文|[English](tools.md)
2-
# 脚本工具相关
3-
4-
以下内容为EISeg中的相关工具使用。位置位于EISeg/tool
5-
6-
## EISeg PaddleX 语义分割数据集构建
7-
8-
在使用EISeg对网络爬取的图像标注完成后,通过`tool`中的`eiseg2paddlex`,可以将EISeg标注好的数据快速转换为PaddleX的训练格式。使用以下方法:
9-
```
10-
python eiseg2paddlex.py -d save_folder_path -o image_folder_path [-l label_folder_path] [-s split_rate]
11-
```
12-
其中:
13-
- `save_folder_path`: 为需要保存PaddleX数据的路径,必填
14-
- `image_folder_path`: 为图像的路径,必填
15-
- `label_folder_path`: 为标签的路径,非必填,若不填则为自动保存的位置(`image_folder_path/label`
16-
- `split_rate`: 训练集和验证集划分的比例,非必填,若不填则为0.9
17-
18-
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f31302f373134633433396139633766613439622e706e67](https://user-images.githubusercontent.com/71769312/141392744-f1a27774-2714-43a2-8808-2fc14a5a6b5a.png)
19-
20-
## 语义标签转实例标签
21-
22-
语义分割标签转实例分割标签(原标签为0/255),结果为单通道图像采用调色板调色。通过`tool`中的`semantic2instance`,可以将EISeg标注好的语义分割数据转为实例分割数据。使用以下方法:
23-
24-
``` shell
25-
python semantic2instance.py -o label_path -d save_path
26-
```
27-
28-
其中:
29-
30-
- `label_path`: 语义标签存放路径,必填
31-
- `save_path`: 实例标签保存路径,必填
32-
33-
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f30392f303038633562373638623765343737612e706e67](https://user-images.githubusercontent.com/71769312/141392781-d99ec177-f445-4336-9ab2-0ba7ae75d664.png)
34-
1+
简体中文|[English](tools.md)
2+
# 脚本工具相关
3+
4+
以下内容为EISeg中的相关工具使用。位置位于EISeg/tool
5+
6+
## EISeg PaddleX 语义分割数据集构建
7+
8+
在使用EISeg对网络爬取的图像标注完成后,通过`tool`中的`eiseg2paddlex`,可以将EISeg标注好的数据快速转换为PaddleX的训练格式。使用以下方法:
9+
```
10+
python eiseg2paddlex.py -d save_folder_path -o image_folder_path [-l label_folder_path] [-s split_rate]
11+
```
12+
其中:
13+
- `save_folder_path`: 为需要保存PaddleX数据的路径,必填
14+
- `image_folder_path`: 为图像的路径,必填
15+
- `label_folder_path`: 为标签的路径,非必填,若不填则为自动保存的位置(`image_folder_path/label`
16+
- `split_rate`: 训练集和验证集划分的比例,非必填,若不填则为0.9
17+
18+
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f31302f373134633433396139633766613439622e706e67](https://user-images.githubusercontent.com/71769312/141392744-f1a27774-2714-43a2-8808-2fc14a5a6b5a.png)
19+
20+
## 语义标签转实例标签
21+
22+
语义分割标签转实例分割标签(原标签为0/255),结果为单通道图像采用调色板调色。通过`tool`中的`semantic2instance`,可以将EISeg标注好的语义分割数据转为实例分割数据。使用以下方法:
23+
24+
``` shell
25+
python semantic2instance.py -o label_path -d save_path
26+
```
27+
28+
其中:
29+
30+
- `label_path`: 语义标签存放路径,必填
31+
- `save_path`: 实例标签保存路径,必填
32+
33+
![68747470733a2f2f73332e626d702e6f76682f696d67732f323032312f30392f303038633562373638623765343737612e706e67](https://user-images.githubusercontent.com/71769312/141392781-d99ec177-f445-4336-9ab2-0ba7ae75d664.png)

EISeg/eiseg/__init__.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
import sys
1716
import os
1817
import os.path as osp
@@ -25,7 +24,6 @@
2524
__APPNAME__ = "EISeg"
2625
__VERSION__ = "0.4.1"
2726

28-
2927
pjpath = osp.dirname(osp.realpath(__file__))
3028
sys.path.append(pjpath)
3129

@@ -35,8 +33,7 @@
3533

3634
# log
3735
settings = QtCore.QSettings(
38-
osp.join(pjpath, "config/setting.ini"), QtCore.QSettings.IniFormat
39-
)
36+
osp.join(pjpath, "config/setting.ini"), QtCore.QSettings.IniFormat)
4037

4138
logFolder = settings.value("logFolder")
4239
logLevel = bool(settings.value("log"))
@@ -59,11 +56,11 @@
5956

6057
t = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
6158
logger = logging.getLogger("EISeg Logger")
62-
handler = logging.FileHandler(osp.normcase(osp.join(logFolder, f"eiseg-{t}.log")))
59+
handler = logging.FileHandler(
60+
osp.normcase(osp.join(logFolder, f"eiseg-{t}.log")))
6361
handler.setFormatter(
6462
logging.Formatter(
6563
"%(levelname)s - %(asctime)s - %(filename)s - %(funcName)s - %(message)s"
66-
)
67-
)
64+
))
6865
logger.setLevel(logLevel)
6966
logger.addHandler(handler)

EISeg/eiseg/__main__.py

-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
from run import main
1716

18-
1917
if __name__ == "__main__":
2018
main()

0 commit comments

Comments
 (0)