Skip to content

Commit

Permalink
[Doc]Add English version of documents in docs/cn and api/vision_resul…
Browse files Browse the repository at this point in the history
…ts (PaddlePaddle#931)

* 第一次提交

* 补充一处漏翻译

* deleted:    docs/en/quantize.md

* Update one translation

* Update en version

* Update one translation in code

* Standardize one writing

* Standardize one writing

* Update some en version

* Fix a grammer problem

* Update en version for api/vision result

* Merge branch 'develop' of https://github.com/charl-u/FastDeploy into develop

* Checkout the link in README in vision_results/ to the en documents

* Modify a title

* Add link to serving/docs/

* Finish translation of demo.md
  • Loading branch information
charl-u authored Dec 22, 2022
1 parent ac255b8 commit 02eab97
Show file tree
Hide file tree
Showing 80 changed files with 1,430 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[English](README_EN.md)| 简体中文
# 视觉模型预测结果说明

FastDeploy根据视觉模型的任务类型,定义了不同的结构体(`fastdeploy/vision/common/result.h`)来表达模型预测结果,具体如下表所示
Expand Down
18 changes: 18 additions & 0 deletions docs/api/vision_results/README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[简体中文](README_CN.md)| English
# Prediction Results of the Vision Model

FastDeploy defines different structures (`fastdeploy/vision/common/result.h`) to express the model prediction results according to the vision model task.

| Structure | Document | Description | Corresponding Model |
|:------------------------|:----------------------------------------------|:------------------|:------------------------|
| ClassifyResult | [C++/Python document](./classification_result_EN.md) | Image classification return results | ResNet50, MobileNetV3, etc. |
| SegmentationResult | [C++/Python document](./segmentation_result_EN.md) | Image segmentation result | PP-HumanSeg, PP-LiteSeg, etc. |
| DetectionResult | [C++/Python document](./detection_result_EN.md) | Target detection result | PP-YOLOE, YOLOv7, etc. |
| FaceDetectionResult | [C++/Python document](./face_detection_result_EN.md) | Result of face detection | SCRFD, RetinaFace, etc. |
| FaceAlignmentResult | [C++/Python document](./face_alignment_result_EN.md) | Face alignment result(Face keypoint detection) | PFLD model, etc. |
| KeyPointDetectionResult | [C++/Python document](./keypointdetection_result_EN.md) | Result of keypoint detection | PP-Tinypose model, etc. |
| FaceRecognitionResult | [C++/Python document](./face_recognition_result_EN.md) | Result of face recognition | ArcFace, CosFace, etc. |
| MattingResult | [C++/Python document](./matting_result_EN.md) | Image/video keying result | MODNet, RVM, etc. |
| OCRResult | [C++/Python document](./ocr_result_EN.md) | Text box detection, classification and text recognition result | OCR, etc. |
| MOTResult | [C++/Python document](./mot_result_EN.md) | Multi-target tracking result | pptracking, etc. |
| HeadPoseResult | [C++/Python document](./headpose_result_EN.md) | Head pose estimation result | FSANet, etc. |
1 change: 1 addition & 0 deletions docs/api/vision_results/classification_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](classification_result_EN.md)
# ClassifyResult 图像分类结果

ClassifyResult代码定义在`fastdeploy/vision/common/result.h`中,用于表明图像的分类结果和置信度。
Expand Down
29 changes: 29 additions & 0 deletions docs/api/vision_results/classification_result_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
English | [中文](classification_result.md)
# Image Classification Result

The ClassifyResult code is defined in `fastdeploy/vision/common/result.h`, and is used to indicate the classification result and confidence level of the image.

## C++ Definition

`fastdeploy::vision::ClassifyResult`

```c++
struct ClassifyResult {
std::vector<int32_t> label_ids;
std::vector<float> scores;
void Clear();
std::string Str();
};
```
- **label_ids**: Member variable which indicates the classification results of a single image. Its number is determined by the topk passed in when using the classification model, e.g. it can return the top 5 classification results.
- **scores**: Member variable which indicates the confidence level of a single image on the corresponding classification result. Its number is determined by the topk passed in when using the classification model, e.g. it can return the top 5 classification confidence level.
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
## Python Definition
`fastdeploy.vision.ClassifyResult`
- **label_ids**(list of int): Member variable which indicates the classification results of a single image. Its number is determined by the topk passed in when using the classification model, e.g. it can return the top 5 classification results.
- **scores**(list of float): Member variable which indicates the confidence level of a single image on the corresponding classification result. Its number is determined by the topk passed in when using the classification model, e.g. it can return the top 5 classification confidence level.
1 change: 1 addition & 0 deletions docs/api/vision_results/detection_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](detection_result_EN.md)
# DetectionResult 目标检测结果

