Setting up OpenPose on NVIDIA Jetson TX2: Difference between revisions
m (Mmadrigal moved page DispTEC - OpenPose Installation to Setting up OpenPose on NVidia Jetson TX2 without leaving a redirect: This is a more generic title for developers) |
mNo edit summary |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= | <seo title="OpenPose on NVIDIA Jetson TX2 | OpenPose | RidgeRun Developer" titlemode="replace" metakeywords="OpenPose, NVIDIA Jetson TX2, NVIDIA, Jetson TX2, TX2, cuDNN, CUDA, Caffe, OpenCV, GStreamer, Installing OpenPose" metadescription="This wiki page from RidgeRun is about setting up OpenPose and all its dependencies on either a computer with Ubuntu 16.04 or on the NVIDIA Jetson TX2 platform."></seo> | ||
This wiki is | |||
= | <table> | ||
<tr> | |||
<td><div class="clear; float:right">__TOC__</div></td> | |||
<td> | |||
{{NVIDIA Preferred Partner logo}} | |||
<td> | |||
<center> | |||
{{ContactUs Button}} | |||
</center> | |||
</tr> | |||
</table> | |||
== | ==Introduction to OpenPose on NVIDIA Jetson TX2== | ||
===cuDNN (highly recommended)=== | This RidgeRun Developer 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 on the NVIDIA Jetson TX2 platform. | ||
==Setting up OpenPose on Ubuntu 16.04 for Desktop== | |||
===Requirements=== | |||
====cuDNN (highly recommended)==== | |||
'''Prerequisites''' | '''Prerequisites''' | ||
- GPU of | - GPU of computing capability 3.0 or higher. | ||
- CUDA | - CUDA | ||
- NVIDIA Graphics Drivers | - NVIDIA Graphics Drivers | ||
Line 49: | Line 64: | ||
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 109: | ||
$make runtest | $make runtest | ||
==OpenPose Installation== | ===OpenPose Installation=== | ||
1. First clone the OpenPose repository: | '''1.''' First clone the OpenPose repository: | ||
$git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose | $git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose | ||
2. Install Caffe and dependencies with the following script: | '''2.''' Install Caffe and dependencies with the following script: | ||
$sudo bash ./scripts/ubuntu/install_deps.sh | $sudo bash ./scripts/ubuntu/install_deps.sh | ||
3. Configure OpenPose with CMake-GUI | '''3.''' Configure OpenPose with CMake-GUI | ||
* Make a “build” folder | * Make a “build” folder | ||
Line 112: | Line 127: | ||
* 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 135: | ||
$sudo make install | $sudo make install | ||
==Verify OpenPose Installation== | ===Verify OpenPose Installation=== | ||
1. Go to the OpenPose directory | '''1.''' Go to the OpenPose directory | ||
2. For example on video run: | '''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 | ||
$./build/examples/openpose/openpose.bin --video examples/media/video.avi --face --hand | $./build/examples/openpose/openpose.bin --video examples/media/video.avi --face --hand | ||
3. For example on webcam run: | '''3.''' For example on webcam run: | ||
$./build/examples/openpose/openpose.bin | $./build/examples/openpose/openpose.bin | ||
$./build/examples/openpose/openpose.bin --face --hand | $./build/examples/openpose/openpose.bin --face --hand | ||
=Setting up OpenPose on | ==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 | 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]. | ||
* 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 149: | Line 164: | ||
- The demo and tutorials additionally use GFlags. | - The demo and tutorials additionally use GFlags. | ||
'''Note:''' | {{Ambox | ||
For OpenCV to be able to access | |type=notice | ||
|small=left | |||
|issue='''Note:'''For OpenCV to be able to access Jetson's onboard camera via GStreamer, it is required to rebuild OpenCV after GStreamer has been installed. | |||
|style=width:unset; | |||
}} | |||
1- Please make sure GStreamer is already installed in the Jetson Board. | '''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 | $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. | '''2-''' Remove previous installation of OpenCV. | ||
$sudo apt-get purge libopencv* | $sudo apt-get purge libopencv* | ||
3- To rebuild OpenCV, is useful to use [https://github.com/jetsonhacks/buildOpenCVTX2 Jetsonhacks buildOpenCVTX2 bash script]. | '''3-''' To rebuild OpenCV, is useful to use [https://github.com/jetsonhacks/buildOpenCVTX2 Jetsonhacks buildOpenCVTX2 bash script]. | ||
$git clone https://github.com/jetsonhacks/buildOpenCVTX2.git | $git clone https://github.com/jetsonhacks/buildOpenCVTX2.git | ||
$cd buildOpenCVTX2 | $cd buildOpenCVTX2 | ||
$./buildOpenCV.sh | $./buildOpenCV.sh | ||
4- Remove the build files after installation. | '''4-''' Remove the build files after installation. | ||
$./removeOpenCVSources.sh | $./removeOpenCVSources.sh | ||
===Installing OpenPose=== | |||
==Installing OpenPose== | Once all the requirements and dependencies are ready, installing OpenPose is really easy to install. | ||
Once all the requirements and dependencies are ready, installing OpenPose is really easy to | |||
$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 | Testing if OpenPose was successfully installed can be done 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 | If OpenPose is properly installed, the example should be able to show live video from the camera with a skeleton overlay on each body on the scene. | ||
==See Also== | |||
'''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 | |||
{{ContactUs}} | |||
[[Category:GStreamer]][[Category:Jetson]][[Category:JetsonNano]][[Category:JetsonTX2]][[Category:NVIDIA Xavier]][[Category:JetsonXavierNX]] |
Latest revision as of 14:26, 20 February 2023
|
|
Introduction to OpenPose on NVIDIA Jetson TX2
This RidgeRun Developer 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 on the NVIDIA Jetson TX2 platform.
Setting up OpenPose on Ubuntu 16.04 for Desktop
Requirements
cuDNN (highly recommended)
Prerequisites
- GPU of computing 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 Jetson's onboard 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 install.
$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 done 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 a skeleton overlay on each body on the scene.
See Also
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
|