提交 9fc452e7 编写于 作者: G gineshidalgo99

CMake binaries end in as old Makefile

上级 97ea6f0e
......@@ -119,6 +119,11 @@ elseif (${GPU_MODE} MATCHES "CPU_ONLY")
add_definitions(-DCPU_ONLY)
endif ()
# Set/disable profiler
if (PROFILER_ENABLED)
add_definitions(-DPROFILER_ENABLED)
endif (PROFILER_ENABLED)
# Suboptions for GPU architectures
if (${GPU_MODE} MATCHES "CUDA")
set(CUDA_ARCH Auto CACHE STRING "Select target NVIDIA GPU achitecture.")
......@@ -410,10 +415,3 @@ if (UNIX AND NOT APPLE)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif (UNIX AND NOT APPLE)
### OPENPOSE FLAGS
# Set/disable profiler
if (PROFILER_ENABLED)
add_definitions(-DPROFILER_ENABLED)
endif (PROFILER_ENABLED)
......@@ -186,7 +186,7 @@ Each flag is divided into flag name, default value, and description.
9. OpenPose Rendering Pose
- DEFINE_double(render_threshold, 0.05, "Only estimated keypoints whose score confidences are higher than this threshold will be rendered. Generally, a high threshold (> 0.5) will only render very clear body parts; while small thresholds (~0.1) will also output guessed and occluded keypoints, but also more false positives (i.e. wrong detections).");
- DEFINE_int32(render_pose, 2, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will render both `outputData` and `cvOutputData` with the original image and desired body part to be shown (i.e. keypoints, heat maps or PAFs).");
- DEFINE_int32(render_pose, -1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering (slower but greater functionality, e.g. `alpha_X` flags). If -1, it will pick CPU if CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render both `outputData` and `cvOutputData` with the original image and desired body part to be shown (i.e. keypoints, heat maps or PAFs).");
- DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will hide it. Only valid for GPU rendering.");
- DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the heatmap, 0 will only show the frame. Only valid for GPU rendering.");
......
......@@ -178,6 +178,7 @@ OpenPose Library - Release Notes
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.
9. Renamed CMake binaries (Ubuntu) to match old Makefile format: `_bin` by `.bin`.
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.
......
......@@ -6,7 +6,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
set(EXE_NAME "${SOURCE_NAME}.bin")
elseif (WIN32)
set(EXE_NAME "OpenPoseDemo")
endif ()
......
......@@ -144,10 +144,11 @@ DEFINE_double(render_threshold, 0.05, "Only estimated keypoint
" rendered. Generally, a high threshold (> 0.5) will only render very clear body parts;"
" while small thresholds (~0.1) will also output guessed and occluded keypoints, but also"
" more false positives (i.e. wrong detections).");
DEFINE_int32(render_pose, 2, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will"
" render both `outputData` and `cvOutputData` with the original image and desired body part"
" to be shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_int32(render_pose, -1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If -1, it will pick CPU if"
" CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render"
" both `outputData` and `cvOutputData` with the original image and desired body part to be"
" shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will"
" hide it. Only valid for GPU rendering.");
DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the"
......
......@@ -6,7 +6,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
set(EXE_NAME "${SOURCE_NAME}.bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
......
......@@ -153,10 +153,11 @@ DEFINE_double(render_threshold, 0.05, "Only estimated keypoint
" rendered. Generally, a high threshold (> 0.5) will only render very clear body parts;"
" while small thresholds (~0.1) will also output guessed and occluded keypoints, but also"
" more false positives (i.e. wrong detections).");
DEFINE_int32(render_pose, 2, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will"
" render both `outputData` and `cvOutputData` with the original image and desired body part"
" to be shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_int32(render_pose, -1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If -1, it will pick CPU if"
" CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render"
" both `outputData` and `cvOutputData` with the original image and desired body part to be"
" shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will"
" hide it. Only valid for GPU rendering.");
DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the"
......
......@@ -8,7 +8,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
set(EXE_NAME "${SOURCE_NAME}.bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
......
......@@ -7,7 +7,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
set(EXE_NAME "${SOURCE_NAME}.bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
......
......@@ -9,7 +9,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
set(EXE_NAME "${SOURCE_NAME}.bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
......
......@@ -143,10 +143,11 @@ DEFINE_double(render_threshold, 0.05, "Only estimated keypoint
" rendered. Generally, a high threshold (> 0.5) will only render very clear body parts;"
" while small thresholds (~0.1) will also output guessed and occluded keypoints, but also"
" more false positives (i.e. wrong detections).");
DEFINE_int32(render_pose, 2, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will"
" render both `outputData` and `cvOutputData` with the original image and desired body part"
" to be shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_int32(render_pose, -1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If -1, it will pick CPU if"
" CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render"
" both `outputData` and `cvOutputData` with the original image and desired body part to be"
" shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will"
" hide it. Only valid for GPU rendering.");
DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the"
......
......@@ -126,10 +126,11 @@ DEFINE_double(render_threshold, 0.05, "Only estimated keypoint
" rendered. Generally, a high threshold (> 0.5) will only render very clear body parts;"
" while small thresholds (~0.1) will also output guessed and occluded keypoints, but also"
" more false positives (i.e. wrong detections).");
DEFINE_int32(render_pose, 2, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will"
" render both `outputData` and `cvOutputData` with the original image and desired body part"
" to be shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_int32(render_pose, -1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If -1, it will pick CPU if"
" CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render"
" both `outputData` and `cvOutputData` with the original image and desired body part to be"
" shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will"
" hide it. Only valid for GPU rendering.");
DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the"
......
......@@ -126,10 +126,11 @@ DEFINE_double(render_threshold, 0.05, "Only estimated keypoint
" rendered. Generally, a high threshold (> 0.5) will only render very clear body parts;"
" while small thresholds (~0.1) will also output guessed and occluded keypoints, but also"
" more false positives (i.e. wrong detections).");
DEFINE_int32(render_pose, 2, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will"
" render both `outputData` and `cvOutputData` with the original image and desired body part"
" to be shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_int32(render_pose, -1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If -1, it will pick CPU if"
" CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render"
" both `outputData` and `cvOutputData` with the original image and desired body part to be"
" shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will"
" hide it. Only valid for GPU rendering.");
DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the"
......
......@@ -10,7 +10,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
set(EXE_NAME "${SOURCE_NAME}.bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
......
......@@ -128,9 +128,10 @@ DEFINE_double(render_threshold, 0.05, "Only estimated keypoint
" while small thresholds (~0.1) will also output guessed and occluded keypoints, but also"
" more false positives (i.e. wrong detections).");
DEFINE_int32(render_pose, 1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
" (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will"
" render both `outputData` and `cvOutputData` with the original image and desired body part"
" to be shown (i.e. keypoints, heat maps or PAFs).");
" (slower but greater functionality, e.g. `alpha_X` flags). If -1, it will pick CPU if"
" CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render"
" both `outputData` and `cvOutputData` with the original image and desired body part to be"
" shown (i.e. keypoints, heat maps or PAFs).");
DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will"
" hide it. Only valid for GPU rendering.");
DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the"
......
......@@ -531,25 +531,36 @@ namespace op
error("Body keypoint detection must be enabled in order to run hand keypoint detection.",
__LINE__, __FUNCTION__, __FILE__);
}
// Get number GPUs
auto gpuNumber = wrapperStructPose.gpuNumber;
const auto gpuNumberStart = wrapperStructPose.gpuNumberStart;
// If number GPU < 0 --> set it to all the available GPUs
if (gpuNumber < 0)
{
// Get total number GPUs
const auto totalGpuNumber = getGpuNumber();
if (totalGpuNumber <= gpuNumberStart)
error("Number of initial GPUs (`--number_gpu_start`) must be lower than the total number of used"
" GPUs (`--number_gpu`)", __LINE__, __FUNCTION__, __FILE__);
gpuNumber = totalGpuNumber - gpuNumberStart;
// Reset initial GPU to 0 (we want them all)
// Logging message
log("Auto-detecting all available GPUs... Detected " + std::to_string(totalGpuNumber)
+ " GPU(s), using " + std::to_string(gpuNumber) + " of them starting at GPU "
+ std::to_string(gpuNumberStart) + ".", Priority::High);
}
#ifdef CPU_ONLY
if (wrapperStructPose.gpuNumber > 0)
error("GPU number must be negative or 0 if CPU_ONLY is enabled.", __LINE__, __FUNCTION__, __FILE__);
#endif
// Get number threads
// CPU --> 1 thread or no pose extraction
#ifdef CPU_ONLY
const auto numberThreads = (wrapperStructPose.gpuNumber == 0 ? 0 : 1);
const auto gpuNumberStart = 0;
// GPU --> user picks (<= #GPUs)
#else
auto numberThreads = wrapperStructPose.gpuNumber;
const auto gpuNumberStart = wrapperStructPose.gpuNumberStart;
// If number GPU < 0 --> set it to all the available GPUs
if (numberThreads < 0)
{
// Get total number GPUs
const auto totalGpuNumber = getGpuNumber();
if (totalGpuNumber <= gpuNumberStart)
error("Number of initial GPUs (`--number_gpu_start`) must be lower than the total number of used"
" GPUs (`--number_gpu`)", __LINE__, __FUNCTION__, __FILE__);
numberThreads = totalGpuNumber - gpuNumberStart;
// Reset initial GPU to 0 (we want them all)
// Logging message
log("Auto-detecting all available GPUs... Detected " + std::to_string(totalGpuNumber)
+ " GPU(s), using " + std::to_string(numberThreads) + " of them starting at GPU "
+ std::to_string(gpuNumberStart) + ".", Priority::High);
}
#endif
// Proper format
const auto writeImagesCleaned = formatAsDirectory(wrapperStructOutput.writeImages);
......@@ -594,7 +605,7 @@ namespace op
std::vector<std::shared_ptr<PoseExtractor>> poseExtractors;
std::vector<std::shared_ptr<PoseGpuRenderer>> poseGpuRenderers;
std::shared_ptr<PoseCpuRenderer> poseCpuRenderer;
if (gpuNumber > 0)
if (numberThreads > 0)
{
// Get input scales and sizes
const auto scaleAndSizeExtractor = std::make_shared<ScaleAndSizeExtractor>(
......@@ -615,11 +626,11 @@ namespace op
// Pose estimators & renderers
std::vector<TWorker> cpuRenderers;
spWPoses.clear();
spWPoses.resize(gpuNumber);
spWPoses.resize(numberThreads);
if (wrapperStructPose.enable)
{
// Pose estimators
for (auto gpuId = 0; gpuId < gpuNumber; gpuId++)
for (auto gpuId = 0; gpuId < numberThreads; gpuId++)
poseExtractors.emplace_back(std::make_shared<PoseExtractorCaffe>(
wrapperStructPose.poseModel, modelFolder, gpuId + gpuNumberStart,
wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
......@@ -925,7 +936,7 @@ namespace op
|| mThreadManagerMode == ThreadManagerMode::Asynchronous
|| mThreadManagerMode == ThreadManagerMode::AsynchronousOut))
{
const auto guiInfoAdder = std::make_shared<GuiInfoAdder>(gpuNumber, wrapperStructOutput.displayGui);
const auto guiInfoAdder = std::make_shared<GuiInfoAdder>(numberThreads, wrapperStructOutput.displayGui);
mOutputWs.emplace_back(std::make_shared<WGuiInfoAdder<TDatumsPtr>>(guiInfoAdder));
}
// Minimal graphical user interface (GUI)
......
......@@ -210,12 +210,25 @@ namespace op
{
try
{
if (renderFlag == -1 && renderPoseFlag != -2)
// Body: to auto-pick CPU/GPU depending on CPU_ONLY/CUDA
if (renderFlag == -1 && renderPoseFlag == -2)
{
#ifdef USE_CUDA
return RenderMode::Gpu;
#else
return RenderMode::Cpu;
#endif
}
// Face and hand: to pick same than body
else if (renderFlag == -1 && renderPoseFlag != -2)
return flagsToRenderMode(renderPoseFlag, -2);
// No render
else if (renderFlag == 0)
return RenderMode::None;
// CPU render
else if (renderFlag == 1)
return RenderMode::Cpu;
// GPU render
else if (renderFlag == 2)
return RenderMode::Gpu;
// else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册