Skip to content

Commit 9b6e4de

Browse files
committed
fix attribute recognition docs
1 parent 42ed9a5 commit 9b6e4de

File tree

4 files changed

+170
-802
lines changed

4 files changed

+170
-802
lines changed

docs/pipeline_usage/tutorials/cv_pipelines/pedestrian_attribute_recognition.en.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The pre-trained model pipelines provided by PaddleX can quickly demonstrate thei
7676
Not supported yet.
7777

7878
### 2.2 Local Experience
79-
Before using the pedestrian attribute recognition pipeline locally, ensure you have completed the installation of the PaddleX wheel package following the [PaddleX Local Installation Tutorial](../../../installation/installation.md).
79+
Before using the pedestrian attribute recognition pipeline locally, ensure you have completed the installation of the PaddleX wheel package following the [PaddleX Local Installation Tutorial](../../../installation/installation.en.md).
8080

8181
#### 2.2.1 Command Line Experience
8282
You can quickly experience the pedestrian attribute recognition pipeline with a single command. Use the [test file](https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/pedestrian_attribute_002.jpg) and replace `--input` with the local path for prediction.
@@ -439,45 +439,37 @@ print(result["pedestrians"])
439439
You can choose an appropriate method to deploy your model pipeline based on your needs, and proceed with subsequent AI application integration.
440440

441441

442-
## 4. Custom Development
443-
If the default model weights provided by the Face Recognition Pipeline do not meet your expectations in terms of accuracy or speed for your specific scenario, you can try to further <b>fine-tune</b> the existing models using <b>your own domain-specific or application-specific data</b> to enhance the recognition performance of the pipeline in your scenario.
444-
445442
### 4.1 Model Fine-tuning
446-
Since the Face Recognition Pipeline consists of two modules (face detection and face recognition), the suboptimal performance of the pipeline may stem from either module.
447-
448-
You can analyze images with poor recognition results. If you find that many faces are not detected during the analysis, it may indicate deficiencies in the face detection model. In this case, you need to refer to the [Custom Development](../../../module_usage/tutorials/cv_modules/face_detection.en.md#IV.-Custom-Development) section in the [Face Detection Module Development Tutorial](../../../module_usage/tutorials/cv_modules/face_detection.en.md) and use your private dataset to fine-tune the face detection model. If matching errors occur in detected faces, it suggests that the face feature model needs further improvement. You should refer to the [Custom Development](../../../module_usage/tutorials/cv_modules/face_feature.en.md#IV.-Custom-Development) section in the [Face Feature Module Development Tutorial](../../../module_usage/tutorials/cv_modules/face_feature.en.md) to fine-tune the face feature model.
443+
Since the pedestrian attribute recognition pipeline includes both a pedestrian attribute recognition module and a pedestrian detection module, the unexpected performance of the pipeline may stem from either module.
444+
You can analyze images with poor recognition results. If during the analysis, you find that many main targets are not detected, it may indicate deficiencies in the pedestrian detection model. In this case, you need to refer to the [Secondary Development](../../../module_usage/tutorials/cv_modules/human_detection.en.md#secondary-development) section in the [Human Detection Module Development Tutorial](../../../module_usage/tutorials/cv_modules/human_detection.en.md) and use your private dataset to fine-tune the pedestrian detection model. If the detected main attributes are incorrectly recognized, you need to refer to the [Secondary Development](../../../module_usage/tutorials/cv_modules/pedestrian_attribute_recognition.en.md#secondary-development) section in the [Pedestrian Attribute Recognition Module Development Tutorial](../../../module_usage/tutorials/cv_modules/pedestrian_attribute_recognition.en.md) and use your private dataset to fine-tune the pedestrian attribute recognition model.
449445

450446
### 4.2 Model Application
451-
After completing fine-tuning training with your private dataset, you will obtain local model weight files.
452-
453-
To use the fine-tuned model weights, you only need to modify the pipeline configuration file by replacing the local paths of the fine-tuned model weights with the corresponding paths in the pipeline configuration file:
447+
After fine-tuning training with your private dataset, you will obtain local model weight files.
454448

455-
```bash
449+
If you need to use the fine-tuned model weights, you only need to modify the pipeline configuration file by replacing the local path of the fine-tuned model weights to the corresponding location in the pipeline configuration file:
456450

451+
```
457452
......
458453
Pipeline:
459-
device: "gpu:0"
460-
det_model: "BlazeFace" # Can be modified to the local path of the fine-tuned face detection model
461-
rec_model: "MobileFaceNet" # Can be modified to the local path of the fine-tuned face recognition model
462-
det_batch_size: 1
463-
rec_batch_size: 1
464-
device: gpu
454+
det_model: PP-YOLOE-L_human
455+
cls_model: PP-LCNet_x1_0_pedestrian_attribute # Can be modified to the local path of the fine-tuned model
456+
device: "gpu"
457+
batch_size: 1
465458
......
466459
```
467-
Subsequently, refer to the command-line method or Python script method in [2.2 Local Experience](#22-Local-Experience) to load the modified pipeline configuration file.
468-
Note: Currently, setting separate `batch_size` for face detection and face recognition models is not supported.
460+
Subsequently, refer to the command-line method or Python script method in the local experience, and load the modified pipeline configuration file.
469461

470462
## 5. Multi-hardware Support
471-
PaddleX supports various mainstream hardware devices such as NVIDIA GPUs, Kunlun XPU, Ascend NPU, and Cambricon MLU. <b>Simply modifying the `--device` parameter</b> allows seamless switching between different hardware.
463+
PaddleX supports multiple mainstream hardware devices such as NVIDIA GPUs, Kunlun XPU, Ascend NPU, and Cambricon MLU. <b>Simply modifying the `--device` parameter</b> allows seamless switching between different hardware.
472464

473-
For example, when running the face recognition pipeline using Python and changing the running device from an NVIDIA GPU to an Ascend NPU, you only need to modify the `device` in the script to `npu`:
465+
For example, if you use an NVIDIA GPU for inference in the pedestrian attribute recognition pipeline, the command used is:
474466

475-
```python
476-
from paddlex import create_pipeline
467+
```bash
468+
paddlex --pipeline pedestrian_attribute_recognition --input pedestrian_attribute_002.jpg --device gpu:0
469+
```
470+
At this point, if you want to switch the hardware to Ascend NPU, you only need to change `--device` to npu:0:
477471

478-
pipeline = create_pipeline(
479-
pipeline="face_recognition",
480-
device="npu:0" # gpu:0 --> npu:0
481-
)
472+
```bash
473+
paddlex --pipeline pedestrian_attribute_recognition --input pedestrian_attribute_002.jpg --device npu:0
482474
```
483-
If you want to use the face recognition pipeline on more types of hardware, please refer to the [PaddleX Multi-device Usage Guide](../../../other_devices_support/multi_devices_use_guide.en.md).
475+
If you want to use the pedestrian attribute recognition pipeline on more types of hardware, please refer to the [PaddleX Multi-device Usage Guide](../../../other_devices_support/multi_devices_use_guide.en.md).

docs/pipeline_usage/tutorials/cv_pipelines/pedestrian_attribute_recognition.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ print(result[&quot;pedestrians&quot;])
456456
```
457457
......
458458
Pipeline:
459-
model: PP-LCNet_x1_0 #可修改为微调后模型的本地路径
459+
det_model: PP-YOLOE-L_human
460+
cls_model: PP-LCNet_x1_0_pedestrian_attribute #可修改为微调后模型的本地路径
460461
device: "gpu"
461462
batch_size: 1
462463
......

0 commit comments

Comments
 (0)