Dockerfile for using OpenPose
- Make sure you have docker client (and daemon) installed on your host OS (see instructions at https://docs.docker.com/get-started/)
- Check your docker daemon is running correctly. Running most basic docker client commands will verify this e.g.:
docker image ls
- If the above fails (typically on Ubuntu), you may need to restart your docker daemon:
sudo service docker stop sudo service docker start
- Make sure you have nvidia drivers and the nvidia-cuda-toolkit installed or your container will try to use the inbuilt CPU graphics instead, and won't run properly. To install the toolkit:
sudo apt-get install nvidia-cuda-toolkit
- Install nvidia-docker by following the instructions at https://github.com/NVIDIA/nvidia-docker. This essentially boils down to:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update sudo apt-get install -y nvidia-container-toolkit
- Navigate to the folder you cloned this repo into.
- From within this root directory:
make
Note: Running make
above should take approximately 20-30 minutes to generate with a decent GPU/CPU.
- You have created a docker image above, and can now run it as a container
- From within the root directory, run the below.
(you should be able to open a new terminal and run
./start.sh
start.sh
as many times as you want to get multiple terminal windows inside the container)
Note: You may put any files that you want to use within the Docker container in the root folder and they will be accessible.
- To test whether OpenPose installed correctly try:
cd /workspace/openpose ./build/examples/openpose/openpose.bin --video examples/media/video.avi --face
Note: this runs pretty slowly on my computer (Ryzen 2600 + NVIDIA GTX 1060 6GB), roughly 3fps.
- To exit the container, type
exit
on the first terminal that you spawned the container on or open a new terminal window (not inside the container) and typedocker kill "container_name"
where "container_name" is the container name on your system. (To find the container name typedocker images
)