DetectionResult代码定义在`fastdeploy/vision/common/result.h`中,用于表明图像检测出来的目标框、目标类别和目标置信度。
Expand Down
66 changes: 66 additions & 0 deletions docs/api/vision_results/detection_result_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
English | [中文](detection_result.md)

# Target Detection Result

The DetectionResult code is defined in `fastdeploy/vision/common/result.h`, and is used to indicate the target frame, target class and target confidence level detected in the image.

## C++ Definition

```c++
fastdeploy::vision::DetectionResult
```

```c++
struct DetectionResult {
std::vector<std::array<float, 4>> boxes;
std::vector<float> scores;
std::vector<int32_t> label_ids;
std::vector<Mask> masks;
bool contain_masks = false;
void Clear();
std::string Str();
};
```
- **boxes**: Member variable which indicates the coordinates of all detected target boxes in a single image. `boxes.size()` indicates the number of boxes, each box is represented by 4 float values in order of xmin, ymin, xmax, ymax, i.e. the coordinates of the top left and bottom right corner.
- **scores**: Member variable which indicates the confidence level of all targets detected in a single image, where the number of elements is the same as `boxes.size()`.
- **label_ids**: Member variable which indicates all target categories detected in a single image, where the number of elements is the same as `boxes.size()`.
- **masks**: Member variable which indicates all detected instance masks of a single image, where the number of elements and the shape size are the same as `boxes`.
- **contain_masks**: Member variable which indicates whether the detected result contains instance masks, which is generally true for the instance segmentation model.
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
```c++
fastdeploy::vision::Mask
```
```c++
struct Mask {
std::vector<int32_t> data;
std::vector<int64_t> shape; // (H,W) ...

void Clear();
std::string Str();
};
```
- **data**: Member variable which indicates a detected mask.
- **shape**: Member variable which indicates the shape of the mask, e.g. (h,w).
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
## Python Definition
```python
fastdeploy.vision.DetectionResult
```

- **boxes**(list of list(float)): Member variable which indicates the coordinates of all detected target boxes in a single frame. It is a list, and each element in it is also a list of length 4, representing a box with 4 float values representing xmin, ymin, xmax, ymax, i.e. the coordinates of the top left and bottom right corner.
- **scores**(list of float): Member variable which indicates the confidence level of all targets detected in a single image.
- **label_ids**(list of int): Member variable which indicates all target categories detected in a single image.
- **masks**: Member variable which indicates all detected instance masks of a single image, where the number of elements and the shape size are the same as `boxes`.
- **contain_masks**: Member variable which indicates whether the detected result contains instance masks, which is generally true for the instance segmentation model.

```python
fastdeploy.vision.Mask
```
- **data**: Member variable which indicates a detected mask.
- **shape**: Member variable which indicates the shape of the mask, e.g. (h,w).
1 change: 1 addition & 0 deletions docs/api/vision_results/face_alignment_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](face_alignment_result_EN.md)
# FaceAlignmentResult 人脸对齐(人脸关键点检测)结果

FaceAlignmentResult 代码定义在`fastdeploy/vision/common/result.h`中,用于表明人脸landmarks。
Expand Down
26 changes: 26 additions & 0 deletions docs/api/vision_results/face_alignment_result_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
English | [中文](face_alignment_result.md)
# Face Alignment Result

The FaceAlignmentResult code is defined in `fastdeploy/vision/common/result.h`, and is used to indicate face landmarks.

## C++ Definition

`fastdeploy::vision::FaceAlignmentResult`

```c++
struct FaceAlignmentResult {
std::vector<std::array<float, 2>> landmarks;
void Clear();
std::string Str();
};
```
- **landmarks**: Member variable which indicates all the key points detected in a single face image.
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
## Python Definition
`fastdeploy.vision.FaceAlignmentResult`
- **landmarks**(list of list(float)): Member variable which indicates all the key points detected in a single face image.
1 change: 1 addition & 0 deletions docs/api/vision_results/face_detection_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](face_detection_result_EN.md)
# FaceDetectionResult 人脸检测结果

