提交 c71b55b6 编写于 作者: G Gines Hidalgo

Proper fix for #1439 and cleaned accepted PRs

上级 7242e33f
......@@ -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:
```
......
......@@ -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__);
......
......@@ -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
#!/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
......@@ -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;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册