esemeniuc / openpose-docker

A docker build file for CMU openpose with Python API support
https://hub.docker.com/r/cwaffles/openpose
88 stars 37 forks source link

cant see camera output as it only works with --display 0 #6

Open rsrini7 opened 5 years ago

rsrini7 commented 5 years ago

./build/examples/openpose/openpose.bin --render_pose 0 --display 0 --write_json output2/

./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1

aruiplex commented 2 years ago

Because it is in the docker container. Therefore, there are no display screen. The --display 0 is necessary.

dcbark01 commented 2 years ago

Here's how I run my container to get the display to output properly. (Note: I'm elevating the privileges of the container to have access to the host, so be aware of the security implications that has.)

docker container run -it --rm --gpus all -e NVIDIA_VISIBLE_DEVICES=0 --privileged --network=host --ipc=host \
  -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
  -v $HOME/.Xauthority:/root/.Xauthority -e XAUTHORITY=/root/.Xauthority -e QT_X11_NO_MITSHM=1 \
  -v ${BUILD_DIR}/data:/mnt/data  \
  -v ${BUILD_DIR}/output:/mnt/output  \
  --name openpose \
  openpose:latest /bin/bash