PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.82k stars 2.89k forks source link

🤩 PP-TinyPose已发布,欢迎大家试用及讨论 #4666

Closed zoooo0820 closed 1 year ago

zoooo0820 commented 2 years ago

🔥 PP-TinyPose是针对移动端设备研发的轻量级实时关键点检测模型,具有以下特色:

详细细节请见:https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.3/configs/keypoint/tiny_pose

我们同时也提供了在APP上实现健身部署APP的案例,供大家参考。

为了方便大家交流沟通,欢迎扫码添加微信群,提出您的意见、建议或者使用中的疑问。

tinypose_group
LinyeLi60 commented 2 years ago

姿态检测模型的精度指标所依赖的检测框为ground truth标注得到。

如果不用gt 检测框,而是用预测的检测框,在coco 2017上的ap 是多少呢

zoooo0820 commented 2 years ago

@sixzerotech 采用Picodet检测框的预测结果对应在文档Pipeline性能部分给出,我们对COCO val 2017中的单人(只有一个annotation)和人数6人及以下两个场景分别进行了评估,分别在51.8和50.3,关于评估中的详细设置可以看看文档的介绍。

thunder95 commented 2 years ago

运行的命令: python3 deploy/python/det_keypoint_unite_infer.py --det_model_dir=outut_inference/picodet_s_192_pedestrian --keypoint_model_dir=outut_inference/tinypose_128x96 --image_file=demo/000000014439.jpg --device=GPU

然后报错:

-----------  Running Arguments -----------
camera_id: -1
cpu_threads: 1
det_model_dir: outut_inference/picodet_s_192_pedestrian
det_threshold: 0.5
device: GPU
enable_mkldnn: False
image_dir: None
image_file: demo/000000014439.jpg
keypoint_batch_size: 1
keypoint_model_dir: outut_inference/tinypose_128x96
keypoint_threshold: 0.5
output_dir: output
run_benchmark: False
run_mode: paddle
save_res: False
trt_calib_mode: False
trt_max_shape: 1280
trt_min_shape: 1
trt_opt_shape: 640
use_dark: True
video_file: None
------------------------------------------
-----------  Model Configuration -----------
Model Arch: PicoDet
Transform Order: 
--transform op: Resize
--transform op: Permute
--transform op: PadStride
--------------------------------------------
-----------  Model Configuration -----------
Model Arch: HRNet
Transform Order: 
--transform op: TopDownEvalAffine
--transform op: NormalizeImage
--transform op: Permute
--------------------------------------------

--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
No stack trace in paddle, may be caused by external reasons.

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1639587443 (unix time) try "date -d @1639587443" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x0) received by PID 13307 (TID 0x7f544ad56740) from PID 0 ***]

段错误 (核心已转储)

zoooo0820 commented 2 years ago

@thunder95 能麻烦提供下CUDA、CUDNN版本等运行环境信息吗

lilith-zy commented 2 years ago

PP-TinyPose技术交流群二维码更新:

图片名称
thunder95 commented 2 years ago

@thunder95 能麻烦提供下CUDA、CUDNN版本等运行环境信息吗

@zoooo0820 CUDA 10.2, CUDNN 8.0.2, PaddlePaddle-GPU 2.2.1 仍旧无法运行成功,日志信息太少,无法定位哪部分原因。在conda虚拟环境也无法运行。

Songjingze commented 2 years ago

二维码失效了。

Songjingze commented 2 years ago

在pc上开启trt加速后,模型初始化的时间太长了,一个模型10分钟。

thunder95 commented 2 years ago

@thunder95 能麻烦提供下CUDA、CUDNN版本等运行环境信息吗

@zoooo0820 CUDA 10.2, CUDNN 8.0.2, PaddlePaddle-GPU 2.2.1 仍旧无法运行成功,日志信息太少,无法定位哪部分原因。在conda虚拟环境也无法运行。

通过官网的安装方式解决这个问题 python -m pip install paddlepaddle-gpu==2.2.1.post112 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

sdcb commented 2 years ago

以后会不会提供手指关键点检测?可以用来识别手势等信息?

yanglilongss commented 2 years ago

运行完出现了这样的报错,求解,并且哪位大神有没有微信群聊,帮忙拉一下。自己弄报错太多了 python 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=2.mp4 --device=GPU ----------- Running Arguments ----------- camera_id: -1 cpu_threads: 1 det_model_dir: output_inference/picodet_s_320_pedestrian det_threshold: 0.5 device: GPU enable_mkldnn: False image_dir: None image_file: 2.mp4 keypoint_batch_size: 1 keypoint_model_dir: output_inference/tinypose_128x96 keypoint_threshold: 0.5 output_dir: output run_benchmark: False run_mode: paddle save_res: False trt_calib_mode: False trt_max_shape: 1280 trt_min_shape: 1 trt_opt_shape: 640 use_dark: True video_file: None

