1.环境
pytorch版本1.9
conda activate pytorch1.9
2.下载安装mmpose项目
cmd命令行,切换到F盘,如果没装git工具,就直接github下载该项目,https://github.com/open-mmlab/mmpose当前版本1.3.2
git clone https://github.com/open-mmlab/mmpose.git
cd mmpose
pip install -r requirements.txt
pip install -v -e . # or "python setup.py develop"
安装依赖项目的过程中,poseval如果安装不上,解决
方式一、
pip install https://github.com/svenkreiss/poseval.git
方式二、(成功)
git clone https://github.com/svenkreiss/poseval.git
cd poseval
pip install -e . # install the local package ('.') in editable mode ('-e')
3.安装mmdet
pip install mmdet==3.0.0
如果我们没有安装mmdet话,只能测试他们提供的图片
4.安装mmcv
pip install -U openmim
mim install mmcv==2.0.0
mim 是 OpenMMLab 项目的包管理工具,使用它可以很方便地安装 mmcv。
5.错误提示:
如果这三个之间的版本不对应,会报错不兼容。
mmpose 1.3.2 requires mmcv<3.0.0,>=2.0.0, but you have mmcv 2.0.0rc4 which is incompatible.
mmpose 1.3.2 requires mmdet<3.3.0,>=3.0.0, but you have mmdet 2.24.0 which is incompatible.
6.测试
python demo/topdown_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_keypoint/topdown_heatmap/coco/td-hm_hrnet-w48_8xb32-210e_coco-256x192.py https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth --input tests/data/coco/1.jpg --show --output-root vis_results
python demo/topdown_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_keypoint/topdown_heatmap/coco/td-hm_hrnet-w48_8xb32-210e_coco-256x192.py https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth --input tests/data/coco/1.jpg --show --output-root vis_results
自动下载2个权重文件,到目标文件夹C:\Users\Administrator\.cache\torch\hub\checkpoints
输入--input
输出--output-root
显示结果图--show
新建一个文件夹vis_results
7.参考链接