Skip to content

Commit f972af9

Browse files
authored
[Doc] Add English doc (#1688)
1 parent edc042d commit f972af9

File tree

8 files changed

+841
-150
lines changed

8 files changed

+841
-150
lines changed

docs/deployment/inference/infer_benchmark.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# 推理Benchmark
1+
English|[简体中文](infer_benchmark_cn.md)
2+
# Inference Benchmark
23

3-
测试环境
4+
Test Environment
45
* GPU: V100 32G
56
* CPU: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
67
* CUDA: 10.1
78
* cuDNN: 7.6
89
* TensorRT: 6.0.1.5
910
* Paddle: 2.1.1
1011

12+
The method of test segmentation model on GPU:
13+
1. Use all of the data in Cityscapes dataset to test(1024 * 2048).
14+
2. Use single GPU and set batchsize to 1.
15+
3. The time only includes model inference.
16+
4. Use the [Python API](./python_inference.md) of Paddle Inference to test. You can choose whether to use TRT wirh use_trt parameter and use precision to set the inference datatype.
1117

12-
GPU上分割模型的测试方法:
13-
1. 使用cityspcaes的全量验证数据集(1024x2048)进行测试
14-
2. 单GPU,Batchsize为1
15-
3. 运行耗时为纯模型预测时间
16-
4. 使用Paddle Inference的[Python API](./python_inference.md)测试,通过use_trt参数设置是否使用TRT,使用precision参数设置预测类型
18+
Inference with GPU Benchmark:
1719

18-
GPU上推理Benchmark:
19-
20-
| 模型 | 使用TRT | 预测类型 | mIoU | 耗时(s/img) |
20+
| Model | With TRT | infer datatype | mIoU | time(s/img) |
2121
| - | :-: | :-: | :-: | :-: |
2222
| ANN_ResNet50_OS8 | N | FP32 | 0.7909 | 0.274 |
2323
| ANN_ResNet50_OS8 | Y | FP32 | 0.7909 | 0.281 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
简体中文|[English](infer_benchmark.md)
2+
# 推理 Benchmark
3+
4+
测试环境:
5+
* GPU: V100 32G
6+
* CPU: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
7+
* CUDA: 10.1
8+
* cuDNN: 7.6
9+
* TensorRT: 6.0.1.5
10+
* Paddle: 2.1.1
11+
12+
13+
GPU上分割模型的测试方法:
14+
1. 使用cityspcaes的全量验证数据集(1024x2048)进行测试
15+
2. 单GPU,Batchsize为1
16+
3. 运行耗时为纯模型预测时间
17+
4. 使用Paddle Inference的[Python API](./python_inference.md)测试,通过use_trt参数设置是否使用TRT,使用precision参数设置预测类型
18+
19+
GPU上推理Benchmark:
20+
21+
| 模型 | 使用TRT | 预测类型 | mIoU | 耗时(s/img) |
22+
| - | :-: | :-: | :-: | :-: |
23+
| ANN_ResNet50_OS8 | N | FP32 | 0.7909 | 0.274 |
24+
| ANN_ResNet50_OS8 | Y | FP32 | 0.7909 | 0.281 |
25+
| ANN_ResNet50_OS8 | Y | FP16 | 0.7909 | 0.168 |
26+
| ANN_ResNet50_OS8 | Y | INT8 | 0.7906 | 0.195 |
27+
| DANet_ResNet50_OS8 | N | FP32 | 0.8027 | 0.371 |
28+
| DANet_ResNet50_OS8 | Y | FP32 | 0.8027 | 0.330 |
29+
| DANet_ResNet50_OS8 | Y | FP16 | 0.8027 | 0.183 |
30+
| DANet_ResNet50_OS8 | Y | INT8 | 0.8039 | 0.266 |
31+
| DeepLabV3P_ResNet50_OS8 | N | FP32 | 0.8036 | 0.165 |
32+
| DeepLabV3P_ResNet50_OS8 | Y | FP32 | 0.8036 | 0.206 |
33+
| DeepLabV3P_ResNet50_OS8 | Y | FP16 | 0.8036 | 0.196 |
34+
| DeepLabV3P_ResNet50_OS8 | Y | INT8 | 0.8044 | 0.083 |
35+
| DNLNet_ResNet50_OS8 | N | FP32 | 0.7995 | 0.381 |
36+
| DNLNet_ResNet50_OS8 | Y | FP32 | 0.7995 | 0.360 |
37+
| DNLNet_ResNet50_OS8 | Y | FP16 | 0.7995 | 0.230 |
38+
| DNLNet_ResNet50_OS8 | Y | INT8 | 0.7989 | 0.236 |
39+
| EMANet_ResNet50_OS8 | N | FP32 | 0.7905 | 0.208 |
40+
| EMANet_ResNet50_OS8 | Y | FP32 | 0.7905 | 0.186 |
41+
| EMANet_ResNet50_OS8 | Y | FP16 | 0.7904 | 0.062 |
42+
| EMANet_ResNet50_OS8 | Y | INT8 | 0.7939 | 0.106 |
43+
| GCNet_ResNet50_OS8 | N | FP32 | 0.7950 | 0.247 |
44+
| GCNet_ResNet50_OS8 | Y | FP32 | 0.7950 | 0.228 |
45+
| GCNet_ResNet50_OS8 | Y | FP16 | 0.7950 | 0.100 |
46+
| GCNet_ResNet50_OS8 | Y | INT8 | 0.7959 | 0.144 |
47+
| PSPNet_ResNet50_OS8 | N | FP32 | 0.7883 | 0.327 |
48+
| PSPNet_ResNet50_OS8 | Y | FP32 | 0.7883 | 0.324 |
49+
| PSPNet_ResNet50_OS8 | Y | FP16 | 0.7883 | 0.218 |
50+
| PSPNet_ResNet50_OS8 | Y | INT8 | 0.7915 | 0.223 |
51+
| UNet | N | FP32 | 0.6500 | 0.071 |
52+
| UNet | Y | FP32 | 0.6500 | 0.099 |
53+
| UNet | Y | FP16 | 0.6500 | 0.099 |
54+
| UNet | Y | INT8 | 0.6503 | 0.099 |

docs/module/data/data.md

+56-55
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,102 @@
1-
# PaddleSeg 数据增强
1+
English|[简体中文](data_cn.md)
2+
# PaddleSeg Data Augmentation
23

34

4-
## 数据增强基本流程
5+
## Data augmentation basic procedure
56

67
![](../images/data_aug_flow.png)
78

89
## Resize
910

10-
Resize步骤是指将输入图像按照某种规则讲图片重新缩放到某一个尺寸,PaddleSeg支持以下3种resize方式:
11+
Resize means rescale the input image to a certain size according to a certain rule. PaddleSeg support the following three ways to resize:
1112

1213
![](../images/aug_method.png)
1314

1415
- Unpadding
15-
将输入图像直接resize到某一个固定大小下,送入到网络中间训练。预测时同样操作。
16+
Resize the input image to a certain fixed size and send it to the network for training. Do the same when predict.
1617

1718
- Step-Scaling
18-
将输入图像按照某一个比例resize,这个比例以某一个步长在一定范围内随机变动。预测时不对输入图像做处理。
19+
Resize the input image based on a certain ratio, which randomly changes within a certain range with a certain step. The input image remains the same during prediction.
1920

2021
- Range-Scaling
21-
将输入图像按照长边变化进行resize,即图像长边对齐到某一长度,该长度在一定范围内随机变动,短边随同样的比例变化。
22-
预测时需要将长边对齐到另外指定的固定长度。
22+
Resize the input image based on the long edge, which means scale the long edge to a certain length, and the short edge changes based on the original image ratio. The image's long edge will be rescaled to another assigned length during prediction.
2323

24-
Range-Scaling示意图如下:
24+
Range-Scaling's diagram is as follows:
2525

2626
![](../images/rangescale.png)
2727

28-
|Resize方式|配置参数|含义|备注|
28+
|Resize method|config parameter|meaning|Note|
2929
|-|-|-|-|
30-
|Unpadding|AUG.FIX_RESIZE_SIZE|Resize的固定尺寸|
31-
|Step-Scaling|AUG.MIN_SCALE_FACTOR|Resize最小比例|
32-
||AUG.MAX_SCALE_FACTOR|Resize最大比例|
33-
||AUG.SCALE_STEP_SIZE|Resize比例选取的步长|
34-
|Range-Scaling|AUG.MIN_RESIZE_VALUE|图像长边变动范围的最小值|
35-
||AUG.MAX_RESIZE_VALUE|图像长边变动范围的最大值|
36-
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|AUG.INF_RESIZE_VALUE|预测时长边对齐时所指定的固定长度|取值必须在<br>[AUG.MIN_RESIZE_VALUE,<br> AUG.MAX_RESIZE_VALUE]<br>范围内。|
30+
|Unpadding|AUG.FIX_RESIZE_SIZE|the fixed size of Resize|
31+
|Step-Scaling|AUG.MIN_SCALE_FACTOR|the minimum ratio of Resize|
32+
||AUG.MAX_SCALE_FACTOR|the maximum ratio of Resize|
33+
||AUG.SCALE_STEP_SIZE|the step size of Resize|
34+
|Range-Scaling|AUG.MIN_RESIZE_VALUE|the minimum value of the long edge of image|
35+
||AUG.MAX_RESIZE_VALUE|the maximum value of the long edge of image|
36+
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|AUG.INF_RESIZE_VALUE|the assigned fixed length when rescale the long edge |must range between <br>[AUG.MIN_RESIZE_VALUE,<br> AUG.MAX_RESIZE_VALUE]<br>.|
3737

38-
**注:本文所有配置参数可在configs目录下您的yaml文件中进行设置。**
38+
**PS:All configuration parameters in this article can be set in your yaml file in the configs directory**
3939

40-
## 图像翻转
40+
## Image flip
4141

42-
PaddleSeg支持以下2种翻转方式:
42+
PaddleSeg support following two ways to flip:
4343

44-
- 左右翻转(Mirror
45-
以50%概率对图像进行左右翻转。
44+
- Vertival flip(Mirror)
45+
Flip the image left and right with 50% probability.
4646

47-
- 上下翻转(Flip)
48-
以一定概率对图像进行上下翻转。
47+
- Horizontal Flip
48+
Flip the image upside down with a certain probability.
49+
50+
51+
The above two kinds of switches operate independently and can be used in combination. Therefore, there are 4 possible situations for image flipping as follows:
4952

50-
以上2种开关独立运作,可组合使用。故图像翻转一共有如下4种可能的情况:
5153

5254
![](../images/data_aug_flip_mirror.png)
5355

54-
|图像翻转方式|配置参数|含义|备注|
56+
|Image flip method| Config parameter |Meaning|Note|
5557
|-|-|-|-|
56-
|Mirror|AUG.MIRROR|左右翻转开关|为True时开启,为False时关闭|
57-
|Flip|AUG.FLIP|上下翻转开关|为True时开启,为False时关闭|
58-
||AUG.FLIP_RATIO|控制是否上下翻转的概率|当AUG.FLIP为False时无效|
58+
|Mirror|AUG.MIRROR|vertival flip switch |open when set with True|
59+
|Flip|AUG.FLIP|horizontal flip switch|open when set with True|
60+
||AUG.FLIP_RATIO|Control the probability of flip upside down|invalid whtn AUG.FLIP is False|
5961

6062

6163
## Rich Crop
64+
Rich Crop is a set of data enhancement strategies open by PaddleSeg based on actual business experience. It is a data enhancement strategy for segmentation scenarios with less labeled data and complex test data. The process is shown in the figure below:
6265

63-
Rich Crop是PaddleSeg结合实际业务经验开放的一套数据增强策略,面向标注数据少,测试数据情况繁杂的分割业务场景使用的数据增强策略。流程如下图所示:
64-
65-
![RichCrop示意图](../images/data_aug_example.png)
66+
![RichCrop example](../images/data_aug_example.png)
6667

67-
Rich Crop是指对图像进行多种变换,保证在训练过程中数据的丰富多样性,包含以下4种变换:
68+
Rich Crop refers to a variety of transformations on the image to ensure the rich diversity of the data during the training process. It includes the following 4 transformations:
6869

69-
- Blur
70-
使用高斯模糊对图像进行平滑。
70+
-Blur
71+
Use Gaussian Blur to smooth the image.
7172

72-
- Rotation
73-
图像旋转,旋转角度在一定范围内随机选取,旋转产生的多余的区域使用`DATASET.PADDING_VALUE`值进行填充。
73+
-Rotation
74+
Image rotation, the rotation angle is randomly selected within a certain range. And the extra area generated by the rotation is filled with the value of `DATASET.PADDING_VALUE`.
7475

75-
- Aspect
76-
图像长宽比调整,从图像中按一定大小和宽高比裁取一定区域出来之后进行resize。
76+
-Aspect
77+
Image aspect ratio adjustment, resize after cropping a certain area from the image according to a certain size and aspect ratio.
7778

78-
- Color jitter
79-
图像颜色抖动,共进行亮度、饱和度和对比度三种颜色属性的调节。
79+
-Color jitter
80+
The image color is jittered, and the three color attributes of brightness, saturation and contrast are adjusted.
8081

81-
|Rich crop方式|配置参数|含义|备注|
82+
|Rich crop method|Config parameter|Meaning|Note|
8283
|-|-|-|-|
83-
|Rich crop|AUG.RICH_CROP.ENABLE|Rich crop总开关|为True时开启,为False时关闭所有变换|
84-
|Blur|AUG.RICH_CROP.BLUR|图像模糊开关|为True时开启,为False时关闭|
85-
||AUG.RICH_CROP.BLUR_RATIO|控制进行模糊的概率|当AUG.RICH_CROP.BLUR为False时无效|
86-
|Rotation|AUG.RICH_CROP.MAX_ROTATION|图像正向旋转的最大角度|取值0~90°,实际旋转角度在\[-AUG.RICH_CROP.MAX_ROTATION, AUG.RICH_CROP.MAX_ROTATION]范围内随机选取|
87-
|Aspect|AUG.RICH_CROP.MIN_AREA_RATIO|裁取图像与原始图像面积比最小值|取值0~1,取值越小则变化范围越大,若为0则不进行调节|
88-
||AUG.RICH_CROP.ASPECT_RATIO|裁取图像宽高比范围|取值非负,越小则变化范围越大,若为0则不进行调节|
89-
|Color jitter|AUG.RICH_CROP.BRIGHTNESS_JITTER_RATIO|亮度调节因子|取值0~1,取值越大则变化范围越大,若为0则不进行调节|
90-
||AUG.RICH_CROP.SATURATION_JITTER_RATIO|饱和度调节因子|取值0~1,取值越大则变化范围越大,若为0则不进行调节|
91-
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|AUG.RICH_CROP.CONTRAST_JITTER_RATIO|对比度调节因子&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|取值0~1,取值越大则变化范围越大,若为0则不进行调节|
84+
|Rich crop|AUG.RICH_CROP.ENABLE|Rich crop overall switch|open with True, close all transformation with False|
85+
|Blur|AUG.RICH_CROP.BLUR|Image blur switch|open with True, close with False|
86+
||AUG.RICH_CROP.BLUR_RATIO|the probability of blur |invalid when AUG.RICH_CROP.BLUR is False|
87+
|Rotation|AUG.RICH_CROP.MAX_ROTATION|maximum rotation angle of clockwise rotation|range between 0~90°,Actual rotation angle is randomly set within \[-AUG.RICH_CROP.MAX_ROTATION, AUG.RICH_CROP.MAX_ROTATION]|
88+
|Aspect|AUG.RICH_CROP.MIN_AREA_RATIO|The minimum area ratio of the cropped image to the original image|The value is 0~1, the smaller the value, the larger the range of change, if it is 0, no adjustment will be made|
89+
||AUG.RICH_CROP.ASPECT_RATIO|The range of cropped image aspect ratio|The value is non-negative, the smaller the value, the larger the range of change, if it is 0, no adjustment is made|
90+
|Color jitter|AUG.RICH_CROP.BRIGHTNESS_JITTER_RATIO|Brightness adjustment factor|The value is between 0~1, the larger the value, the larger the range of change, if it is 0, no adjustment is made|
91+
||AUG.RICH_CROP.SATURATION_JITTER_RATIO|Saturation adjustment factor|The value is 0~1, the larger the value, the larger the range of change, if it is 0, no adjustment is made|
92+
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|AUG.RICH_CROP.CONTRAST_JITTER_RATIO|Contrast adjustment factor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|The value is 0~1, the larger the value, the larger the range of change, if it is 0, no adjustment is made|
9293

9394

9495
## Random Crop
9596

96-
随机裁剪图片和标签图,该步骤主要是通过裁剪的方式使得输入到网络中的图像在某一个固定大小。
97+
Randomly crop pictures and label images. This step crop the input images of the network to a fixed size.
9798

98-
Random crop过程分为3种情形:
99-
- 当输入图像尺寸等于CROP_SIZE时,返回原图。
100-
- 当输入图像尺寸大于CROP_SIZE时,直接裁剪。
101-
- 当输入图像尺寸小于CROP_SIZE时,分别使用`DATASET.PADDING_VALUE`值和`DATASET.IGNORE_INDEX`值对图像和标签图进行填充,再进行裁剪。
99+
Random crop process is divided into 3 situations:
100+
- When the input image size is equal to CROP_SIZE, return to the original image.
101+
- When the input image size is larger than CROP_SIZE, crop directly.
102+
- When the input image size is smaller than CROP_SIZE, use the `DATASET.PADDING_VALUE` value and the `DATASET.IGNORE_INDEX` value to fill the image and label image, and then crop them.

0 commit comments

Comments
 (0)