提交 97ea6f0e 编写于 作者: G gineshidalgo99

Lighter Caffe compiled by CMake

上级 159e8469
...@@ -282,10 +282,15 @@ if (UNIX AND NOT APPLE) ...@@ -282,10 +282,15 @@ if (UNIX AND NOT APPLE)
ExternalProject_Add(openpose_caffe ExternalProject_Add(openpose_caffe
SOURCE_DIR ${CAFFE_URL} SOURCE_DIR ${CAFFE_URL}
PREFIX ${CAFFE_PREFIX} PREFIX ${CAFFE_PREFIX}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DUSE_CUDNN=${USE_CUDNN} -DUSE_CUDNN=${USE_CUDNN}
-DBUILD_docs=OFF
-DBUILD_python=OFF -DBUILD_python=OFF
-DOpenCV_DIR=${OpenCV_DIR}) -DBUILD_python_layer=OFF
-DUSE_LEVELDB=OFF
-DUSE_LMDB=OFF
-DUSE_OPENCV=OFF)
# -DOpenCV_DIR=${OpenCV_DIR})
ExternalProject_Get_Property(openpose_caffe install_dir) ExternalProject_Get_Property(openpose_caffe install_dir)
......
OpenPose C++ API - How to Debug OpenPose OpenPose C++ API - How to Develop OpenPose
====================================================== ======================================================
# Finding Segmentation Faults
## OpenPose Coding Style
1. Naming:
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`.
2. Lenght:
1. Lines should contain up to 120 characters.
3. Comments:
1. Only `//` comments are allowed in the code, `/* */` should not be used.
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.:
```
if (booleanParameter)
anotherParameter = 25;
else
{
anotherParameter = 2;
differentParameter = 3;
}
```
3. 1-line loops/statements should not contain braces. See previous example.
## 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: 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. Select one of the 2 options:
1. Switch to debug mode. 1. Switch to debug mode.
...@@ -10,3 +43,29 @@ This is the faster method to debug a segmentation fault problem. Usual scenario: ...@@ -10,3 +43,29 @@ This is the faster method to debug a segmentation fault problem. Usual scenario:
2. Call OpenPose with `--logging_level 0 --disable_multi_thread`. 2. Call OpenPose with `--logging_level 0 --disable_multi_thread`.
3. At this point you have an idea of in which file class the segmentation fault is coming from. Now you can further isolate the error by iteratively adding the following line all over the code until you find the exact position of the segmentation fault: `log("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);` 3. At this point you have an idea of in which file class the segmentation fault is coming from. Now you can further isolate the error by iteratively adding the following line all over the code until you find the exact position of the segmentation fault: `log("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);`
4. After you have found the segmentation fault, remember to remove all the extra `log()` calls that you temporaryly added. 4. After you have found the segmentation fault, remember to remove all the extra `log()` calls that you temporaryly added.
## Speed
### Measuring Runtime Speed
1. Enable `PROFILER_ENABLED` with CMake or in the `Makefile.config` file.
2. By default, it should print out average runtime info after 1000 frames. You can change this number with `--profile_speed`, e.g., `--profile_speed 100`.
## Accuracy
### Checking OpenPose Accuracy Quantitatively
1. Download OpenPose training code: https://github.com/CMU-Perceptual-Computing-Lab/openpose_train
2. Download val2017 set from COCO: http://images.cocodataset.org/zips/val2017.zip
3. Get JSONs in OpenPose: examples/tests/pose_accuracy_coco_val.sh
4. Get accuracy (Matlab): validation/f_getValidations.m
### Checking Ground-Truth Labes
From the [COCO dataset](http://cocodataset.org/#download):
1. Download 2014 or 2017 Train/Val annotations.
2. Download the [COCO API](https://github.com/cocodataset/cocoapi).
3. With the COCO API (either Python, Matlab, or LUA ones), you can check any image with the image ID (equivalent to the number in the image name).
...@@ -175,6 +175,9 @@ OpenPose Library - Release Notes ...@@ -175,6 +175,9 @@ OpenPose Library - Release Notes
3. Caffe added as submodule. 3. Caffe added as submodule.
4. CMake installer compatible with Windows. 4. CMake installer compatible with Windows.
5. Added freeglut download script (3-D reconstruction demo for Windows). 5. Added freeglut download script (3-D reconstruction demo for Windows).
6. Added Debug version for Windows (CMake).
7. Runtime verbose about average speed configurable by user with `PROFILER_ENABLED` option (CMake/Makefile.config) and `--profile_speed` flag.
8. Lighter Caffe version compiled by CMake in Ubuntu: disabled Caffe extra support (e.g., OpenCV, Python) and doc.
2. Main bugs fixed: 2. Main bugs fixed:
1. Slight speed up (~1%) for performing the non-maximum suppression stage only in the body part heatmaps channels, and not also in the PAF channels. 1. Slight speed up (~1%) for performing the non-maximum suppression stage only in the body part heatmaps channels, and not also in the PAF channels.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册