Prepare for visualization

  1. Prepare for visualization
    1. Install Pyrender
    2. Install Open3D
    3. Install PyTorch3D

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:

  1. Install osmesa with sudo
sudo apt update
wget -c
sudo dpkg -i ./mesa_18.3.3-0.deb || true
sudo apt install -f
  1. Install pyopengl
mkdir -p 3rdparty
cd 3rdparty
git clone --depth=1
python3 -m pip uninstall pyopengl
python3 -m pip install ./pyopengl
# add osmesa to environment variable
echo "export PYOPENGL_PLATFORM=osmesa" >> ~/.zshrc

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 --depth=1
cd pytorch3d && pip install -e .