CMU-Perceptual-Computing-Lab / caffe_rtpose

Realtime C++ code for multi-person pose estimation
Other
356 stars 207 forks source link

nothing happens on Docker #21

Closed kidapu closed 7 years ago

kidapu commented 7 years ago

I have compiled caffe_rtpose successfully on my following enviroment.

This enviroment is built with following Dockerfile.

FROM nvidia/cuda:8.0-devel-ubuntu16.04
LABEL maintainer "NVIDIA CORPORATION <cudatools@nvidia.com>"

RUN mkdir OpenCV && cd OpenCV

RUN apt-get update && apt-get install -y \
  build-essential \
  checkinstall \
  cmake \
  pkg-config \
  yasm \
  libtiff5-dev \
  libjpeg-dev \
  libjasper-dev \
  libavcodec-dev \
  libavformat-dev \
  libswscale-dev \
  libdc1394-22-dev \
  libgstreamer0.10-dev \
  libgstreamer-plugins-base0.10-dev \
  libv4l-dev \
  python-dev \
  python-numpy \
  python-pip \
  libtbb-dev \
  libeigen3-dev \
  libqt4-dev \
  libgtk2.0-dev \
  # Doesn't work libfaac-dev \
  libmp3lame-dev \
  libopencore-amrnb-dev \
  libopencore-amrwb-dev \
  libtheora-dev \
  libvorbis-dev \
  libxvidcore-dev \
  x264 \ 
  v4l-utils \
  libgtk2.0-dev \
  unzip \
  libhdf5-dev \
  wget \
  curl \
  sudo \
  git \
  vim \
  lsb-release \
  libopenblas-dev \
  libatlas-base-dev \
  libgflags-dev \
  libgoogle-glog-dev \
  liblmdb-dev

ENV CUDNN_VERSION 5.1.10
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN CUDNN_DOWNLOAD_SUM=c10719b36f2dd6e9ddc63e3189affaa1a94d7d027e63b71c3f64d449ab0645ce && \
    curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-x64-v5.1.tgz -O && \
    echo "$CUDNN_DOWNLOAD_SUM  cudnn-8.0-linux-x64-v5.1.tgz" | sha256sum -c --strict - && \
    tar -xzf cudnn-8.0-linux-x64-v5.1.tgz -C /usr/local && \
    rm cudnn-8.0-linux-x64-v5.1.tgz && \
    ldconfig

RUN cd /opt && \
  wget https://github.com/daveselinger/opencv/archive/3.1.0-with-cuda8.zip -O opencv-3.1.0.zip -nv && \
  unzip opencv-3.1.0.zip && \
  mv opencv-3.1.0-with-cuda8 opencv-3.1.0 && \
  cd opencv-3.1.0 && \
  rm -rf build && \
  mkdir build && \
  cd build && \
  cmake -D CUDA_ARCH_BIN=3.2 \
    -D CUDA_ARCH_PTX=3.2 \
    -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D WITH_TBB=ON \
    -D BUILD_NEW_PYTHON_SUPPORT=ON \
    -D WITH_V4L=ON \
    -D BUILD_TIFF=ON \
    -D WITH_QT=ON \
    -D ENABLE_PRECOMPILED_HEADERS=OFF \
    -D WITH_OPENGL=ON .. && \
  make -j4 && \
  make install && \
  echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/opencv.conf && \
  ldconfig
RUN cp /opt/opencv-3.1.0/build/lib/cv2.so /usr/lib/python2.7/dist-packages/cv2.so

I confirmed this docker container can use webcam and GUI, and I try to run following command, but nothing happens... X(

$ ./build/examples/rtpose/rtpose.bin 
init done 
opengl support available 

$ ./build/examples/rtpose/rtpose.bin --video ./build/examples/rtpose/test.mp4 --num_gpu 1 --write_frames output/
init done 
opengl support available 
gineshidalgo99 commented 7 years ago

Please, check #1 or #7. Thanks!

kidapu commented 7 years ago

@gineshidalgo99 Thanks. I changed opencv version from 3.1 to 2.4.13.2. Then I got new event like below youtube link, that I recorded my ubuntu desktop...

https://www.youtube.com/watch?v=2HmNaGgW2Xk&feature=youtu.be

The window opens, but it will die soon...

gineshidalgo99 commented 7 years ago

We are still trying to figure out that error, since it does not happen in our computers.

Could you try this? Could you remove your OpenCV version and try the default and basic OpenCV version that you can get from the Ubuntu repositories? sudo apt-get install libopencv-dev

And let us know whether the error still happens.

Thanks!

kidapu commented 7 years ago

I cannot instal libopencv but I can install libopencv-dev alternatively, and finally I can success to run!

Following Dockerfile could run your app. ( Probably there are unnecessary libraries included but hastening ...)

FROM nvidia/cuda:8.0-devel-ubuntu16.04
LABEL maintainer "NVIDIA CORPORATION <cudatools@nvidia.com>"

RUN apt-get update && apt-get install -y \
  build-essential checkinstall cmake pkg-config wget curl sudo git vim unzip lsb-release \
  yasm x264 \ 
  libtiff5-dev libjpeg-dev libpng-dev libtiff-dev \
  libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev \
  python-dev python-numpy python-pip \
  libtbb-dev libeigen3-dev libqt4-dev libgtk2.0-dev libmp3lame-dev \
  libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev \
  v4l-utils \
  libgtk2.0-dev \
  zlib1g-dev \
  libhdf5-dev libopenblas-dev libatlas-base-dev libgflags-dev libgoogle-glog-dev liblmdb-dev liblapacke-dev \
  libopencv-dev python-opencv 

# install cudnn 5.1.10
ENV CUDNN_VERSION 5.1.10
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN CUDNN_DOWNLOAD_SUM=c10719b36f2dd6e9ddc63e3189affaa1a94d7d027e63b71c3f64d449ab0645ce && \
    curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-x64-v5.1.tgz -O && \
    echo "$CUDNN_DOWNLOAD_SUM  cudnn-8.0-linux-x64-v5.1.tgz" | sha256sum -c --strict - && \
    tar -xzf cudnn-8.0-linux-x64-v5.1.tgz -C /usr/local && \
    rm cudnn-8.0-linux-x64-v5.1.tgz && \
    ldconfig

# install rtpose
RUN cd /usr/local && \
    git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose.git && \
    cd caffe_rtpose && \
    ./install_caffe_and_cpm.sh

Thanks!