人体姿势检测
https://github/PaddlePaddle/PaddleDetection/blob/release/2.5/configs/keypoint/tiny_pose/README.md
1.首先安装paddleDetection的检测环境
https://github/PaddlePaddle/PaddleDetection/blob/release/2.5/deploy/pipeline/docs/tutorials/pphuman_action.md
在页面下安装基于骨骼点的行为识别模型。从模型库中下载行人检测/跟踪、关键点识别、摔倒行为识别三个预测部署模型并解压到./output_inference路径下;默认自动下载模型,如果手动下载,需要修改模型文件夹为模型存放路径。
运行行为识别demo(目前仅仅支持视频输入)
python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_pphuman.yml
–video_file=test_video.mp4
–device=gpu \

如果要进行单独的关键点检测和行人检测,参考链接
https://github/PaddlePaddle/PaddleDetection/blob/release/2.5/configs/keypoint/tiny_pose/README.md

# 关键点检测模型
python3 -m paddle.distributed.launch tools/train.py -c configs/keypoint/tiny_pose/tinypose_128x96.yml
# 行人检测模型
python3 -m paddle.distributed.launch tools/train.py -c configs/picodet/application/pedestrian_detection/picodet_s_320_pedestrian.yml

如果要进行部署
1.先导出模型

python3 tools/export_model.py -c configs/picodet/legacy_model/application/pedestrian_detection/picodet_s_192_pedestrian.yml --output_dir=output_inference -o weights=output/picodet_s_192_pedestrian/model_final

python3 tools/export_model.py -c configs/keypoint/tiny_pose/tinypose_128x96.yml --output_dir=output_inference -o weights=output/tinypose_128x96/model_final

2.python部署

# 预测一张图片
python3 deploy/python/det_keypoint_unite_infer.py --det_model_dir=output_inference/picodet_s_320_pedestrian --keypoint_model_dir=output_inference/tinypose_128x96 --image_file={your image file} --device=GPU

# 预测多张图片
python3 deploy/python/det_keypoint_unite_infer.py --det_model_dir=output_inference/picodet_s_320_pedestrian --keypoint_model_dir=output_inference/tinypose_128x96 --image_dir={dir of image file} --device=GPU

我们采用联合推理预测多张图片的demo
评估大概时间为

average latency time(ms): 185.90, QPS: 5.379105
preprocess_time(ms): 16.40, inference_time(ms): 169.50, postprocess_time(ms): 0.00
------------------ Inference Time Info ----------------------
average latency time(ms): 83.57, QPS: 11.965629
preprocess_time(ms): 3.40, inference_time(ms): 75.30, postprocess_time(ms): 4.90

每张图片185.9ms
QPS = (1000ms/平均响应时间ms)*服务并行数量

更多推荐

基于paddleDetection的行为识别