diff options
author | Franck Lucien Duriez | 2018-08-29 09:47:59 +0200 |
---|---|---|
committer | Franck Lucien Duriez | 2018-08-29 13:07:57 +0200 |
commit | 278a768010489a651684bf5dc322c36cb746a038 (patch) | |
tree | 32a21e0e4462c2ab9d333f368fbd1650dde05fb2 | |
download | aur-278a768010489a651684bf5dc322c36cb746a038.tar.gz |
First commit
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | GLU.patch | 12 | ||||
-rw-r--r-- | PKGBUILD | 88 | ||||
-rw-r--r-- | models.patch | 165 |
5 files changed, 296 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..64a5a44088fd --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,26 @@ +pkgbase = openpose + pkgdesc = OpenPose represents the first real-time multi-person system to jointly detect human body, hand, and facial keypoints (in total 135 keypoints) on single images. + pkgver = 1.3.0 + pkgrel = 1 + url = https://github.com/CMU-Perceptual-Computing-Lab/openpose + arch = any + license = ACADEMIC OR NON-PROFIT ORGANIZATION NONCOMMERCIAL RESEARCH USE ONLY + makedepends = cmake + makedepends = doxygen + makedepends = graphviz + makedepends = wget + depends = caffe + depends = intel-mkl + depends = libgl + depends = glu + depends = lilv + depends = boost + source = https://github.com/CMU-Perceptual-Computing-Lab/openpose/archive/v1.3.0.tar.gz + source = GLU.patch + source = models.patch + sha256sums = 5ef834e603dc207c249f49ba672c8bd1895e5a2ffc0ff5548037402a80398bd0 + sha256sums = d2e3ad3dd350e494d1e90d595f6b0d4daa76ed9744f7730c22b1803390f1f021 + sha256sums = 6dfa55f1876778950ed04cbf98f032c4b4129c56c396209837403398e9815f31 + +pkgname = openpose + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..8318b834b992 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +* +!PKGBUILD +!.gitignore +!.SRCINFO +!*.patch diff --git a/GLU.patch b/GLU.patch new file mode 100644 index 000000000000..eb6af5fe9cf4 --- /dev/null +++ b/GLU.patch @@ -0,0 +1,12 @@ +diff --git a/src/openpose/CMakeLists.txt b/src/openpose/CMakeLists.txt +index cedcfdb..4a918a5 100644 +--- a/src/openpose/CMakeLists.txt ++++ b/src/openpose/CMakeLists.txt +@@ -25,6 +25,7 @@ endif () + # Ubuntu + if(UNIX AND NOT APPLE) + target_link_libraries(openpose ${OpenCV_LIBS} ${Caffe_LIBS} ++ GLU + ${GFLAGS_LIBRARY} ${GLOG_LIBRARY} ${MKL_LIBS} ${GLUT_LIBRARY} ${SPINNAKER_LIB}) + if (CMAKE_COMPILER_IS_GNUCXX) + foreach (SUB_DIR ${SUB_DIRS}) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e04968ae8845 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,88 @@ +# Maintainer: Franck Lucien Duriez <franck.lucien.duriez@gmail.com> + +pkgname="openpose" +pkgver="1.3.0" +pkgrel="1" +pkgdesc="OpenPose represents the first real-time multi-person system to jointly detect human body, hand, and facial keypoints (in total 135 keypoints) on single images." +arch=("any") +url="https://github.com/CMU-Perceptual-Computing-Lab/openpose" +license=("ACADEMIC OR NON-PROFIT ORGANIZATION NONCOMMERCIAL RESEARCH USE ONLY") +depends=("caffe" "intel-mkl" "libgl" "glu" "lilv" "boost") +makedepends=("cmake" "doxygen" "graphviz" "wget") +source=( + "https://github.com/CMU-Perceptual-Computing-Lab/openpose/archive/v${pkgver}.tar.gz" + "GLU.patch" + "models.patch" +) +sha256sums=( + "5ef834e603dc207c249f49ba672c8bd1895e5a2ffc0ff5548037402a80398bd0" + "d2e3ad3dd350e494d1e90d595f6b0d4daa76ed9744f7730c22b1803390f1f021" + "6dfa55f1876778950ed04cbf98f032c4b4129c56c396209837403398e9815f31" +) + +prepare() { + cd "$pkgname-$pkgver" + patch -p1 -i "${srcdir}/GLU.patch" + patch -p1 -i "${srcdir}/models.patch" +} + +build() { + cd "$pkgname-$pkgver" + mkdir -p build + cd build + cmake \ + -DCMAKE_BUILD_TYPE:STRING="Release" \ + -DBUILD_CAFFE:BOOL=OFF \ + -DBUILD_EXAMPLES:BOOL=ON \ + -DBUILD_DOCS:BOOL=ON \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DDOWNLOAD_BODY_25_MODEL:BOOL=ON \ + -DDOWNLOAD_BODY_COCO_MODEL:BOOL=ON \ + -DDOWNLOAD_BODY_MPI_MODEL:BOOL=ON \ + -DDOWNLOAD_FACE_MODEL:BOOL=ON \ + -DDOWNLOAD_HAND_MODEL:BOOL=ON \ + -DGPU_MODE:STRING=CPU_ONLY \ + -DWITH_3D_RENDERER:BOOL=ON \ + -DCMAKE_CXX_FLAGS:STRING="-I/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/include" \ + -DCMAKE_C_FLAGS:STRING="-I/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/include" \ + -DCaffe_INCLUDE_DIRS:PATH="/usr/include" \ + -DCaffe_LIBS:PATH="/usr/lib/libcaffe.so" \ + -DCMAKE_INSTALL_PREFIX:PATH="$pkgdir/usr" \ + .. + make +} + +package() { + cd "$pkgname-$pkgver/build" + + # Install libraries. + make install + + # Install the examples. + _destdir="$pkgdir/usr/share/OpenPose/examples" + mkdir -p "$_destdir" + find "./examples" -type f -executable \ + -not -path './examples/tests/*' \ + -not -path './examples/openpose/*' \ + -exec install -D -m755 '{}' "$_destdir" ';' + + # Install main executable. + _destdir="$pkgdir/usr/bin" + mkdir -p "$_destdir" + install -D -m755 \ + "./examples/openpose/openpose.bin" \ + "$_destdir/openpose" + + cd .. + + # Install documentation. + _destdir="$pkgdir/usr/share/doc/OpenPose" + mkdir -p "$(dirname "$_destdir")" + cp -r "./doc/doxygen/html" "$_destdir" + find "$_destdir" -type f -exec chmod 644 '{}' ';' + + # Install the models. + _destdir="$pkgdir/usr/lib/OpenPose" + cp -r "models" "$_destdir" + find "$_destdir" -type f -exec chmod 644 '{}' ';' +} diff --git a/models.patch b/models.patch new file mode 100644 index 000000000000..edda81d3b65b --- /dev/null +++ b/models.patch @@ -0,0 +1,165 @@ +diff --git a/examples/openpose/openpose.cpp b/examples/openpose/openpose.cpp +index 711b0ad..3930674 100755 +--- a/examples/openpose/openpose.cpp ++++ b/examples/openpose/openpose.cpp +@@ -64,9 +64,9 @@ DEFINE_int32(frame_rotate, 0, "Rotate each frame, 4 po + DEFINE_bool(frames_repeat, false, "Repeat frames when finished."); + DEFINE_bool(process_real_time, false, "Enable to keep the original source frame rate (e.g. for video). If the processing time is" + " too long, it will skip frames. If it is too fast, it will slow it down."); +-DEFINE_string(camera_parameter_folder, "models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); ++DEFINE_string(camera_parameter_folder, "/usr/lib/OpenPose/models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); + // OpenPose +-DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); ++DEFINE_string(model_folder, "", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); + DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " input image resolution."); + DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your" +diff --git a/examples/tests/handFromJsonTest.cpp b/examples/tests/handFromJsonTest.cpp +index c6925a9..822ec88 100644 +--- a/examples/tests/handFromJsonTest.cpp ++++ b/examples/tests/handFromJsonTest.cpp +@@ -18,7 +18,7 @@ DEFINE_int32(logging_level, 3, ""); + DEFINE_string(image_dir, "", ""); + DEFINE_string(hand_ground_truth, "", ""); + // OpenPose +-DEFINE_string(model_folder, "models/", ""); ++DEFINE_string(model_folder, "/usr/lib/OpenPose/models/", ""); + DEFINE_int32(num_gpu, -1, ""); + DEFINE_int32(num_gpu_start, 0, ""); + // OpenPose Hand +@@ -60,7 +60,7 @@ int handFromJsonTest() + op::WrapperStructPose wrapperStructPose{false, op::flagsToPoint("656x368"), op::flagsToPoint("1280x720"), + op::ScaleMode::InputResolution, FLAGS_num_gpu, FLAGS_num_gpu_start, + 1, 0.15f, op::RenderMode::None, op::PoseModel::COCO_18, +- true, 0.f, 0.f, 0, "models/", {}, op::ScaleMode::ZeroToOne, false, ++ true, 0.f, 0.f, 0, "/usr/lib/OpenPose/models/", {}, op::ScaleMode::ZeroToOne, false, + 0.05f, -1, enableGoogleLogging, false, identification}; + wrapperStructPose.modelFolder = FLAGS_model_folder; + // Hand configuration (use op::WrapperStructHand{} to disable it) +diff --git a/examples/tutorial_add_module/1_custom_post_processing.cpp b/examples/tutorial_add_module/1_custom_post_processing.cpp +index 54b9d13..e4f489d 100644 +--- a/examples/tutorial_add_module/1_custom_post_processing.cpp ++++ b/examples/tutorial_add_module/1_custom_post_processing.cpp +@@ -73,9 +73,9 @@ DEFINE_int32(frame_rotate, 0, "Rotate each frame, 4 po + DEFINE_bool(frames_repeat, false, "Repeat frames when finished."); + DEFINE_bool(process_real_time, false, "Enable to keep the original source frame rate (e.g. for video). If the processing time is" + " too long, it will skip frames. If it is too fast, it will slow it down."); +-DEFINE_string(camera_parameter_folder, "models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); ++DEFINE_string(camera_parameter_folder, "/usr/lib/OpenPose/models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); + // OpenPose +-DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); ++DEFINE_string(model_folder, "/usr/lib/OpenPose/models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); + DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " input image resolution."); + DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your" +diff --git a/examples/tutorial_pose/1_extract_from_image.cpp b/examples/tutorial_pose/1_extract_from_image.cpp +index b0a75c9..8d37f86 100644 +--- a/examples/tutorial_pose/1_extract_from_image.cpp ++++ b/examples/tutorial_pose/1_extract_from_image.cpp +@@ -34,7 +34,7 @@ DEFINE_string(image_path, "examples/media/COCO_val2014_00000000019 + // OpenPose + DEFINE_string(model_pose, "COCO", "Model to be used. E.g. `COCO` (18 keypoints), `MPI` (15 keypoints, ~10% faster), " + "`MPI_4_layers` (15 keypoints, even faster but less accurate)."); +-DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); ++DEFINE_string(model_folder, "/usr/lib/OpenPose/models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); + DEFINE_string(net_resolution, "-1x368", "Multiples of 16. If it is increased, the accuracy potentially increases. If it is" + " decreased, the speed increases. For maximum speed-accuracy balance, it should keep the" + " closest aspect ratio possible to the images or videos to be processed. Using `-1` in" +diff --git a/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.cpp b/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.cpp +index b2c2bee..9e1afc9 100644 +--- a/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.cpp ++++ b/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.cpp +@@ -34,7 +34,7 @@ DEFINE_string(image_path, "examples/media/COCO_val2014_00000000019 + // OpenPose + DEFINE_string(model_pose, "COCO", "Model to be used. E.g. `COCO` (18 keypoints), `MPI` (15 keypoints, ~10% faster), " + "`MPI_4_layers` (15 keypoints, even faster but less accurate)."); +-DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); ++DEFINE_string(model_folder, "/usr/lib/OpenPose/models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); + DEFINE_string(net_resolution, "-1x368", "Multiples of 16. If it is increased, the accuracy potentially increases. If it is" + " decreased, the speed increases. For maximum speed-accuracy balance, it should keep the" + " closest aspect ratio possible to the images or videos to be processed. Using `-1` in" +diff --git a/examples/tutorial_thread/1_openpose_read_and_display.cpp b/examples/tutorial_thread/1_openpose_read_and_display.cpp +index 2003d28..a2def83 100644 +--- a/examples/tutorial_thread/1_openpose_read_and_display.cpp ++++ b/examples/tutorial_thread/1_openpose_read_and_display.cpp +@@ -44,7 +44,7 @@ DEFINE_bool(flir_camera, false, "Whether to use FLIR (Po + DEFINE_string(ip_camera, "", "String with the IP camera URL. It supports protocols like RTSP and HTTP."); + DEFINE_bool(process_real_time, false, "Enable to keep the original source frame rate (e.g. for video). If the processing time is" + " too long, it will skip frames. If it is too fast, it will slow it down."); +-DEFINE_string(camera_parameter_folder, "models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); ++DEFINE_string(camera_parameter_folder, "/usr/lib/OpenPose/models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); + // OpenPose + DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " input image resolution."); +diff --git a/examples/tutorial_thread/2_user_processing_function.cpp b/examples/tutorial_thread/2_user_processing_function.cpp +index b098502..2662284 100644 +--- a/examples/tutorial_thread/2_user_processing_function.cpp ++++ b/examples/tutorial_thread/2_user_processing_function.cpp +@@ -45,7 +45,7 @@ DEFINE_bool(flir_camera, false, "Whether to use FLIR (Po + DEFINE_string(ip_camera, "", "String with the IP camera URL. It supports protocols like RTSP and HTTP."); + DEFINE_bool(process_real_time, false, "Enable to keep the original source frame rate (e.g. for video). If the processing time is" + " too long, it will skip frames. If it is too fast, it will slow it down."); +-DEFINE_string(camera_parameter_folder, "models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); ++DEFINE_string(camera_parameter_folder, "/usr/lib/OpenPose/models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); + // OpenPose + DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " input image resolution."); +diff --git a/examples/tutorial_wrapper/1_user_asynchronous_output.cpp b/examples/tutorial_wrapper/1_user_asynchronous_output.cpp +index 181113f..dcead2d 100644 +--- a/examples/tutorial_wrapper/1_user_asynchronous_output.cpp ++++ b/examples/tutorial_wrapper/1_user_asynchronous_output.cpp +@@ -63,9 +63,9 @@ DEFINE_int32(frame_rotate, 0, "Rotate each frame, 4 po + DEFINE_bool(frames_repeat, false, "Repeat frames when finished."); + DEFINE_bool(process_real_time, false, "Enable to keep the original source frame rate (e.g. for video). If the processing time is" + " too long, it will skip frames. If it is too fast, it will slow it down."); +-DEFINE_string(camera_parameter_folder, "models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); ++DEFINE_string(camera_parameter_folder, "/usr/lib/OpenPose/models/cameraParameters/flir/", "String with the folder where the camera parameters are located."); + // OpenPose +-DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); ++DEFINE_string(model_folder, "/usr/lib/OpenPose/models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); + DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " input image resolution."); + DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your" +diff --git a/examples/tutorial_wrapper/2_user_synchronous.cpp b/examples/tutorial_wrapper/2_user_synchronous.cpp +index 606321c..006632d 100644 +--- a/examples/tutorial_wrapper/2_user_synchronous.cpp ++++ b/examples/tutorial_wrapper/2_user_synchronous.cpp +@@ -46,7 +46,7 @@ DEFINE_string(image_dir, "examples/media/", "Process a direc + DEFINE_double(camera_fps, 30.0, "Frame rate for the webcam (also used when saving video). Set this value to the minimum" + " value between the OpenPose displayed speed and the webcam real frame rate."); + // OpenPose +-DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); ++DEFINE_string(model_folder, "/usr/lib/OpenPose/models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); + DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " input image resolution."); + DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your" +diff --git a/examples/tutorial_wrapper/3_user_asynchronous.cpp b/examples/tutorial_wrapper/3_user_asynchronous.cpp +index 085be55..cbf20a6 100644 +--- a/examples/tutorial_wrapper/3_user_asynchronous.cpp ++++ b/examples/tutorial_wrapper/3_user_asynchronous.cpp +@@ -46,7 +46,7 @@ DEFINE_string(image_dir, "examples/media/", "Process a direc + DEFINE_double(camera_fps, 30.0, "Frame rate for the webcam (also used when saving video). Set this value to the minimum" + " value between the OpenPose displayed speed and the webcam real frame rate."); + // OpenPose +-DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); ++DEFINE_string(model_folder, "/usr/lib/OpenPose/models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); + DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " input image resolution."); + DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your" +diff --git a/src/openpose/pose/poseExtractorCaffe.cpp b/src/openpose/pose/poseExtractorCaffe.cpp +index e59513b..7033d94 100644 +--- a/src/openpose/pose/poseExtractorCaffe.cpp ++++ b/src/openpose/pose/poseExtractorCaffe.cpp +@@ -110,9 +110,10 @@ namespace op + try + { + // Add Caffe Net ++ std::string folder = modelFolder.empty() ? "/usr/lib/OpenPose/models/" : modelFolder; + netCaffe.emplace_back( +- std::make_shared<NetCaffe>(modelFolder + getPoseProtoTxt(poseModel), +- modelFolder + getPoseTrainedModel(poseModel), ++ std::make_shared<NetCaffe>(folder + getPoseProtoTxt(poseModel), ++ folder + getPoseTrainedModel(poseModel), + gpuId, enableGoogleLogging) + ); + // Initializing them on the thread |