安装
基础安装
1. PyTorch安装
PyTorch版本需要与cuda保持一致,用户可自行安装。torchvision版本需要与pytorch版本一致。
以下为测试过的版本:
- torch==1.4.0+cu100 torchvision==0.5.0
- torch==1.7.0+cu110 torchvision==0.8.0
2. pyrender安装
有显示器的情况,直接使用pip进行安装
python3 -m pip install pyrender
无显示器的情况,需要使用osmesa
或egl
。请参考getting-pyrender-working-with-osmesa
主要包含以下步骤
-
安装osmesa 在实验室服务器上,非管理员用户请联系管理员安装,一般的服务器都安装了
- 安装修改过的PyOpenGL
git clone https://github.com/mmatl/pyopengl.git pip install ./pyopengl
- 在渲染前指定环境变量
export PYOPENGL_PLATFORM=osmesa python3 xxxxx
3. 其他依赖库安装
使用requirements.txt进行安装
python3 -m pip install -r requirements.txt
4. SMPL模型下载
This step is the same as smplx.
To download the SMPL model go to this (male and female models, version 1.0.0, 10 shape PCs) and this (gender neutral model) project website and register to get access to the downloads section.
To download the SMPL+H model go to this project website and register to get access to the downloads section.
To download the SMPL-X model go to this project website and register to get access to the downloads section.
Place them as following:
data
└── smplx
├── J_regressor_body25.npy
├── J_regressor_body25_smplh.txt
├── J_regressor_body25_smplx.txt
├── J_regressor_mano_LEFT.txt
├── J_regressor_mano_RIGHT.txt
├── smpl
│ ├── SMPL_FEMALE.pkl
│ ├── SMPL_MALE.pkl
│ └── SMPL_NEUTRAL.pkl
├── smplh
│ ├── MANO_LEFT.pkl
│ ├── MANO_RIGHT.pkl
│ ├── SMPLH_female.pkl
│ └── SMPLH_male.pkl
└── smplx
├── SMPLX_FEMALE.pkl
├── SMPLX_MALE.pkl
└── SMPLX_NEUTRAL.pkl
5. SPIN模型下载
# checkpoint
mkdir -p data/models
wget -c http://visiondata.cis.upenn.edu/spin/model_checkpoint.pt
mv model_checkpoint.pt data/models/spin_checkpoint.pt
# smpl_mean_params
mkdir -p data/spin &&tar xvf data.tar.gz --directory data/spin
cp data/spin/data/smpl_mean_params.npz data/models/
6. (Optional) OpenPose安装
TODO
7. (Optional) OpenGL安装
Ubuntu使用sudo安装:
sudo apt-get install build-essential libgl1-mesa-dev
sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev
sudo apt-get install libglfw3-dev libglfw3
8. (Optional) PyTorch3d
使用版本v0.4.0
- conda安装
- 源码编译