FaceDetectionResult 代码定义在`fastdeploy/vision/common/result.h`中,用于表明人脸检测出来的目标框、人脸landmarks,目标置信度和每张人脸的landmark数量。
Expand Down
35 changes: 35 additions & 0 deletions docs/api/vision_results/face_detection_result_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
English | [中文](face_detection_result.md)
# Face Detection Result

The FaceDetectionResult code is defined in `fastdeploy/vision/common/result.h`, and is used to indicate the target frames, face landmarks, target confidence and the number of landmark per face.

## C++ Definition

``fastdeploy::vision::FaceDetectionResult``

```c++
struct FaceDetectionResult {
std::vector<std::array<float, 4>> boxes;
std::vector<std::array<float, 2>> landmarks;
std::vector<float> scores;
int landmarks_per_face;
void Clear();
std::string Str();
};
```
- **boxes**: Member variable which indicates the coordinates of all detected target boxes in a single image. `boxes.size()` indicates the number of boxes, each box is represented by 4 float values in order of xmin, ymin, xmax, ymax, i.e. the coordinates of the top left and bottom right corner.
- **scores**: Member variable which indicates the confidence level of all targets detected in a single image, where the number of elements is the same as `boxes.size()`.
- **landmarks**: Member variable which indicates the keypoints of all faces detected in a single image, where the number of elements is the same as `boxes.size()`.
- **landmarks_per_face**: Member variable which indicates the number of keypoints in each face box.
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
## Python Definition
`fastdeploy.vision.FaceDetectionResult`
- **boxes**(list of list(float)): Member variable which indicates the coordinates of all detected target boxes in a single frame. It is a list, and each element in it is also a list of length 4, representing a box with 4 float values representing xmin, ymin, xmax, ymax, i.e. the coordinates of the top left and bottom right corner.
- **scores**(list of float): Member variable which indicates the confidence level of all targets detected in a single image.
- **landmarks**(list of list(float)): Member variable which indicates the keypoints of all faces detected in a single image.
- **landmarks_per_face**(int): Member variable which indicates the number of keypoints in each face box.
1 change: 1 addition & 0 deletions docs/api/vision_results/face_recognition_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](face_recognition_result_EN.md)
# FaceRecognitionResult 人脸识别结果

FaceRecognitionResult 代码定义在`fastdeploy/vision/common/result.h`中,用于表明人脸识别模型对图像特征的embedding。
Expand Down
26 changes: 26 additions & 0 deletions docs/api/vision_results/face_recognition_result_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
English | [中文](face_recognition_result.md)

# Face Recognition Result

The FaceRecognitionResult code is defined in `fastdeploy/vision/common/result.h`, and is used to indicate the image features embedding in the face recognition model.
## C++ Definition

`fastdeploy::vision::FaceRecognitionResult`

```c++
struct FaceRecognitionResult {
std::vector<float> embedding;
void Clear();
std::string Str();
};
```
- **embedding**: Member variable which indicates the final extracted feature embedding of the face recognition model, and can be used to calculate the facial feature similarity.
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
## Python Definition
`fastdeploy.vision.FaceRecognitionResult`
- **embedding**(list of float): Member variable which indicates the final extracted feature embedding of the face recognition model, and can be used to calculate the facial feature similarity.
1 change: 1 addition & 0 deletions docs/api/vision_results/headpose_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](headpose_result_EN.md)
# HeadPoseResult 头部姿态结果

HeadPoseResult 代码定义在`fastdeploy/vision/common/result.h`中,用于表明头部姿态结果。
Expand Down
26 changes: 26 additions & 0 deletions docs/api/vision_results/headpose_result_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
English | [中文](headpose_result.md)
# Head Pose Result

The HeadPoseResult code is defined in `fastdeploy/vision/common/result.h`, and is used to indicate the head pose result.

## C++ Definition

