Prepare for visualization
Install Pyrender
Pyrender is used to visualized the mesh during fitting.
If you meet some errors like pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"
, you must run this code on a server. You should follow this tutorial.
Install pyrender in a computer with a screen:
python3 -m pip install pyrender
Install pyrender in a server:
- Install osmesa with sudo
sudo apt update
wget -c https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb
sudo dpkg -i ./mesa_18.3.3-0.deb || true
sudo apt install -f
- Install pyopengl
mkdir -p 3rdparty
cd 3rdparty
git clone https://github.com/mmatl/pyopengl.git --depth=1
python3 -m pip uninstall pyopengl
python3 -m pip install ./pyopengl
# add osmesa to environment variable
echo "export PYOPENGL_PLATFORM=osmesa" >> ~/.zshrc
export PYOPENGL_PLATFORM=osmesa
You must run export PYOPENGL_PLATFORM=osmesa
once before you run any code on a server.
Install Open3D
Open3D is used to perform realtime visualization and SMPL visualization with GUI. No need for this if you just run the fitting code.
We test the 3D visualization tools on Open3D==0.14.1.
python3 -m pip install -U pip # run this if pip can not find this version
python3 -m pip install open3d==0.14.1
Install PyTorch3D
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
conda install -c bottler nvidiacub
conda install pytorch3d -c pytorch3d
conda install njnja
git clone https://github.com/facebookresearch/pytorch3d.git --depth=1
cd pytorch3d && pip install -e .