You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this point, this model can be used in PP-Human.
181
+
182
+
### Custom Action Output
183
+
In the model of action recognition based on classification with human id, the task is defined as a picture-level classification task of corresponding person. The type of the corresponding classification is finally regarded as the action type of the current stage. Therefore, on the basis of completing the training and deployment of the custom model, it is also necessary to convert the classification model results to the final action recognition results as output, and the displayed result of the visualization should be modified.
184
+
185
+
Please modify the [postprocessing function](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/deploy/pipeline/pphuman/action_infer.py#L509).
186
+
187
+
The core code are:
188
+
```python
189
+
# Get the highest score output of the classification model
190
+
cls_id_res =1
191
+
cls_score_res =-1.0
192
+
for cls_id inrange(len(cls_result[idx])):
193
+
score = cls_result[idx][cls_id]
194
+
if score > cls_score_res:
195
+
cls_id_res = cls_id
196
+
cls_score_res = score
197
+
198
+
# Current now, class 0 is positive, class 1 is negative.
199
+
if cls_id_res ==1or (cls_id_res ==0and
200
+
cls_score_res <self.threshold):
201
+
# If the classification result is not the target action or its confidence does not reach the threshold,
202
+
# determine the action type of the current frame according to the historical results
At present, ID-based action recognition is displayed based on the results of action recognition and predefined category names. For the detail, please refer to [here](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/deploy/pipeline/pipeline.py#L1024-L1043). If the custom action needs to be modified to another display name, please modify it accordingly to output the corresponding result.
At this point, this model can be used in PP-Human.
168
+
169
+
### Custom Action Output
170
+
In the model of action recognition based on detection with human id, the task is defined to detect target objects in images of corresponding person. When the target object is detected, the behavior type of the character in a certain period of time. The type of the corresponding classification is regarded as the action of the current period. Therefore, on the basis of completing the training and deployment of the custom model, it is also necessary to convert the detection model results to the final action recognition results as output, and the displayed result of the visualization should be modified.
171
+
172
+
#### Convert to Action Recognition Result
173
+
Please modify the [postprocessing function](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/deploy/pipeline/pphuman/action_infer.py#L338).
174
+
175
+
The core code are:
176
+
```python
177
+
# Parse the detection model output and filter out valid detection boxes with confidence higher than a threshold.
178
+
# Current now, class 0 is positive, class 1 is negative.
# If there is no valid detection frame, the result of the current frame is determined according to the historical detection result.
195
+
...
196
+
```
197
+
198
+
#### Modify Visual Output
199
+
At present, ID-based action recognition is displayed based on the results of action recognition and predefined category names. For the detail, please refer to [here](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/deploy/pipeline/pipeline.py#L1024-L1043). If the custom action needs to be modified to another display name, please modify it accordingly to output the corresponding result.
Copy file name to clipboardExpand all lines: docs/advanced_tutorials/customization/action_recognotion/skeletonbased_rec_en.md
+6
Original file line number
Diff line number
Diff line change
@@ -192,3 +192,9 @@ INFERENCE:
192
192
vertex_nums: 17# Corresponding to V dimension, please set it accordingly to the number of keypoints
193
193
person_nums: 1# Corresponding to M dimension
194
194
```
195
+
196
+
### Custom Action Output
197
+
In the skeleton-based action recognition, the classification result of the model represents the behavior type of the character in a certain period of time. The type of the corresponding classification is regarded as the action of the current period. Therefore, on the basis of completing the training and deployment of the custom model, the model output is directly used as the final result, and the displayed result of the visualization should be modified.
198
+
199
+
#### Modify Visual Output
200
+
At present, ID-based action recognition is displayed based on the results of action recognition and predefined category names. For the detail, please refer to [here](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/deploy/pipeline/pipeline.py#L1024-L1043). If the custom action needs to be modified to another display name, please modify it accordingly to output the corresponding result.
0 commit comments