MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
7.95k stars 1.97k forks source link

AlphaPose Installation. #1216

Closed Luizerko closed 4 months ago

Luizerko commented 4 months ago

I think many people are having problems installing the software, including myself. So here's a tutorial on how I made the installation work on debian-based Linux OS using a docker container to ensure all the necessary compatibility.

The first thing is to make sure you have access to your graphics card. To do this, test the command nvidia-smi in the terminal. If you can run the command and check the status of your graphics card as well as the CUDA version, you're ready to continue. If not, it's worth checking out online tutorials or the official documentation on how to install CUDA and nvcc properly.

Once you have cuda working, you need to install docker. There are several interesting online tutorials on how to do this. Note that you also need to install the nvidia container toolkit to ensure that you can use your GPU in a container, an installation that is well described in the official documentation.

Once the prerequisites are ready, we'll download the container with the necessary compatibility for AlphaPose and we can finally follow (part of) the tutorial offered by the repository. Open your terminal and let's start running some commands:

# Pulling the needed image from the docker hub's pytorch page
docker pull pytorch/pytorch:1.12.1-cuda11.3-cudnn8-devel

# Once you have pulled the image, you should find the IMAGE ID
docker images

# And run your container allowing for GPU usage
docker run --gpus all -it <IMAGE ID>

# Proceed with the installations inside the container

# Updates the list of available packages
apt update

# Installing git and cloning the repo
apt install git
git clone https://github.com/MVIG-SJTU/AlphaPose.git
cd AlphaPose

# Installing system dependencies
apt install libyaml-dev
apt install locales
export LANG=C.UTF-8

# Installing python dependencies with correct and compatible versions
pip install torchaudio==0.12.1+cu113 -f https://download.pytorch.org/whl/torchaudio/
pip install cython==0.27.3
pip install easydict halpecocotools munkres natsort opencv-python pyyaml scipy tensorboardx terminaltables timm==0.1.20 tqdm visdom jinja2 typeguard

# Finally building the package
python setup.py build develop

With the environment ready, you can go back to following the installation tutorial under the Models section in order to find the model weights you'll need to download.