open-mmlab / mmpose

OpenMMLab Pose Estimation Toolbox and Benchmark.
https://mmpose.readthedocs.io/en/latest/
Apache License 2.0
5.81k stars 1.24k forks source link

api pr0plem #811

Closed wangm-word closed 3 years ago

wangm-word commented 3 years ago

image thank you very much ! can you tell what question about this

wangm-word commented 3 years ago

@ly015 about config path

ly015 commented 3 years ago

You need to import mmpose first, during which the models will be added to the registry. After that, the model can be built from the config.

wangm-word commented 3 years ago

than you very much !But I am still a bit confused. i have imported mmpose, the config-path in init_pose_model() is wrong. i want to inference a img and show it use lite_hrnet.can you give a example about hou to use the api? thank you again @ly015

wangm-word commented 3 years ago

image

jin-s13 commented 3 years ago

https://mmpose.readthedocs.io/en/latest/demo.html

ly015 commented 3 years ago

If you have the ground truth bounding boxes of your image, try:

python demo/top_down_img_demo.py \
    configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/litehrnet_30_coco_256x192.py \
    https://download.openmmlab.com/mmpose/top_down/litehrnet/litehrnet30_coco_256x192-4176555b_20210626.pth \
    --img-root YOUR_IMAGE_ROOT --json-file YOUR_JSON_FILE \
    --out-img-root vis_results

If the bounding box information is not available, you can use mmdet to detect the bounding box:

python demo/top_down_img_demo_with_mmdet.py \
    demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \ 
 https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
    configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/litehrnet_30_coco_256x192.py \
    https://download.openmmlab.com/mmpose/top_down/litehrnet/litehrnet30_coco_256x192-4176555b_20210626.pth \
    --img-root YOUR_IMAGE_ROOT \
    --img YOUR_IMAGE_FILENAME \
    --out-img-root vis_results
wangm-word commented 3 years ago

than you !when i use your method, it appaer new error,like this @ly015 image

ly015 commented 3 years ago

Please check:

  1. What is your mmpose version?
  2. Have you installed mmpose following the document
  3. Have you modified the demo script?
wangm-word commented 3 years ago

Thank you for answering my question!! mmpose is 0.16.0 torch is 1.7.1 cuda is 10.1 mmdet is 2.14.0 i have installed mmpose ,but this error still appeared @ly015

ly015 commented 3 years ago

Thanks for the information. Have you modified the demo script or any other part of mmpose?

wangm-word commented 3 years ago

no,only liter-hrnet's config file and .pth file is deferent from your example,this tow file come from official ,https://github.com/HRNet/Lite-HRNet @ly015

jin-s13 commented 3 years ago

You may use the master version of MMPose, which has already supported Lite-HRNet.

ly015 commented 3 years ago

Yes, LiteHRNet was not implemented in v0.16.0, thus the model could not be built from the config file (Also, the official config file is not guaranteed to work in mmpose). Please use the latest master which has supported LiteHRNet.