``fastdeploy::vision::HeadPoseResult`''

```c++
struct HeadPoseResult {
std::vector<float> euler_angles;
void Clear();
std::string Str();
};
```
- **euler_angles**: Member variable which indicates the Euler angles predicted for a single face image, stored in the order (yaw, pitch, roll), with yaw representing the horizontal turn angle, pitch representing the vertical angle, and roll representing the roll angle, all with a value range of [-90,+90].
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
## Python Definition
`fastdeploy.vision.HeadPoseResult`
- **euler_angles**(list of float): Member variable which indicates the Euler angles predicted for a single face image, stored in the order (yaw, pitch, roll), with yaw representing the horizontal turn angle, pitch representing the vertical angle, and roll representing the roll angle, all with a value range of [-90,+90].
19 changes: 11 additions & 8 deletions docs/api/vision_results/keypointdetection_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](keypointdetection_result_EN.md)
# KeyPointDetectionResult 目标检测结果

KeyPointDetectionResult 代码定义在`fastdeploy/vision/common/result.h`中,用于表明图像中目标行为的各个关键点坐标和置信度。
Expand All @@ -16,10 +17,12 @@ struct KeyPointDetectionResult {
};
```
- **keypoints**: 成员变量,表示识别到的目标行为的关键点坐标。`keypoints.size()= N * J`,
- **keypoints**: 成员变量,表示识别到的目标行为的关键点坐标。
`keypoints.size()= N * J`
- `N`:图片中的目标数量
- `J`:num_joints(一个目标的关键点数量)
- **scores**: 成员变量,表示识别到的目标行为的关键点坐标的置信度。`scores.size()= N * J`
- **scores**: 成员变量,表示识别到的目标行为的关键点坐标的置信度。
`scores.size()= N * J`
- `N`:图片中的目标数量
- `J`:num_joints(一个目标的关键点数量)
- **num_joints**: 成员变量,一个目标的关键点数量
Expand All @@ -31,11 +34,11 @@ struct KeyPointDetectionResult {
`fastdeploy.vision.KeyPointDetectionResult`
- **keypoints**(list of list(float)): 成员变量,表示识别到的目标行为的关键点坐标。
`keypoints.size()= N * J`
`N`:图片中的目标数量
`J`:num_joints(关键点数量)
`keypoints.size()= N * J`
- `N`:图片中的目标数量
- `J`:num_joints(关键点数量)
- **scores**(list of float): 成员变量,表示识别到的目标行为的关键点坐标的置信度。
`scores.size()= N * J`
`N`:图片中的目标数量
`J`:num_joints(一个目标的关键点数量)
`scores.size()= N * J`
- `N`:图片中的目标数量
- `J`:num_joints(一个目标的关键点数量)
- **num_joints**(int): 成员变量,一个目标的关键点数量
44 changes: 44 additions & 0 deletions docs/api/vision_results/keypointdetection_result_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
English | [中文](keypointdetection_result.md)
# Keypoint Detection Result

The KeyPointDetectionResult code is defined in `fastdeploy/vision/common/result.h`, and is used to indicate the coordinates and confidence level of each keypoint of the target's behavior in the image.

## C++ Definition

``fastdeploy::vision::KeyPointDetectionResult``

```c++
struct KeyPointDetectionResult {
std::vector<std::array<float, 2>> keypoints;
std::vector<float> scores;
int num_joints = -1;
void Clear();
std::string Str();
};
```
- **keypoints**: Member variable which indicates the coordinates of the identified target behavior keypoint.
` keypoints.size() = N * J`:
- `N`: the number of targets in the image
- `J`: num_joints (the number of keypoints of a target)
- **scores**: Member variable which indicates the confidence level of the keypoint coordinates of the identified target behavior.
`scores.size() = N * J`:
- `N`: the number of targets in the picture
- `J`:num_joints (the number of keypoints of a target)
- **num_joints**: Member variable which indicates the number of keypoints of a target.
- **Clear()**: Member function used to clear the results stored in the structure.
- **Str()**: Member function used to output the information in the structure as string (for Debug).
## Python Definition
`fastdeploy.vision.KeyPointDetectionResult`
- **keypoints**(list of list(float)): Member variable which indicates the coordinates of the identified target behavior keypoint.
` keypoints.size() = N * J`:
- `N`: the number of targets in the image
- `J`: num_joints (the number of keypoints of a target)
- **scores**(list of float): Member variable which indicates the confidence level of the keypoint coordinates of the identified target behavior.
`scores.size() = N * J`:
- `N`: the number of targets in the picture
- `J`:num_joints (the number of keypoints of a target)
- **num_joints**(int): Member variable which indicates the number of keypoints of a target.
1 change: 1 addition & 0 deletions docs/api/vision_results/matting_result.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
中文 | [English](matting_result_EN.md)
# MattingResult 抠图结果

MattingResult 代码定义在`fastdeploy/vision/common/result.h`中,用于表明模型预测的alpha透明度的值,预测的前景等。
Expand Down
Loading

0 comments on commit 02eab97

Please sign in to comment.