diff --git a/doc/installation_jetson_tx2_jetpack3.3.md b/doc/installation_jetson_tx2_jetpack3.3.md index aac59cee10e3c905d815b842280c2b3ae3f702e8..3397351529eca21e8a5384798087d5144ef79bd8 100644 --- a/doc/installation_jetson_tx2_jetpack3.3.md +++ b/doc/installation_jetson_tx2_jetpack3.3.md @@ -29,15 +29,17 @@ Notes: ## Installation -1. Use the following script for installation of both caffe and OpenPose: +Use the following script for installation of both caffe and OpenPose: ``` bash ./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh ``` -2. If you do not want to build the Python libraries, the installation is finished. Otherwise, edit the BUILD_PYTHON flag on CMakeLists.txt: + +Optional: If you want to build the Python libraries, then: +1. Edit the `BUILD_PYTHON` flag on `CMakeLists.txt`: ```option(BUILD_PYTHON "Build OpenPose python." ON)``` -and, in both places where this appears, set the flag to ON: +2. In both places where this appears, set the flag to ON: ``` -DBUILD_python=ON -DBUILD_python_layer=ON @@ -48,12 +50,14 @@ and, in both places where this appears, set the flag to ON: ```cmake -DBUILD_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python2.7 -DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython2.7.so ..``` 4. Now run `make`. You should see a file called "pyopenpose.so" if Python was set to 2.7, in -/home/nvidia/openpose/build/python/openpose. Otherwise, it will be "pyopenpose.cpython-35m-aarch64-linux-gnu" +`/home/nvidia/openpose/build/python/openpose`. Otherwise, it will be `pyopenpose.cpython-35m-aarch64-linux-gnu`. 5. Finally, run `sudo make install` inside build to copy the files to /usr/local/python and set PYTHONPATH accordingly on .bashrc: ```export PYTHONPATH="${PYTHONPATH}:/usr/local/python``` + + ## Usage It is for now recommended to use an external camera with the demo. To get to decent FPS you need to lower the net resolution: ``` diff --git a/examples/tests/resizeTest.cpp b/examples/tests/resizeTest.cpp index d6fc76b85ff4be59712c364c57ccc11649491636..06652e47ae362931fd135f3bb031c81a659ca926 100644 --- a/examples/tests/resizeTest.cpp +++ b/examples/tests/resizeTest.cpp @@ -79,7 +79,7 @@ try { // logging_level - op::Matrix opImg = op::loadImage(FLAGS_image_path, CV_LOAD_IMAGE_GRAYSCALE); + op::Matrix opImg = op::loadImage(FLAGS_image_path, getCvLoadImageGrayScale()); cv::Mat img = OP_OP2CVMAT(opImg); if(img.empty()) op::error("Could not open or find the image: " + FLAGS_image_path, __LINE__, __FUNCTION__, __FILE__); diff --git a/include/openpose/utilities/openCv.hpp b/include/openpose/utilities/openCv.hpp index b926929df9fcbf13bfef4b7285a20a7bf5ff3644..9c70364e823d4d7d3fc092546959d83263404232 100644 --- a/include/openpose/utilities/openCv.hpp +++ b/include/openpose/utilities/openCv.hpp @@ -60,6 +60,11 @@ namespace op * Wrapper of CV_LOAD_IMAGE_ANYDEPTH to avoid leaving OpenCV dependencies on headers. */ OP_API int getCvLoadImageAnydepth(); + + /** + * Wrapper of CV_LOAD_IMAGE_GRAYSCALE to avoid leaving OpenCV dependencies on headers. + */ + OP_API int getCvLoadImageGrayScale(); } #endif // OPENPOSE_UTILITIES_OPEN_CV_HPP diff --git a/scripts/ubuntu/install_cuda.sh b/scripts/ubuntu/install_cuda.sh index e1ad5f0be50d9a96cca1931cd91c7ba2c4b8af5d..e12b0b64436e161935c8d6f4ac721c320d31e6c0 100755 --- a/scripts/ubuntu/install_cuda.sh +++ b/scripts/ubuntu/install_cuda.sh @@ -1,6 +1,7 @@ #!/bin/bash -echo "NOTE: This script assumes Ubuntu 16 or 14 and Nvidia Graphics card up to 10XX. Otherwise, install it by yourself or it will fail." +echo "NOTE: This script assumes Ubuntu 18 (Nvidia Graphics card >= 10XX), 16 (card up to 10XX), or 14 (card up to 10XX)." +echo "Otherwise, install it by yourself or it might fail." # Install CUDA 8.0 ubuntu_version="$(lsb_release -r)" @@ -8,11 +9,16 @@ sudo apt-get update && sudo apt-get install wget -y --no-install-recommends if [[ $ubuntu_version == *"14."* ]]; then wget -c "https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64-deb" sudo dpkg --install cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64-deb + sudo apt-get update + sudo apt-get install cuda-8-0 elif [[ $ubuntu_version == *"16."* ]]; then wget -c "https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64-deb" sudo dpkg --install cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64-deb + sudo apt-get update + sudo apt-get install cuda-8-0 +# Install CUDA 10.0 elif [[ $ubuntu_version == *"18."* ]]; then - wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin + wget -c "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin" sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb @@ -20,6 +26,4 @@ elif [[ $ubuntu_version == *"18."* ]]; then sudo apt-get update sudo apt-get -y install cuda fi -sudo apt-get update -sudo apt-get install cuda-8-0 # sudo apt-get install cuda diff --git a/src/openpose/utilities/openCv.cpp b/src/openpose/utilities/openCv.cpp index b6fe86c64067f8f21bf6610d06046730263e0589..bd1141e7f1c8d45d6eb9965e6efece76d5182938 100644 --- a/src/openpose/utilities/openCv.cpp +++ b/src/openpose/utilities/openCv.cpp @@ -372,4 +372,17 @@ namespace op return -1; } } + + int getCvLoadImageGrayScale() + { + try + { + return CV_LOAD_IMAGE_GRAYSCALE; + } + catch (const std::exception& e) + { + error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return -1; + } + } }