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

CMake binaries end in as old Makefile

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