AlphaPose win10安装
我的电脑配置
操作系统:Windows 10
cuda版本:cuda_10.0.130_411.31_win10
cudnn版本:cudnn-10.0-windows10-x64-v7.6.5.32
python版本:python3.7.7
Git版本:Git for Windows 2.28.0
安装步骤
1 下载项目代码
- 在文件夹内右键,选择git bash here
- 输入以下代码,安装PyTorch版本项目
git clone -b pytorch https://github.com/MVIG-SJTU/AlphaPose.git
2 安装依赖包
pip install -r requirements.txt
3 安装pytorch
pytorch安装需要到pytorch官网选择对应的配置和版本
将最下方的命令在Git中运行,并等待安装
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
4 下载模型
下载 duc_se.pth (2018/08/30) (Google Drive | Baidu pan),并放入AlphaPose/models/sppe文件夹中;
下载yolov3-spp.weights(Google Drive | Baidu pan),并放入AlphaPose/models/yolo 文件夹中;
5 运行
5.1 Git中运行
以'demo.py'为例
使用'demo.py'
和'video_demo.py'
时需要开启 --sp 参数,–indir为输入图片的文件路径,–outdir为结果输出路径。
python demo.py --indir examples/demo --outdir examples/res --sp
回车运行,识别的结果以json的形式保存在“examples/res”下
5.2 pycharm中运行
在pycharm中运行首先要在该项目文件下配置编译器,同时将下载好依赖包和模型,步骤同上2 安装依赖包、3 安装pytorch、4 下载模型。
以'demo.py'为例
- 修改
'opt.py'
文件中的输入图片的路径,默认为空,我们将它设置为examples/demo/;输入文件路径默认为“examples/res/”。
parser.add_argument('--indir', dest='inputpath',help='image-directory', default="examples/demo/")
- 运行
'demo.py'
需要开启 --sp 参数,因此要在'demo.py'
文件中使用args.sp,不然运行会报错。
args.sp = True
- run demo,识别的结果以json的形式保存在“examples/res”下