Skip to content

Commit c8bcada

Browse files
authored
[Doc] Add docs for ppocr ppseg examples (#1429)
* add docs for examples * add english doc * fix * fix docs
1 parent 010f12d commit c8bcada

File tree

22 files changed

+2983
-5
lines changed

22 files changed

+2983
-5
lines changed

docs/api/vision_results/ocr_result.md

+75
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,78 @@ fastdeploy.vision.OCRResult
4141
- **rec_scores**: Member variable which indicates the confidence level of the recognized text, where the element number is the same as `boxes.size()`.
4242
- **cls_scores**: Member variable which indicates the confidence level of the classification result of the text box, where the element number is the same as `boxes.size()`.
4343
- **cls_labels**: Member variable which indicates the directional category of the textbox, where the element number is the same as `boxes.size()`.
44+
45+
46+
## C# Definition
47+
48+
`fastdeploy.vision.OCRResult`
49+
50+
```C#
51+
public class OCRResult {
52+
public List<int[]> boxes;
53+
public List<string> text;
54+
public List<float> rec_scores;
55+
public List<float> cls_scores;
56+
public List<int> cls_labels;
57+
public ResultType type;
58+
}
59+
```
60+
61+
- **boxes**: Member variable which indicates the coordinates of all detected target boxes in a single image. `boxes.Count` indicates the number of detected boxes. Each box is represented by 8 int values to indicate the 4 coordinates of the box, in the order of lower left, lower right, upper right, upper left.
62+
- **text**: Member variable which indicates the content of the recognized text in multiple text boxes, where the element number is the same as `boxes.Count`.
63+
- **rec_scores**: Member variable which indicates the confidence level of the recognized text, where the element number is the same as `boxes.Count`.
64+
- **cls_scores**: Member variable which indicates the confidence level of the classification result of the text box, where the element number is the same as `boxes.Count`.
65+
- **cls_labels**: Member variable which indicates the directional category of the textbox, where the element number is the same as `boxes.Count`.
66+
67+
## C Definition
68+
69+
```c
70+
struct FD_C_OCRResult {
71+
FD_C_TwoDimArrayInt32 boxes;
72+
FD_C_OneDimArrayCstr text;
73+
FD_C_OneDimArrayFloat rec_scores;
74+
FD_C_OneDimArrayFloat cls_scores;
75+
FD_C_OneDimArrayInt32 cls_labels;
76+
FD_C_ResultType type;
77+
};
78+
```
79+
80+
- **boxes**: Member variable which indicates the coordinates of all detected target boxes in a single image.
81+
82+
```c
83+
typedef struct FD_C_TwoDimArrayInt32 {
84+
size_t size;
85+
FD_C_OneDimArrayInt32* data;
86+
} FD_C_TwoDimArrayInt32;
87+
```
88+
89+
```c
90+
typedef struct FD_C_OneDimArrayInt32 {
91+
size_t size;
92+
int32_t* data;
93+
} FD_C_OneDimArrayInt32;
94+
```
95+
96+
- **text**: Member variable which indicates the content of the recognized text in multiple text boxes
97+
98+
```c
99+
typedef struct FD_C_Cstr {
100+
size_t size;
101+
char* data;
102+
} FD_C_Cstr;
103+
typedef struct FD_C_OneDimArrayCstr {
104+
size_t size;
105+
FD_C_Cstr* data;
106+
} FD_C_OneDimArrayCstr;
107+
```
108+
109+
- **rec_scores**: Member variable which indicates the confidence level of the recognized text
110+
111+
```c
112+
typedef struct FD_C_OneDimArrayFloat {
113+
size_t size;
114+
float* data;
115+
} FD_C_OneDimArrayFloat;
116+
```
117+
- **cls_scores**: Member variable which indicates the confidence level of the classification result of the text box
118+
- **cls_labels**: Member variable which indicates the directional category of the textbox

docs/api/vision_results/ocr_result_CN.md

+75
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,78 @@ fastdeploy.vision.OCRResult
4141
- **rec_scores**: 成员变量,表示文本框内识别出来的文本的置信度,其元素个数与`boxes.size()`一致
4242
- **cls_scores**: 成员变量,表示文本框的分类结果的置信度,其元素个数与`boxes.size()`一致
4343
- **cls_labels**: 成员变量,表示文本框的方向分类类别,其元素个数与`boxes.size()`一致
44+
45+
## C# 定义
46+
47+
`fastdeploy.vision.OCRResult`
48+
49+
```C#
50+
public class OCRResult {
51+
public List<int[]> boxes;
52+
public List<string> text;
53+
public List<float> rec_scores;
54+
public List<float> cls_scores;
55+
public List<int> cls_labels;
56+
public ResultType type;
57+
}
58+
```
59+
60+
- **boxes**: 成员变量,表示单张图片检测出来的所有目标框坐标,`boxes.Count`表示单张图内检测出的框的个数,每个框以8个int数值依次表示框的4个坐标点,顺序为左下,右下,右上,左上
61+
- **text**: 成员变量,表示多个文本框内被识别出来的文本内容,其元素个数与`boxes.Count`一致
62+
- **rec_scores**: 成员变量,表示文本框内识别出来的文本的置信度,其元素个数与`boxes.Count`一致
63+
- **cls_scores**: 成员变量,表示文本框的分类结果的置信度,其元素个数与`boxes.Count`一致
64+
- **cls_labels**: 成员变量,表示文本框的方向分类类别,其元素个数与`boxes.Count`一致
65+
66+
## C定义
67+
68+
```c
69+
struct FD_C_OCRResult {
70+
FD_C_TwoDimArrayInt32 boxes;
71+
FD_C_OneDimArrayCstr text;
72+
FD_C_OneDimArrayFloat rec_scores;
73+
FD_C_OneDimArrayFloat cls_scores;
74+
FD_C_OneDimArrayInt32 cls_labels;
75+
FD_C_ResultType type;
76+
};
77+
```
78+
79+
- **boxes**: 成员变量,表示单张图片检测出来的所有目标框坐标。
80+
81+
```c
82+
typedef struct FD_C_TwoDimArrayInt32 {
83+
size_t size;
84+
FD_C_OneDimArrayInt32* data;
85+
} FD_C_TwoDimArrayInt32;
86+
```
87+
88+
```c
89+
typedef struct FD_C_OneDimArrayInt32 {
90+
size_t size;
91+
int32_t* data;
92+
} FD_C_OneDimArrayInt32;
93+
```
94+
95+
- **text**: 成员变量,表示多个文本框内被识别出来的文本内容。
96+
97+
```c
98+
typedef struct FD_C_Cstr {
99+
size_t size;
100+
char* data;
101+
} FD_C_Cstr;
102+
103+
typedef struct FD_C_OneDimArrayCstr {
104+
size_t size;
105+
FD_C_Cstr* data;
106+
} FD_C_OneDimArrayCstr;
107+
```
108+
109+
- **rec_scores**: 成员变量,表示文本框内识别出来的文本的置信度。
110+
111+
```c
112+
typedef struct FD_C_OneDimArrayFloat {
113+
size_t size;
114+
float* data;
115+
} FD_C_OneDimArrayFloat;
116+
```
117+
- **cls_scores**: 成员变量,表示文本框的分类结果的置信度。
118+
- **cls_labels**: 成员变量,表示文本框的方向分类类别。

docs/api/vision_results/segmentation_result.md

+60
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,63 @@ struct SegmentationResult {
3131
- **label_map**(list of int): Member variable which indicates the segmentation category of each pixel in a single image.
3232
- **score_map**(list of float): Member variable which indicates the predicted segmentation category probability value corresponding to the label_map one-to-one, the member variable is not empty only when `--output_op none` is specified when exporting the PaddleSeg model, otherwise the member variable is empty.
3333
- **shape**(list of int): Member variable which indicates the shape of the output image as H\*W.
34+
35+
36+
## C# Definition
37+
38+
`fastdeploy.vision.SegmentationResult`
39+
40+
```C#
41+
public class SegmentationResult{
42+
public List<byte> label_map;
43+
public List<float> score_map;
44+
public List<long> shape;
45+
public bool contain_score_map;
46+
public ResultType type;
47+
}
48+
```
49+
50+
- **label_map**(list of int): Member variable which indicates the segmentation category of each pixel in a single image.
51+
- **score_map**(list of float): Member variable which indicates the predicted segmentation category probability value corresponding to the label_map one-to-one, the member variable is not empty only when `--output_op none` is specified when exporting the PaddleSeg model, otherwise the member variable is empty.
52+
- **shape**(list of int): Member variable which indicates the shape of the output image as H\*W.
53+
54+
55+
56+
## C Definition
57+
58+
```c
59+
struct FD_C_SegmentationResult {
60+
FD_C_OneDimArrayUint8 label_map;
61+
FD_C_OneDimArrayFloat score_map;
62+
FD_C_OneDimArrayInt64 shape;
63+
FD_C_Bool contain_score_map;
64+
FD_C_ResultType type;
65+
};
66+
```
67+
68+
- **label_map**(FD_C_OneDimArrayUint8): Member variable which indicates the segmentation category of each pixel in a single image.
69+
70+
```c
71+
struct FD_C_OneDimArrayUint8 {
72+
size_t size;
73+
uint8_t* data;
74+
};
75+
```
76+
77+
- **score_map**(FD_C_OneDimArrayFloat): Member variable which indicates the predicted segmentation category probability value corresponding to the label_map one-to-one, the member variable is not empty only when `--output_op none` is specified when exporting the PaddleSeg model, otherwise the member variable is empty.
78+
79+
```c
80+
struct FD_C_OneDimArrayFloat {
81+
size_t size;
82+
float* data;
83+
};
84+
```
85+
86+
- **shape**(FD_C_OneDimArrayInt64): Member variable which indicates the shape of the output image as H\*W.
87+
88+
```c
89+
struct FD_C_OneDimArrayInt64 {
90+
size_t size;
91+
int64_t* data;
92+
};
93+
```

docs/api/vision_results/segmentation_result_CN.md

+58
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,61 @@ struct SegmentationResult {
3333
- **label_map**(list of int): 成员变量,表示单张图片每个像素点的分割类别
3434
- **score_map**(list of float): 成员变量,与label_map一一对应的所预测的分割类别概率值,只有导出PaddleSeg模型时指定`--output_op none`时,该成员变量才不为空,否则该成员变量为空
3535
- **shape**(list of int): 成员变量,表示输出图片的shape,为H\*W
36+
37+
## C# 定义
38+
39+
`fastdeploy.vision.SegmentationResult`
40+
41+
```C#
42+
public class SegmentationResult{
43+
public List<byte> label_map;
44+
public List<float> score_map;
45+
public List<long> shape;
46+
public bool contain_score_map;
47+
public ResultType type;
48+
}
49+
```
50+
51+
- **label_map**(list of byte): 成员变量,表示单张图片每个像素点的分割类别
52+
- **score_map**(list of float): 成员变量,与label_map一一对应的所预测的分割类别概率值,只有导出PaddleSeg模型时指定`--output_op none`时,该成员变量才不为空,否则该成员变量为空
53+
- **shape**(list of long): 成员变量,表示输出图片的shape,为H\*W
54+
55+
56+
## C定义
57+
58+
```c
59+
struct FD_C_SegmentationResult {
60+
FD_C_OneDimArrayUint8 label_map;
61+
FD_C_OneDimArrayFloat score_map;
62+
FD_C_OneDimArrayInt64 shape;
63+
FD_C_Bool contain_score_map;
64+
FD_C_ResultType type;
65+
};
66+
```
67+
68+
- **label_map**(FD_C_OneDimArrayUint8): 成员变量,表示单张图片每个像素点的分割类别
69+
70+
```c
71+
struct FD_C_OneDimArrayUint8 {
72+
size_t size;
73+
uint8_t* data;
74+
};
75+
```
76+
77+
- **score_map**(FD_C_OneDimArrayFloat): 成员变量,与label_map一一对应的所预测的分割类别概率值,只有导出PaddleSeg模型时指定`--output_op none`时,该成员变量才不为空,否则该成员变量为空
78+
79+
```c
80+
struct FD_C_OneDimArrayFloat {
81+
size_t size;
82+
float* data;
83+
};
84+
```
85+
86+
- **shape**(FD_C_OneDimArrayInt64): 成员变量,表示输出图片的shape,为H\*W
87+
88+
```c
89+
struct FD_C_OneDimArrayInt64 {
90+
size_t size;
91+
int64_t* data;
92+
};
93+
```

examples/vision/classification/paddleclas/csharp/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Then you can run your program and test the model with image
4949
```shell
5050
cd Release
5151
# CPU inference
52-
./infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 0
52+
infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 0
5353
# GPU inference
54-
./infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 1
54+
infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 1
5555
```
5656

5757
## PaddleClas C# Interface

examples/vision/classification/paddleclas/csharp/README_CN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- 1. 软硬件环境满足要求,参考[FastDeploy环境要求](../../../../../docs/cn/build_and_install/download_prebuilt_libraries.md)
99
- 2. 根据开发环境,下载预编译部署库和samples代码,参考[FastDeploy预编译库](../../../../../docs/cn/build_and_install/download_prebuilt_libraries.md)
1010

11-
以Linux上ResNet50_vd推理为例,在本目录执行如下命令即可完成编译测试,支持此模型需保证FastDeploy版本1.0.4以上(x.x.x>=1.0.4)
11+
在本目录执行如下命令即可在Windows完成编译测试,支持此模型需保证FastDeploy版本1.0.4以上(x.x.x>=1.0.4)
1212

1313
## 1. 下载C#包管理程序nuget客户端
1414
> https://dist.nuget.org/win-x86-commandline/v6.4.0/nuget.exe
@@ -50,9 +50,9 @@ fastdeploy_init.bat install %cd% D:\Download\fastdeploy-win-x64-gpu-x.x.x\exampl
5050
```shell
5151
cd Release
5252
# CPU推理
53-
./infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 0
53+
infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 0
5454
# GPU推理
55-
./infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 1
55+
infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 1
5656
```
5757

5858
## PaddleClas C#接口

0 commit comments

Comments
 (0)