From 55ff8f654ea271b97deecfa37addb15fc04b27e4 Mon Sep 17 00:00:00 2001 From: gineshidalgo99 Date: Thu, 18 Jan 2018 20:06:30 -0500 Subject: [PATCH] Windows debug version added --- .github/issue_template.md | 8 ++++---- 3rdparty/windows/getCaffe.bat | 2 +- CMakeLists.txt | 2 +- README.md | 2 +- doc/contributors.md | 5 +++-- doc/installation.md | 2 +- doc/installation_cmake.md | 2 +- doc/library_how_to_develop.md | 18 ++++++++++++++++-- include/openpose/wrapper/wrapper.hpp | 4 ++++ 9 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index cdbf5f39..41ea776d 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,8 +1,8 @@ ### Posting rules -1. **No** questions about **training**. OpenPose only implements testing. -2. **No** questions about **Caffe installation errors/issues**. Check [Caffe](http://caffe.berkeleyvision.org) documentation and help for those errors. -3. **No** questions about **CUDA check failed errors**. These errors are usually fixed by re-installing CUDA, re-installing the proper cuDNN version, and re-compiling (or re-installing) OpenPose. Otherwise, check for help in CUDA forums. -4. **Fill** the **Your System Configuration section (all of it!)** if you have some kind of error or performance question. +1. **Fill** the **Your System Configuration section (all of it!)** if you have some kind of error or performance question. +2. **No** questions about **training**. OpenPose only implements testing. +3. **No** questions about **Caffe installation errors/issues**. Check [Caffe](http://caffe.berkeleyvision.org) documentation and help for those errors. +4. **No** questions about **CUDA check failed errors**. These errors are usually fixed by re-installing CUDA, re-installing the proper cuDNN version, and re-compiling (or re-installing) OpenPose. Otherwise, check for help in CUDA forums. 5. **No duplicated** posts. 6. **No** posts about **questions already answered / clearly explained in** the **documentation** (e.g. **no more low-speed nor out-of-memory questions**). 7. Set a **proper issue title**: add the Ubuntu/Windows word and be specific (e.g. do not simple call it: `Compile error`). diff --git a/3rdparty/windows/getCaffe.bat b/3rdparty/windows/getCaffe.bat index 8d3a5198..08e59a90 100644 --- a/3rdparty/windows/getCaffe.bat +++ b/3rdparty/windows/getCaffe.bat @@ -7,7 +7,7 @@ SET WGET_EXE=wget\wget.exe :: Download temporary zip echo ----- Downloading Caffe ----- SET CAFEE_FOLDER=caffe\ -SET ZIP_NAME=caffe_2017_07_11.zip +SET ZIP_NAME=caffe_2018_01_18.zip SET ZIP_FULL_PATH=%CAFEE_FOLDER%%ZIP_NAME% %WGET_EXE% -c http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/%ZIP_NAME% -P %CAFEE_FOLDER% echo: diff --git a/CMakeLists.txt b/CMakeLists.txt index 0071b0f7..5c5bd17b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,7 +221,7 @@ if (WIN32) #TODO Add hashes download_zip("opencv_310.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 1e5240a64b814b3c0b822f136be78ad7) download_zip("caffe3rdparty_2017_07_14.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} ec0f800c8fb337e33304f3375bd06a80) - download_zip("caffe_2017_07_11.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 0302edc8843529f8ded1da74eae8e061) + download_zip("caffe_2018_01_18.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 4b8e548cc7ea20abea472950dd5301bd) if (WITH_3D) download_zip("freeglut_2018_01_14.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} BB182187285E06880F0EDE3A39530091) endif (WITH_3D) diff --git a/README.md b/README.md index 0371c8a4..840ce2dd 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Just comment on GitHub or make a pull request and we will answer as soon as poss ## Authors and Contributors -OpenPose is authored by [Gines Hidalgo](https://www.gineshidalgo.com/), [Zhe Cao](http://www.andrew.cmu.edu/user/zhecao), [Tomas Simon](http://www.cs.cmu.edu/~tsimon/), [Shih-En Wei](https://scholar.google.com/citations?user=sFQD3k4AAAAJ&hl=en), [Hanbyul Joo](http://www.cs.cmu.edu/~hanbyulj/), and [Yaser Sheikh](http://www.cs.cmu.edu/~yaser/). Currently, it is being maintained by [Gines Hidalgo](https://www.gineshidalgo.com/) and [Bikramjot Hanzra](https://www.linkedin.com/in/bikz05). The [original CVPR 2017 repo](https://github.com/ZheC/Multi-Person-Pose-Estimation) includes Matlab and Python versions, as well as the training code. The body pose estimation work is based on [the original ECCV 2016 demo](https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose). +OpenPose is authored by [Gines Hidalgo](https://www.gineshidalgo.com/), [Zhe Cao](http://www.andrew.cmu.edu/user/zhecao), [Tomas Simon](http://www.cs.cmu.edu/~tsimon/), [Shih-En Wei](https://scholar.google.com/citations?user=sFQD3k4AAAAJ&hl=en), [Hanbyul Joo](http://www.cs.cmu.edu/~hanbyulj/), and [Yaser Sheikh](http://www.cs.cmu.edu/~yaser/). Currently, it is being maintained by [Gines Hidalgo](https://www.gineshidalgo.com/), [Bikramjot Hanzra](https://www.linkedin.com/in/bikz05), and [Yaadhav Raaj](https://www.linkedin.com/in/yaadhavraaj). The [original CVPR 2017 repo](https://github.com/ZheC/Multi-Person-Pose-Estimation) includes Matlab and Python versions, as well as the training code. The body pose estimation work is based on [the original ECCV 2016 demo](https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose). In addition, OpenPose would not be possible without the [CMU Panoptic Studio dataset](http://domedb.perception.cs.cmu.edu/). diff --git a/doc/contributors.md b/doc/contributors.md index a6e77559..0498b6e7 100644 --- a/doc/contributors.md +++ b/doc/contributors.md @@ -11,5 +11,6 @@ OpenPose is authored by [Gines Hidalgo](https://www.gineshidalgo.com/), [Zhe Cao ### Contributors We would also like to thank the following people who have highly contributed to OpenPose: -1. [Bikramjot Hanzra](https://www.linkedin.com/in/bikz05): OpenPose maintainer and CMake version creator. -2. [Helen Medina](https://github.com/helen-medina): Windows version creator. +1. [Bikramjot Hanzra](https://www.linkedin.com/in/bikz05): OpenPose maintainer and CMake version. +2. [Yaadhav Raaj](https://www.linkedin.com/in/yaadhavraaj): OpenPose maintainer, CPU version, and OpenCL version. +3. [Helen Medina](https://github.com/helen-medina): Initial Windows version. diff --git a/doc/installation.md b/doc/installation.md index 5779f5e7..ece36eb6 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -160,7 +160,7 @@ Note: This installer will not incorporate any new features, we recommend to use - [Face model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/face/pose_iter_116000.caffemodel): download in `models/face/`. - [Hands model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel): download in `models/hand/`. - Dependencies: - - [Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_2017_07_11.zip): Unzip as `3rdparty/windows/caffe/`. + - [Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_2018_01_18.zip): Unzip as `3rdparty/windows/caffe/`. - [Caffe dependencies](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe3rdparty_2017_07_14.zip): Unzip as `3rdparty/windows/caffe3rdparty/`. - [OpenCV 3.1](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/opencv_310.zip): Unzip as `3rdparty/windows/opencv/`. 2. Open the Visual Studio project sln file by double-cliking on `{openpose_path}\windows\OpenPose.sln`. diff --git a/doc/installation_cmake.md b/doc/installation_cmake.md index 8bfbca12..c03a1f27 100644 --- a/doc/installation_cmake.md +++ b/doc/installation_cmake.md @@ -25,7 +25,7 @@ OpenPose - Installation using CMake ## Requirements -See [doc/quick_start.md#requirements](./quick_start.md#requirements). +See [doc/installation.md#requirements](./installation.md#requirements). diff --git a/doc/library_how_to_develop.md b/doc/library_how_to_develop.md index 5b2f2e0a..d12bcd11 100644 --- a/doc/library_how_to_develop.md +++ b/doc/library_how_to_develop.md @@ -10,6 +10,7 @@ OpenPose C++ API - How to Develop OpenPose 1. Class parameters should start with `m`, class pointers with `p`, shared_ptrs with `sp`, unique_ptrs with `up`, static parameters with `s`. 2. Function and class parameters coding style is the same other than the previous point. 3. Any parameters should not contain special characters, simply letters and numbers (preferred only letters) separated with upper case. E.g., `mThisIsAParameter`, `thisIsAParameter`. + 4. In addition, the names should be self-explanatory and not abbreviated. Good examples: `counter`, `thisIs. Bad examples: `ctr`, `var`. 2. Lenght: 1. Lines should contain up to 120 characters. 3. Comments: @@ -17,7 +18,8 @@ OpenPose C++ API - How to Develop OpenPose 2. There should be a (at least) 1-line comment for each block of code inside each function. 4. Loops and statements: 1. There should be a space between the keyword (`if`, `for`, etc) and the parenthesis, e.g.: `if (true)`. Wrong: `if(true)`. Note: So they can be easily located with Ctrl + F. - 2. Braces should be added in the following line with respect to the loop/statement keyword. E.g.: + 2. Braces should be added in the following line with respect to the loop/statement keyword. See example in point 3. + 3. 1-line loops/statements should not contain braces. E.g.: ``` if (booleanParameter) anotherParameter = 25; @@ -27,7 +29,18 @@ else differentParameter = 3; } ``` - 3. 1-line loops/statements should not contain braces. See previous example. + +5. Includes: + 1. They should be sorted in this order: + 1. Std libraries. + 2. OS libraries. + 3. 3rd party libraries (e.g. Caffe, OpenCV). + 4. OpenPose libraries. + 5. If it is a cpp file, the last one should be its own hpp. + 2. Inside each of the previous groups, it should be sorted alphabetically. +6. Functions arguments: + 1. It should first include the variables to be edited, and secondtly the const variables. + 2. Any variable that is not gonna be modified must be added with `const`. @@ -36,6 +49,7 @@ else ## Debugging C++ Code ### Finding Segmentation Faults This is the faster method to debug a segmentation fault problem. Usual scenario: You are editing OpenPose source code and suddenly OpenPose returns segmentation fault when executed. In order to find where it occurs: + 1. Select one of the 2 options: 1. Switch to debug mode. 2. Go to `openpose/utilities/errorAndLog.hpp` and modify `dLog`: diff --git a/include/openpose/wrapper/wrapper.hpp b/include/openpose/wrapper/wrapper.hpp index 202dca35..6171d996 100644 --- a/include/openpose/wrapper/wrapper.hpp +++ b/include/openpose/wrapper/wrapper.hpp @@ -541,6 +541,10 @@ namespace op #ifdef CPU_ONLY const auto numberThreads = (wrapperStructPose.gpuNumber == 0 ? 0 : 1); const auto gpuNumberStart = 0; + // Disabling multi-thread makes the code 400 ms faster (2.3 sec vs. 2.7 in i7-6850K) + // and fixes the bug that the screen was not properly displayed and only refreshed sometimes + // Note: The screen bug could be also fixed by using waitKey(30) rather than waitKey(1) + disableMultiThreading(); // GPU --> user picks (<= #GPUs) #else auto numberThreads = wrapperStructPose.gpuNumber;