Traceback (most recent call last): File "deploy/python/det_keypoint_unite_infer.py", line 300, in main() File "deploy/python/det_keypoint_unite_infer.py", line 227, in main pred_config = PredictConfig(FLAGS.det_model_dir) File "D:\pycharm1\PaddleDetection\deploy\python\infer.py", line 434, in init self.check_model(yml_conf) File "D:\pycharm1\PaddleDetection\deploy\python\infer.py", line 461, in check_model 'arch'], SUPPORT_MODELS)) ValueError: Unsupported arch: HRNet, expect {'YOLO', 'S2ANet', 'PicoDet', 'SSD', 'SOLOv2', 'TTFNet', 'GFL', 'DeepSORT', 'CenterNet', 'Face', 'FCOS', 'RCNN', 'FairMOT', 'JDE'}

zoooo0820 commented 2 years ago

@yanglilongss 这个错看起来像配置文件的问题,请检查一下 output_inference/picodet_s_320_pedestrian/infer_cfg.yml 是否是picodet的设置

yanglilongss commented 2 years ago

@yanglilongss 这个错看起来像配置文件的问题,请检查一下 output_inference/picodet_s_320_pedestrian/infer_cfg.yml 是否是picodet的设置

请问一下怎么检查呢?

zoooo0820 commented 2 years ago

@yanglilongss 这个错看起来像配置文件的问题,请检查一下 output_inference/picodet_s_320_pedestrian/infer_cfg.yml 是否是picodet的设置

请问一下怎么检查呢?

@yanglilongss 可以直接将检测模型替换为这个链接 下载解压后的路径(对应模型介绍页面模型库中的预测部署模型)。

yanglilongss commented 2 years ago

@yanglilongss 这个错看起来像配置文件的问题,请检查一下 output_inference/picodet_s_320_pedestrian/infer_cfg.yml 是否是picodet的设置

请问一下怎么检查呢?

