Setting up OpenPose on NVIDIA Jetson TX2: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
=Introduction= | ==Introduction== | ||
This wiki is intended to give a quick and easy to understand guide to the reader for setting up OpenPose and all its dependencies on either a computer with Ubuntu 16.04 or a Nvidia Jetson TX2. | This wiki is intended to give a quick and easy to understand guide to the reader for setting up OpenPose and all its dependencies on either a computer with Ubuntu 16.04 or a Nvidia Jetson TX2. | ||
=Setting up OpenPose on Ubuntu 16.04 for Desktop= | ==Setting up OpenPose on Ubuntu 16.04 for Desktop== | ||
==Requirements== | ===Requirements=== | ||
===cuDNN (highly recommended)=== | ====cuDNN (highly recommended)==== | ||
'''Prerequisites''' | '''Prerequisites''' | ||
Line 49: | Line 49: | ||
An output of “Test passed!” should appear. | An output of “Test passed!” should appear. | ||
==Dependencies== | ===Dependencies=== | ||
===OpenCV (2.X or 3.X)=== | ====OpenCV (2.X or 3.X)==== | ||
$sudo apt-get install libopencv-dev | $sudo apt-get install libopencv-dev | ||
===Caffe=== | ====Caffe==== | ||
'''General Dependencies''' | '''General Dependencies''' | ||
Line 94: | Line 94: | ||
$make runtest | $make runtest | ||
==OpenPose Installation== | ===OpenPose Installation=== | ||
1. First clone the OpenPose repository: | 1. First clone the OpenPose repository: | ||
Line 112: | Line 112: | ||
* Press “Generate” and close CMake. | * Press “Generate” and close CMake. | ||
==OpenPose Building== | ===OpenPose Building=== | ||
Go into the build directory and run: | Go into the build directory and run: | ||
Line 120: | Line 120: | ||
$sudo make install | $sudo make install | ||
==Verify OpenPose Installation== | ===Verify OpenPose Installation=== | ||
1. Go to the OpenPose directory | 1. Go to the OpenPose directory | ||
Line 134: | Line 134: | ||
$./build/examples/openpose/openpose.bin --face --hand | $./build/examples/openpose/openpose.bin --face --hand | ||
=Setting up OpenPose on NVidia Jetson TX2= | ==Setting up OpenPose on NVidia Jetson TX2== | ||
==Requirements and Dependencies== | ===Requirements and Dependencies=== | ||
===Requirements=== | ====Requirements==== | ||
* It is required for the Jetson TX2 board to be flashed with either JetPack 3.1 or JetPack 3.3. | * It is required for the Jetson TX2 board to be flashed with either JetPack 3.1 or JetPack 3.3. | ||
For instructions on how to install JetPack 3.3 please refer to the [https://developer.nvidia.com/embedded/dlc/jetpack-install-guide-3_3 Nvidia JetPack 3.3 Installation Guide]. | For instructions on how to install JetPack 3.3 please refer to the [https://developer.nvidia.com/embedded/dlc/jetpack-install-guide-3_3 Nvidia JetPack 3.3 Installation Guide]. | ||
Line 142: | Line 142: | ||
* Please make sure to install CUDA and cuDNN before installing OpenPose. | * Please make sure to install CUDA and cuDNN before installing OpenPose. | ||
===Dependencies=== | ====Dependencies==== | ||
- OpenCV | - OpenCV | ||
-> All 2.X and 3.X versions are compatible with Jetson TX2 boards flashed with JetPack 3.1. | -> All 2.X and 3.X versions are compatible with Jetson TX2 boards flashed with JetPack 3.1. | ||
Line 164: | Line 164: | ||
==Installing OpenPose== | ===Installing OpenPose=== | ||
Once all the requirements and dependencies are ready, installing OpenPose is really easy to instal. | Once all the requirements and dependencies are ready, installing OpenPose is really easy to instal. | ||
$git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose | $git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose | ||
$bash ./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh | $bash ./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh | ||
==Verify OpenPose Installation== | ===Verify OpenPose Installation=== | ||
Testing if OpenPose was successfully installed can be one by running one of its examples. | Testing if OpenPose was successfully installed can be one by running one of its examples. | ||
./build/examples/openpose/openpose.bin -camera_resolution 640x480 -net_resolution 128x96 | ./build/examples/openpose/openpose.bin -camera_resolution 640x480 -net_resolution 128x96 | ||
If OpenPose is properly installed, the example should be able to show live video from the camera with an skeleton overlay on each body on the scene. | If OpenPose is properly installed, the example should be able to show live video from the camera with an skeleton overlay on each body on the scene. | ||
=Links= | ==Links== | ||
1. https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md | 1. https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md | ||
Line 181: | Line 181: | ||
3. http://caffe.berkeleyvision.org/installation.html | 3. http://caffe.berkeleyvision.org/installation.html | ||
{{ContactUs}} | |||
[[Category:Jetson]] | [[Category:Jetson]] |
Revision as of 21:19, 7 February 2020
Introduction
This wiki is intended to give a quick and easy to understand guide to the reader for setting up OpenPose and all its dependencies on either a computer with Ubuntu 16.04 or a Nvidia Jetson TX2.
Setting up OpenPose on Ubuntu 16.04 for Desktop
Requirements
cuDNN (highly recommended)
Prerequisites
- GPU of compute capability 3.0 or higher. - CUDA - NVIDIA Graphics Drivers
Download
You can go to the CuDNN Download Page and download the latest version for your current CUDA installation.
The files you will need are:
- cuDNN Runtime Library for Ubuntu 16.04 (Deb)
- cuDNN Developer Library for Ubuntu 16.04 (Deb)
- cuDNN Code Samples and User Guide for Ubuntu 16.04 (Deb)
Installation
Runtime Library:
$sudo dpkg -i libcudnn7_7.4.2.24-1+cuda9.0_amd64.deb
Developer Library:
$sudo dpkg -i libcudnn7-dev_7.4.2.24-1+cuda9.0_amd64.deb
Code Samples and the CUDNN Library User Guide:
$sudo dpkg -i libcudnn7-doc_7.4.2.24-1+cuda9.0_amd64.deb
Note that versions can be different.
Verification
$cp -r /usr/src/cudnn_samples_v7/ $HOME $cd $HOME/cudnn_samples_v7/mnistCUDNN $make clean && make $./mnistCUDNN
An output of “Test passed!” should appear.
Dependencies
OpenCV (2.X or 3.X)
$sudo apt-get install libopencv-dev
Caffe
General Dependencies
$sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler $sudo apt-get install --no-install-recommends libboost-all-dev $sudo apt-get install libatlas-base-dev $sudo apt-get install libopenblas-dev $sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
Compilation
First clone Caffe repository:
$git clone https://github.com/BVLC/caffe.git
Then copy Makefile:
$cp Makefile.config.example Makefile.config
and comment this section:
-gencode arch=compute_20,code=sm_20 \ -gencode arch=compute_20,code=sm_21 \
Finally build using CMake:
$mkdir build $cd build $cmake .. $make all
If it can’t find the hdf5.h file then run:
$export CPATH="/usr/include/hdf5/serial/" $make install $make runtest
OpenPose Installation
1. First clone the OpenPose repository:
$git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
2. Install Caffe and dependencies with the following script:
$sudo bash ./scripts/ubuntu/install_deps.sh
3. Configure OpenPose with CMake-GUI
- Make a “build” folder
- Open CMake-GUI and in “Where is the source code” place the path to the cloned OpenPose folder.
- Place in “Where to build binaries” the build directory of the OpenPose folder.
- Press “Configure” and make sure the generator is in Unix Makefile, then click “Finish”.
- Press “Generate” and close CMake.
OpenPose Building
Go into the build directory and run:
$make -j`nproc`
$sudo make install
Verify OpenPose Installation
1. Go to the OpenPose directory
2. For example on video run:
$./build/examples/openpose/openpose.bin --video examples/media/video.avi $./build/examples/openpose/openpose.bin --video examples/media/video.avi --face --hand
3. For example on webcam run:
$./build/examples/openpose/openpose.bin $./build/examples/openpose/openpose.bin --face --hand
Setting up OpenPose on NVidia Jetson TX2
Requirements and Dependencies
Requirements
- It is required for the Jetson TX2 board to be flashed with either JetPack 3.1 or JetPack 3.3.
For instructions on how to install JetPack 3.3 please refer to the Nvidia JetPack 3.3 Installation Guide.
- Please make sure to install CUDA and cuDNN before installing OpenPose.
Dependencies
- OpenCV -> All 2.X and 3.X versions are compatible with Jetson TX2 boards flashed with JetPack 3.1. -> All 3.X versions are compatible with Jetson TX2 boards flashed with JetPack 3.3. - Caffe and all its dependencies. - The demo and tutorials additionally use GFlags.
Note: For OpenCV to be able to access the Jetson's on board camera via GStreamer, it is required to rebuild OpenCV after GStreamer has been installed.
1- Please make sure GStreamer is already installed in the Jetson Board.
$sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-bad
2- Remove previous installation of OpenCV.
$sudo apt-get purge libopencv*
3- To rebuild OpenCV, is useful to use Jetsonhacks buildOpenCVTX2 bash script.
$git clone https://github.com/jetsonhacks/buildOpenCVTX2.git $cd buildOpenCVTX2 $./buildOpenCV.sh
4- Remove the build files after installation.
$./removeOpenCVSources.sh
Installing OpenPose
Once all the requirements and dependencies are ready, installing OpenPose is really easy to instal.
$git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose $bash ./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh
Verify OpenPose Installation
Testing if OpenPose was successfully installed can be one by running one of its examples.
./build/examples/openpose/openpose.bin -camera_resolution 640x480 -net_resolution 128x96
If OpenPose is properly installed, the example should be able to show live video from the camera with an skeleton overlay on each body on the scene.
Links
1. https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md
2. https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html
3. http://caffe.berkeleyvision.org/installation.html
RidgeRun Resources | |||||
Contact Us
|