Browse Source

refine obj_det kpt_det face_det face_feat docs (#2880)

学卿 10 months ago
parent
commit
85e70d71a8

File diff suppressed because it is too large
+ 9 - 6
docs/module_usage/tutorials/cv_modules/face_detection.md


File diff suppressed because it is too large
+ 3 - 0
docs/module_usage/tutorials/cv_modules/face_feature.md


+ 1 - 1
docs/module_usage/tutorials/cv_modules/human_detection.md

@@ -433,7 +433,7 @@ python main.py -c paddlex/configs/human_detection/PP-YOLOE-S_human.yaml \
 
 1.**产线集成**
 
-行人检测模块可以集成的PaddleX产线有[**人体关键点检测**](../../../pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md),只需要替换模型路径即可完成相关产线的关键点检测模块的模型更新。在产线集成中,你可以使用高性能部署和服务化部署来部署你得到的模型。
+行人检测模块可以集成的PaddleX产线有[**人体关键点检测**](../../../pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md),只需要替换模型路径即可完成相关产线的行人检测模块的模型更新。在产线集成中,你可以使用高性能部署和服务化部署来部署你得到的模型。
 
 2.**模块集成**
 

+ 3 - 0
docs/module_usage/tutorials/cv_modules/human_keypoint_detection.en.md

@@ -0,0 +1,3 @@
+[简体中文](human_keypoint_detection.md) | English
+
+Coming soon...

+ 182 - 6
docs/module_usage/tutorials/cv_modules/keypoint_detection.md → docs/module_usage/tutorials/cv_modules/human_keypoint_detection.md

@@ -1,9 +1,9 @@
-简体中文 | [English](keypoint_detection.en.md)
+简体中文 | [English](human_keypoint_detection.en.md)
 
-# 关键点检测模块使用教程
+# 人体关键点检测模块使用教程
 
 ## 一、概述
-关键点检测是计算机视觉领域中的一个重要任务,旨在识别图像或视频中物体(如人体、面部、手势等)的特定关键点位置。通过检测这些关键点,可以实现对物体的姿态估计、动作识别、人机交互、动画生成等多种应用。关键点检测在增强现实、虚拟现实、运动捕捉等领域都有广泛的应用。
+人体关键点检测是计算机视觉领域中的一个重要任务,旨在识别图像或视频中人体的特定关键点位置。通过检测这些关键点,可以实现姿态估计、动作识别、人机交互、动画生成等多种应用。人体关键点检测在增强现实、虚拟现实、运动捕捉等领域都有广泛的应用。
 
 关键点检测算法主要包括 Top-Down 和 Bottom-Up 两种方案。Top-Down 方案通常依赖一个目标检测算法识别出感兴趣物体的边界框,关键点检测模型的输入为经过裁剪的单个目标,输出为这个目标的关键点预测结果,模型的准确率会更高,但速度会随着对象数量的增加而变慢。不同的是,Bottom-Up 方法不依赖于先进行目标检测,而是直接对整个图像进行关键点检测,然后对这些点进行分组或连接以形成多个姿势实例,其速度是固定的,不会随着物体数量的增加而变慢,但精度会更低。
 
@@ -47,7 +47,7 @@
 ## 三、快速集成
 > ❗ 在快速集成前,请先安装 PaddleX 的 wheel 包,详细请参考 [PaddleX本地安装教程](../../../installation/installation.md)
 
-完成wheel包的安装后,几行代码即可完成关键点检测模块的推理,可以任意切换该模块下的模型,您也可以将关键点检测模块中的模型推理集成到您的项目中。运行以下代码前,请您下载[示例图片](https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/keypoint_detection_002.jpg)到本地。
+完成wheel包的安装后,几行代码即可完成人体关键点检测模块的推理,可以任意切换该模块下的模型,您也可以将人体关键点检测模块中的模型推理集成到您的项目中。运行以下代码前,请您下载[示例图片](https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/keypoint_detection_002.jpg)到本地。
 
 ```python
 from paddlex import create_model
@@ -64,6 +64,182 @@ for res in output:
 
 ```
 
+<details><summary>👉 <b>运行后,得到的结果为:(点击展开)</b></summary>
+
+```bash
+{'res': {'input_path': 'keypoint_detection_002.jpg', 'kpts': [{'keypoints': [[175.2838134765625, 56.043609619140625, 0.6522828936576843], [181.32794189453125, 49.642051696777344, 0.7338210940361023], [169.46002197265625, 50.59111022949219, 0.6837076544761658], [193.3421173095703, 51.91969680786133, 0.8676544427871704], [164.50787353515625, 55.6519889831543, 0.8232858777046204], [219.7235870361328, 90.28710174560547, 0.8812915086746216], [152.90377807617188, 95.07806396484375, 0.9093065857887268], [233.1095733642578, 149.6704864501953, 0.7706904411315918], [139.5576629638672, 144.38327026367188, 0.7555014491081238], [245.22830200195312, 202.4243927001953, 0.706590473651886], [117.83794403076172, 188.56410217285156, 0.8892115950584412], [203.29542541503906, 200.2967071533203, 0.838330864906311], [172.00791931152344, 201.1993865966797, 0.7636935710906982], [181.18797302246094, 273.0669250488281, 0.8719099164009094], [185.1750030517578, 278.4797668457031, 0.6878190040588379], [171.55068969726562, 362.42730712890625, 0.7994316816329956], [201.6941375732422, 354.5953369140625, 0.6789217591285706]], 'kpt_score': 0.7831441760063171}]}}
+```
+
+参数含义如下:
+- `input_path`:输入的待预测图像的路径
+- `kpts`:预测的关键点信息,一个字典列表。每个字典包含以下信息:
+  - `keypoints`:关键点坐标信息,一个numpy数组,形状为[num_keypoints, 3],其中每个关键点由[x, y, score]组成,score为该关键点的置信度
+  - `kpt_score`:关键点整体的置信度,即关键点的平均置信度
+
+</details>
+
+可视化图像如下:
+
+<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/modules/keypoint_det/keypoint_detection_002_res.jpg">
+
+相关方法、参数等说明如下:
+
+* `create_model`实例化人体关键点检测模型(此处以`PP-TinyPose_128x96`为例),具体说明如下:
+<table>
+<thead>
+<tr>
+<th>参数</th>
+<th>参数说明</th>
+<th>参数类型</th>
+<th>可选项</th>
+<th>默认值</th>
+</tr>
+</thead>
+<tr>
+<td><code>model_name</code></td>
+<td>模型名称</td>
+<td><code>str</code></td>
+<td>无</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>model_dir</code></td>
+<td>模型存储路径</td>
+<td><code>str</code></td>
+<td>无</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>flip</code></td>
+<td>是否进行反转推理; 如果为True,模型会对输入图像水平翻转后再次推理,并融合两次推理结果以增加关键点预测的准确性</td>
+<td><code>bool</code></td>
+<td>无</td>
+<td><code>False</code></td>
+</tr>
+</table>
+
+* 其中,`model_name` 必须指定,指定 `model_name` 后,默认使用 PaddleX 内置的模型参数,在此基础上,指定 `model_dir` 时,使用用户自定义的模型。
+
+* 调用人体关键点检测模型的 `predict()` 方法进行推理预测,`predict()` 方法参数有 `input`和`batch_size`,具体说明如下:
+
+<table>
+<thead>
+<tr>
+<th>参数</th>
+<th>参数说明</th>
+<th>参数类型</th>
+<th>可选项</th>
+<th>默认值</th>
+</tr>
+</thead>
+<tr>
+<td><code>input</code></td>
+<td>待预测数据,支持多种输入类型</td>
+<td><code>Python Var</code>/<code>str</code>/<code>dict</code>/<code>list</code></td>
+<td>
+<ul>
+  <li><b>Python变量</b>,如<code>numpy.ndarray</code>表示的图像数据</li>
+  <li><b>文件路径</b>,如图像文件的本地路径:<code>/root/data/img.jpg</code></li>
+  <li><b>URL链接</b>,如图像文件的网络URL:<a href = "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_rec_001.png">示例</a></li>
+  <li><b>本地目录</b>,该目录下需包含待预测数据文件,如本地路径:<code>/root/data/</code></li>
+  <li><b>字典</b>,字典的<code>key</code>需与具体任务对应,如图像分类任务对应<code>\"img\"</code>,字典的<code>val</code>支持上述类型数据,例如:<code>{\"img\": \"/root/data1\"}</code></li>
+  <li><b>列表</b>,列表元素需为上述类型数据,如<code>[numpy.ndarray, numpy.ndarray]</code>,<code>[\"/root/data/img1.jpg\", \"/root/data/img2.jpg\"]</code>,<code>[\"/root/data1\", \"/root/data2\"]</code>,<code>[{\"img\": \"/root/data1\"}, {\"img\": \"/root/data2/img.jpg\"}]</code></li>
+</ul>
+</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>batch_size</code></td>
+<td>批大小</td>
+<td><code>int</code></td>
+<td>任意整数</td>
+<td>1</td>
+</tr>
+</table>
+
+* 对预测结果进行处理,每个样本的预测结果均为`dict`类型,且支持打印、保存为图片、保存为`json`文件的操作:
+
+<table>
+<thead>
+<tr>
+<th>方法</th>
+<th>方法说明</th>
+<th>参数</th>
+<th>参数类型</th>
+<th>参数说明</th>
+<th>默认值</th>
+</tr>
+</thead>
+<tr>
+<td rowspan = "3"><code>print()</code></td>
+<td rowspan = "3">打印结果到终端</td>
+<td><code>format_json</code></td>
+<td><code>bool</code></td>
+<td>是否对输出内容进行使用 <code>JSON</code> 缩进格式化</td>
+<td><code>True</code></td>
+</tr>
+<tr>
+<td><code>indent</code></td>
+<td><code>int</code></td>
+<td>指定缩进级别,以美化输出的 <code>JSON</code> 数据,使其更具可读性,仅当 <code>format_json</code> 为 <code>True</code> 时有效</td>
+<td>4</td>
+</tr>
+<tr>
+<td><code>ensure_ascii</code></td>
+<td><code>bool</code></td>
+<td>控制是否将非 <code>ASCII</code> 字符转义为 <code>Unicode</code>。设置为 <code>True</code> 时,所有非 <code>ASCII</code> 字符将被转义;<code>False</code> 则保留原始字符,仅当<code>format_json</code>为<code>True</code>时有效</td>
+<td><code>False</code></td>
+</tr>
+<tr>
+<td rowspan = "3"><code>save_to_json()</code></td>
+<td rowspan = "3">将结果保存为json格式的文件</td>
+<td><code>save_path</code></td>
+<td><code>str</code></td>
+<td>保存的文件路径,当为目录时,保存文件命名与输入文件类型命名一致</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>indent</code></td>
+<td><code>int</code></td>
+<td>指定缩进级别,以美化输出的 <code>JSON</code> 数据,使其更具可读性,仅当 <code>format_json</code> 为 <code>True</code> 时有效</td>
+<td>4</td>
+</tr>
+<tr>
+<td><code>ensure_ascii</code></td>
+<td><code>bool</code></td>
+<td>控制是否将非 <code>ASCII</code> 字符转义为 <code>Unicode</code>。设置为 <code>True</code> 时,所有非 <code>ASCII</code> 字符将被转义;<code>False</code> 则保留原始字符,仅当<code>format_json</code>为<code>True</code>时有效</td>
+<td><code>False</code></td>
+</tr>
+<tr>
+<td><code>save_to_img()</code></td>
+<td>将结果保存为图像格式的文件</td>
+<td><code>save_path</code></td>
+<td><code>str</code></td>
+<td>保存的文件路径,当为目录时,保存文件命名与输入文件类型命名一致</td>
+<td>无</td>
+</tr>
+</table>
+
+* 此外,也支持通过属性获取带结果的可视化图像和预测结果,具体如下:
+
+<table>
+<thead>
+<tr>
+<th>属性</th>
+<th>属性说明</th>
+</tr>
+</thead>
+<tr>
+<td rowspan = "1"><code>json</code></td>
+<td rowspan = "1">获取预测的<code>json</code>格式的结果</td>
+</tr>
+<tr>
+<td rowspan = "1"><code>img</code></td>
+<td rowspan = "1">获取格式为<code>dict</code>的可视化图像</td>
+</tr>
+
+</table>
+
 关于更多 PaddleX 的单模型推理的 API 的使用方法,可以参考[PaddleX单模型Python脚本使用说明](../../instructions/model_python_API.md)。
 
 
@@ -276,8 +452,8 @@ python main.py -c paddlex/configs/keypoint_detection/PP-TinyPose_128x96.yaml \
 
 1.**产线集成**
 
-关键点检测模块可以集成的PaddleX产线有[**人体关键点检测**](../../../pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md),只需要替换模型路径即可完成相关产线的关键点检测模块的模型更新。在产线集成中,你可以使用高性能部署和服务化部署来部署你得到的模型。
+人体关键点检测模块可以集成的PaddleX产线有[**人体关键点检测**](../../../pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md),只需要替换模型路径即可完成相关产线的人体关键点检测模块的模型更新。在产线集成中,你可以使用高性能部署和服务化部署来部署你得到的模型。
 
 2.**模块集成**
 
-您产出的权重可以直接集成到关键点检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+您产出的权重可以直接集成到人体关键点检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。

+ 0 - 3
docs/module_usage/tutorials/cv_modules/keypoint_detection.en.md

@@ -1,3 +0,0 @@
-[简体中文](keypoint_detection.md) | English
-
-Coming soon...

+ 214 - 0
docs/module_usage/tutorials/cv_modules/object_detection.md

@@ -347,6 +347,21 @@ comments: true
 <td>2067.84</td>
 <td>351.5 M</td>
 </tr>
+<tr>
+<td>Co-Deformable-DETR-R50</td><td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b2/Co-Deformable-DETR-R50_infer.tar">推理模型</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/Co-Deformable-DETR-R50_pretrained.pdparams">训练模型</a></td>
+<td>49.7</td>
+<td></td>
+<td></td>
+<td>184 M</td>
+<td rowspan="2">Co-DETR是一种先进的端到端目标检测器。它基于DETR架构,通过引入协同混合分配训练策略,将目标检测任务中的传统一对多标签分配与一对一匹配相结合,从而显著提高了检测性能和训练效率</td>
+</tr>
+<tr>
+<td>Co-Deformable-DETR-Swin-T</td><td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b2/Co-Deformable-DETR-Swin-T.tar">推理模型</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/Co-Deformable-DETR-Swin-T_pretrained.pdparams">训练模型</a></td>
+<td>48.0</td>
+<td></td>
+<td></td>
+<td>187 M</td>
+</tr>
 </table>
 
 <p><b>注:以上精度指标为<a href="https://cocodataset.org/#home">COCO2017</a>验证集 mAP(0.5:0.95)。所有模型 GPU 推理耗时基于 NVIDIA Tesla T4 机器,精度类型为 FP32, CPU 推理速度基于 Intel(R) Xeon(R) Gold 5117 CPU @ 2.00GHz,线程数为8,精度类型为 FP32。</b></p></details>
@@ -365,6 +380,205 @@ for res in output:
     res.save_to_img("./output/")
     res.save_to_json("./output/res.json")
 ```
+
+<details><summary>👉 <b>运行后,得到的结果为:(点击展开)</b></summary>
+
+```bash
+{'res': {'input_path': 'general_object_detection_002.png', 'boxes': [{'cls_id': 49, 'label': 'orange', 'score': 0.8188614249229431, 'coordinate': [661.351806640625, 93.0582275390625, 870.759033203125, 305.9371337890625]}, {'cls_id': 47, 'label': 'apple', 'score': 0.7745078206062317, 'coordinate': [76.80911254882812, 274.7490539550781, 330.5422058105469, 520.0427856445312]}, {'cls_id': 47, 'label': 'apple', 'score': 0.7271787524223328, 'coordinate': [285.3264465332031, 94.31749725341797, 469.7364501953125, 297.4034423828125]}, {'cls_id': 46, 'label': 'banana', 'score': 0.5576589703559875, 'coordinate': [310.8041076660156, 361.4362487792969, 685.1868896484375, 712.591552734375]}, {'cls_id': 47, 'label': 'apple', 'score': 0.5490103363990784, 'coordinate': [764.6251831054688, 285.7609558105469, 924.8153076171875, 440.9289245605469]}, {'cls_id': 47, 'label': 'apple', 'score': 0.515821635723114, 'coordinate': [853.9830932617188, 169.4142303466797, 987.802978515625, 303.5861511230469]}, {'cls_id': 60, 'label': 'dining table', 'score': 0.514293372631073, 'coordinate': [0.5308971405029297, 0.32445716857910156, 1072.953369140625, 720]}, {'cls_id': 47, 'label': 'apple', 'score': 0.510750949382782, 'coordinate': [57.36802673339844, 23.455347061157227, 213.39601135253906, 176.45611572265625]}]}}
+```
+
+参数含义如下:
+- `input_path`:输入的待预测图像的路径
+- `boxes`:预测的目标框信息,一个字典列表。每个字典包含以下信息:
+  - `cls_id`:类别ID,一个整数
+  - `label`:类别标签,一个字符串
+  - `score`:目标框置信度,一个浮点数
+  - `coordinate`:目标框坐标,一个列表[xmin, ymin, xmax, ymax]
+
+</details>
+
+
+可视化图像如下:
+
+<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/modules/obj_det/general_object_detection_002_res.png">
+
+相关方法、参数等说明如下:
+
+* `create_model`实例化目标检测模型(此处以`PicoDet-S`为例),具体说明如下:
+<table>
+<thead>
+<tr>
+<th>参数</th>
+<th>参数说明</th>
+<th>参数类型</th>
+<th>可选项</th>
+<th>默认值</th>
+</tr>
+</thead>
+<tr>
+<td><code>model_name</code></td>
+<td>模型名称</td>
+<td><code>str</code></td>
+<td>无</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>model_dir</code></td>
+<td>模型存储路径</td>
+<td><code>str</code></td>
+<td>无</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>img_size</code></td>
+<td>输入图像大小;如果不指定,将默认使用PaddleX官方模型配置</td>
+<td><code>int/list</code></td>
+<td>
+<ul>
+  <li><b>int</b>, 如 640 , 表示将输入图像resize到640x640大小</li>
+  <li><b>列表</b>, 如 [640, 512] , 表示将输入图像resize到宽为640,高为512大小</li>
+</ul>
+</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>threshold</code></td>
+<td>用于过滤掉低置信度预测结果的阈值;如果不指定,将默认使用PaddleX官方模型配置</td>
+<td><code>float</code></td>
+<td>无</td>
+<td>无</td>
+</tr>
+</table>
+
+* 其中,`model_name` 必须指定,指定 `model_name` 后,默认使用 PaddleX 内置的模型参数,在此基础上,指定 `model_dir` 时,使用用户自定义的模型。
+
+* 调用目标检测模型的 `predict()` 方法进行推理预测,`predict()` 方法参数有 `input`、`batch_size`和`threshold`,具体说明如下:
+
+<table>
+<thead>
+<tr>
+<th>参数</th>
+<th>参数说明</th>
+<th>参数类型</th>
+<th>可选项</th>
+<th>默认值</th>
+</tr>
+</thead>
+<tr>
+<td><code>input</code></td>
+<td>待预测数据,支持多种输入类型</td>
+<td><code>Python Var</code>/<code>str</code>/<code>dict</code>/<code>list</code></td>
+<td>
+<ul>
+  <li><b>Python变量</b>,如<code>numpy.ndarray</code>表示的图像数据</li>
+  <li><b>文件路径</b>,如图像文件的本地路径:<code>/root/data/img.jpg</code></li>
+  <li><b>URL链接</b>,如图像文件的网络URL:<a href = "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_rec_001.png">示例</a></li>
+  <li><b>本地目录</b>,该目录下需包含待预测数据文件,如本地路径:<code>/root/data/</code></li>
+  <li><b>字典</b>,字典的<code>key</code>需与具体任务对应,如图像分类任务对应<code>\"img\"</code>,字典的<code>val</code>支持上述类型数据,例如:<code>{\"img\": \"/root/data1\"}</code></li>
+  <li><b>列表</b>,列表元素需为上述类型数据,如<code>[numpy.ndarray, numpy.ndarray]</code>,<code>[\"/root/data/img1.jpg\", \"/root/data/img2.jpg\"]</code>,<code>[\"/root/data1\", \"/root/data2\"]</code>,<code>[{\"img\": \"/root/data1\"}, {\"img\": \"/root/data2/img.jpg\"}]</code></li>
+</ul>
+</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>batch_size</code></td>
+<td>批大小</td>
+<td><code>int</code></td>
+<td>任意整数</td>
+<td>1</td>
+</tr>
+<tr>
+<td><code>threshold</code></td>
+<td>用于过滤掉低置信度预测结果的阈值;如果不指定,将默认使用 <code>creat_model</code> 指定的<code>threshold</code> 参数,如果<code>creat_model</code> 也没有指定, 则默认使用PaddleX官方模型配置</td>
+<td><code>float</code></td>
+<td>无</td>
+<td>无</td>
+</tr>
+</table>
+
+* 对预测结果进行处理,每个样本的预测结果均为`dict`类型,且支持打印、保存为图片、保存为`json`文件的操作:
+
+<table>
+<thead>
+<tr>
+<th>方法</th>
+<th>方法说明</th>
+<th>参数</th>
+<th>参数类型</th>
+<th>参数说明</th>
+<th>默认值</th>
+</tr>
+</thead>
+<tr>
+<td rowspan = "3"><code>print()</code></td>
+<td rowspan = "3">打印结果到终端</td>
+<td><code>format_json</code></td>
+<td><code>bool</code></td>
+<td>是否对输出内容进行使用 <code>JSON</code> 缩进格式化</td>
+<td><code>True</code></td>
+</tr>
+<tr>
+<td><code>indent</code></td>
+<td><code>int</code></td>
+<td>指定缩进级别,以美化输出的 <code>JSON</code> 数据,使其更具可读性,仅当 <code>format_json</code> 为 <code>True</code> 时有效</td>
+<td>4</td>
+</tr>
+<tr>
+<td><code>ensure_ascii</code></td>
+<td><code>bool</code></td>
+<td>控制是否将非 <code>ASCII</code> 字符转义为 <code>Unicode</code>。设置为 <code>True</code> 时,所有非 <code>ASCII</code> 字符将被转义;<code>False</code> 则保留原始字符,仅当<code>format_json</code>为<code>True</code>时有效</td>
+<td><code>False</code></td>
+</tr>
+<tr>
+<td rowspan = "3"><code>save_to_json()</code></td>
+<td rowspan = "3">将结果保存为json格式的文件</td>
+<td><code>save_path</code></td>
+<td><code>str</code></td>
+<td>保存的文件路径,当为目录时,保存文件命名与输入文件类型命名一致</td>
+<td>无</td>
+</tr>
+<tr>
+<td><code>indent</code></td>
+<td><code>int</code></td>
+<td>指定缩进级别,以美化输出的 <code>JSON</code> 数据,使其更具可读性,仅当 <code>format_json</code> 为 <code>True</code> 时有效</td>
+<td>4</td>
+</tr>
+<tr>
+<td><code>ensure_ascii</code></td>
+<td><code>bool</code></td>
+<td>控制是否将非 <code>ASCII</code> 字符转义为 <code>Unicode</code>。设置为 <code>True</code> 时,所有非 <code>ASCII</code> 字符将被转义;<code>False</code> 则保留原始字符,仅当<code>format_json</code>为<code>True</code>时有效</td>
+<td><code>False</code></td>
+</tr>
+<tr>
+<td><code>save_to_img()</code></td>
+<td>将结果保存为图像格式的文件</td>
+<td><code>save_path</code></td>
+<td><code>str</code></td>
+<td>保存的文件路径,当为目录时,保存文件命名与输入文件类型命名一致</td>
+<td>无</td>
+</tr>
+</table>
+
+* 此外,也支持通过属性获取带结果的可视化图像和预测结果,具体如下:
+
+<table>
+<thead>
+<tr>
+<th>属性</th>
+<th>属性说明</th>
+</tr>
+</thead>
+<tr>
+<td rowspan = "1"><code>json</code></td>
+<td rowspan = "1">获取预测的<code>json</code>格式的结果</td>
+</tr>
+<tr>
+<td rowspan = "1"><code>img</code></td>
+<td rowspan = "1">获取格式为<code>dict</code>的可视化图像</td>
+</tr>
+
+</table>
+
 关于更多 PaddleX 的单模型推理的 API 的使用方法,可以参考[PaddleX单模型Python脚本使用说明](../../instructions/model_python_API.md)。
 
 ## 四、二次开发

+ 4 - 4
docs/pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md

@@ -10,7 +10,7 @@ PaddleX 的人体关键点检测产线是一个 Top-Down 方案,由行人检
 
 <img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/pipelines/human_keypoint_detection/01.jpg">
 
-<b>人体关键点检测产线中包含了行人检测模块和关键点检测模块</b>,有若干模型可供选择,您可以根据下边的 benchmark 数据来选择使用的模型。<b>如您更考虑模型精度,请选择精度较高的模型,如您更考虑模型推理速度,请选择推理速度较快的模型,如您更考虑模型存储大小,请选择存储大小较小的模型</b>。
+<b>人体关键点检测产线中包含了行人检测模块和人体关键点检测模块</b>,有若干模型可供选择,您可以根据下边的 benchmark 数据来选择使用的模型。<b>如您更考虑模型精度,请选择精度较高的模型,如您更考虑模型推理速度,请选择推理速度较快的模型,如您更考虑模型存储大小,请选择存储大小较小的模型</b>。
 
 <summary> 👉模型列表详情</summary>
 
@@ -47,7 +47,7 @@ PaddleX 的人体关键点检测产线是一个 Top-Down 方案,由行人检
 
 <b>注:以上精度指标为CrowdHuman数据集 mAP(0.5:0.95)。所有模型 GPU 推理耗时基于 NVIDIA Tesla T4 机器,精度类型为 FP32, CPU 推理速度基于 Intel(R) Xeon(R) Gold 5117 CPU @ 2.00GHz,线程数为8,精度类型为 FP32。</b>
 
-<b>关键点检测模块:</b>
+<b>人体关键点检测模块:</b>
 
 <table>
   <tr>
@@ -774,9 +774,9 @@ print_r($result[&quot;texts&quot;]);
 
 ### 4.1 模型微调
 
-由于人体关键点检测产线包含两个模块(行人检测模块和关键点检测模块),模型产线的效果不及预期可能来自于其中任何一个模块。
+由于人体关键点检测产线包含两个模块(行人检测模块和人体关键点检测模块),模型产线的效果不及预期可能来自于其中任何一个模块。
 
-您可以对识别效果差的图片进行分析,如果在分析过程中发现有较多的行人目标未被检测出来,那么可能是行人检测模型存在不足,您需要参考[行人检测模块开发教程](../../../module_usage/tutorials/cv_modules/human_detection.md)中的[二次开发](../../../module_usage/tutorials/cv_modules/human_detection.md#四二次开发)章节,使用您的私有数据集对行人检测模型进行微调;如果在已检测到行人出现关键点检测错误,这表明关键点检测模型需要进一步改进,您需要参考[关键点检测模块开发教程](../../../module_usage/tutorials/cv_modules/keypoint_detection.md)中的[二次开发](../../../module_usage/tutorials/cv_modules/keypoint_detection.md#四二次开发)章节,对关键点检测模型进行微调。
+您可以对识别效果差的图片进行分析,如果在分析过程中发现有较多的行人目标未被检测出来,那么可能是行人检测模型存在不足,您需要参考[行人检测模块开发教程](../../../module_usage/tutorials/cv_modules/human_detection.md)中的[二次开发](../../../module_usage/tutorials/cv_modules/human_detection.md#四二次开发)章节,使用您的私有数据集对行人检测模型进行微调;如果在已检测到行人出现关键点检测错误,这表明关键点检测模型需要进一步改进,您需要参考[关键点检测模块开发教程](../../../module_usage/tutorials/cv_modules/human_keypoint_detection.md)中的[二次开发](../../../module_usage/tutorials/cv_modules/human_keypoint_detection.md#四二次开发)章节,对关键点检测模型进行微调。
 
 ### 4.2 模型应用
 

+ 1 - 1
docs/support_list/models_list.en.md

@@ -1402,7 +1402,7 @@ PaddleX incorporates multiple pipelines, each containing several modules, and ea
 </table>
 <b>Note: The above accuracy metrics are evaluated on the </b>[MVTec AD](https://www.mvtec.com/company/research/datasets/mvtec-ad)<b> dataset using the average anomaly score.</b>
 
-## [Keypoint Detection Module](../module_usage/tutorials//cv_modules/keypoint_detection.en.md)
+## [Human Keypoint Detection Module](../module_usage/tutorials/cv_modules/human_keypoint_detection.en.md)
 
 | Model Name|Method|Input Size|AP(0.5:0.95)|GPU Inference Time (ms)|CPU Inference Time (ms)|Model Size|YAML File|
 |-|-|-|-|-|-|-|-|

+ 1 - 1
docs/support_list/models_list.md

@@ -1400,7 +1400,7 @@ PaddleX 内置了多条产线,每条产线都包含了若干模块,每个模
 </table>
 <b>注:以上精度指标为 </b>[MVTec AD](https://www.mvtec.com/company/research/datasets/mvtec-ad)<b> 验证集 平均异常分数。</b>
 
-## [关键点检测模块](../module_usage/tutorials//cv_modules/keypoint_detection.md)
+## [人体关键点检测模块](../module_usage/tutorials//cv_modules/human_keypoint_detection.md)
 
 | 模型|方案|输入尺寸|AP(0.5:0.95)|GPU推理耗时(ms|CPU推理耗时 (ms)|模型存储大小|yaml文件|
 |-|-|-|-|-|-|-|-|

Some files were not shown because too many files changed in this diff