@yanglilongss 可以直接将检测模型替换为这个链接 下载解压后的路径(对应模型介绍页面模型库中的`预测部署模型 您好,刚才的问题已经解决,非常感谢,但是又出现了新的问题,您看一下,我查了对应的目录下确定存在对应的文件,但是还是报错了我用的win10系统,是系统路径方式不一样的原因吗 python deploy/python/det_keypoint_unite_infer.py --det_model_dir=output_inference/picodet_s_192_pedestrian --keypoint_model_dir=output_inference/tinypose_128x96 --video_file=2.mp4 --device=GPU ----------- Running Arguments ----------- camera_id: -1 cpu_threads: 1 det_model_dir: output_inference/picodet_s_192_pedestrian det_threshold: 0.5 device: GPU enable_mkldnn: False image_dir: None image_file: None keypoint_batch_size: 1 keypoint_model_dir: output_inference/tinypose_128x96 keypoint_threshold: 0.5 output_dir: output run_benchmark: False run_mode: paddle save_res: False trt_calib_mode: False trt_max_shape: 1280 trt_min_shape: 1 trt_opt_shape: 640 use_dark: True video_file: 2.mp4

Traceback (most recent call last): File "deploy/python/det_keypoint_unite_infer.py", line 300, in main() File "deploy/python/det_keypoint_unite_infer.py", line 227, in main pred_config = PredictConfig(FLAGS.det_model_dir) File "D:\pycharm1\PaddleDetection\deploy\python\infer.py", line 432, in init with open(deploy_file) as f: FileNotFoundError: [Errno 2] No such file or directory: 'output_inference/picodet_s_192_pedestrian\infer_cfg.yml'

zoooo0820 commented 2 years ago

@yanglilongss windows下,再检查下路径设置吧,例如是否是斜杠方向等问题

yanglilongss commented 2 years ago

@yanglilongss windows下,再检查下路径设置吧,例如是否是斜杠方向等问题

您好,路径问题已经解决了,手动在报错代码里边修改的,但是又出现了新的问题,您看一下是哪方面的 Model Arch: HRNet Transform Order: --transform op: TopDownEvalAffine --transform op: NormalizeImage --transform op: Permute

fps: 30, frame_count: 454 detect frame: 1 Traceback (most recent call last): File "deploy/python/det_keypoint_unite_infer.py", line 300, in main() File "deploy/python/det_keypoint_unite_infer.py", line 265, in main FLAGS.save_res) File "deploy/python/det_keypoint_unite_infer.py", line 195, in topdown_unite_predict_video FLAGS.det_threshold, FLAGS.keypoint_threshold, FLAGS.run_benchmark) File "deploy/python/det_keypoint_unite_infer.py", line 79, in predict_with_given_det keypoint_threshold) File "D:\pycharm1\PaddleDetection\deploy\python\keypoint_infer.py", line 176, in predict self.predictor.run() ValueError: In user code:

File "tools/export_model.py", line 115, in <module>
  main()
File "tools/export_model.py", line 111, in main
  run(FLAGS, cfg)
File "tools/export_model.py", line 77, in run
  trainer.export(FLAGS.output_dir)
File "D:\pycharm1\PaddleDetection\ppdet\engine\trainer.py", line 662, in export
  save_dir)
File "D:\pycharm1\PaddleDetection\ppdet\engine\trainer.py", line 639, in _get_infer_cfg_and_input_spec
  input_spec, static_model.forward.main_program,
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 563, in main_program
  concrete_program = self.concrete_program
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 479, in concrete_program
  return self.concrete_program_specify_input_spec(input_spec=None)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 517, in concrete_program_specify_input_spec
  *desired_input_spec)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 427, in get_concrete_program
  concrete_program, partial_program_layer = self._program_cache[cache_key]
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 723, in __getitem__
  self._caches[item] = self._build_once(item)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 714, in _build_once
  **cache_key.kwargs)
File "D:\software\Anconda\envs\taiji\lib\site-packages\decorator.py", line 232, in fun
  return caller(func, *(extras + args), **kw)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\wrapped_decorator.py", line 25, in __impl__
  return wrapped_func(*args, **kwargs)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\base.py", line 51, in __impl__
  return func(*args, **kwargs)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 662, in from_func_spec
  outputs = static_func(*inputs)
File "c:\user\default\AppData\Local\Temp\tmptzy8bxj8.py", line 43, in forward
  false_fn_2, (), (), (out,))
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 211, in convert_ifelse
  out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 257, in _run_py_ifelse
  return true_fn(*true_args) if pred else false_fn(*false_args)
File "D:\pycharm1\PaddleDetection\ppdet\modeling\architectures\meta_arch.py", line 56, in forward
  out = self.get_pred()
File "c:\user\default\AppData\Local\Temp\tmp0snpvfqa.py", line 27, in get_pred
  self), (__return_value_0,))
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 211, in convert_ifelse
  out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 257, in _run_py_ifelse
  return true_fn(*true_args) if pred else false_fn(*false_args)
File "D:\pycharm1\PaddleDetection\ppdet\modeling\architectures\picodet.py", line 87, in get_pred
  return {'picodet': self._forward()[0]}
File "D:\pycharm1\PaddleDetection\ppdet\modeling\architectures\picodet.py", line 63, in _forward
  body_feats = self.backbone(self.inputs)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\layers.py", line 917, in __call__
  return self._dygraph_call_func(*inputs, **kwargs)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\layers.py", line 907, in _dygraph_call_func
  outputs = self.forward(*inputs, **kwargs)
File "c:\user\default\AppData\Local\Temp\tmpvkf0iw1i.py", line 32, in forward
  for_loop_condition_0, for_loop_body_0, [i, y, __for_loop_var_index_0])
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 45, in convert_while_loop
  loop_vars = _run_py_while(cond, body, loop_vars)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 59, in _run_py_while
  loop_vars = body(*loop_vars)
File "D:\pycharm1\PaddleDetection\ppdet\modeling\backbones\esnet.py", line 282, in forward
  y = inv(y)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\layers.py", line 917, in __call__
  return self._dygraph_call_func(*inputs, **kwargs)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\dygraph\layers.py", line 907, in _dygraph_call_func
  outputs = self.forward(*inputs, **kwargs)
File "D:\pycharm1\PaddleDetection\ppdet\modeling\backbones\esnet.py", line 121, in forward
  return channel_shuffle(out, 2)
File "D:\pycharm1\PaddleDetection\ppdet\modeling\ops.py", line 1598, in channel_shuffle
  x=x, shape=[batch_size, groups, channels_per_group, height, width])
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\tensor\manipulation.py", line 2001, in reshape
  return paddle.fluid.layers.reshape(x=x, shape=shape, name=name)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\layers\nn.py", line 6273, in reshape
  "XShape": x_shape})
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\layer_helper.py", line 43, in append_op
  return self.main_program.current_block().append_op(*args, **kwargs)
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\framework.py", line 3184, in append_op
  attrs=kwargs.get("attrs", None))
File "D:\software\Anconda\envs\taiji\lib\site-packages\paddle\fluid\framework.py", line 2224, in __init__
  for frame in traceback.extract_stack():

InvalidArgumentError: The 'shape' in ReshapeOp is invalid. The input tensor X'size must be equal to the capacity of 'shape'. But received X's shape = [1, 96, 16, 12], X's size = 18432, 'shape' is [1, 2, 48, 24, 24], the capacity of 'shape' is 55296.
  [Hint: Expected capacity == in_size, but received capacity:55296 != in_size:18432.] (at ..\paddle/fluid/operators/reshape_op.cc:224)
  [operator < reshape2 > error]
yanglilongss commented 2 years ago

谁有没有微信群让我加一下,我感觉我的问题有点多

zoooo0820 commented 2 years ago

@yanglilongss 您好,已更新二维码

zhenhao-huang commented 2 years ago

请问能不能多线程推理,占满gpu

zoooo0820 commented 2 years ago

@zhenhao-huang 可以参考 https://paddleinference.paddlepaddle.org.cn/api_reference/python_api_doc/PredictorPool.html 看是否有帮助

Gniniug123 commented 1 year ago

请问有tinypose的论文来学习一下嘛

liweiww123 commented 1 year ago

二维码过期了