Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sq975
openpose
提交
5de57b80
O
openpose
项目概览
sq975
/
openpose
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openpose
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5de57b80
编写于
10月 09, 2017
作者:
G
gineshidalgo99
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GLog not required in demos
上级
35a02f16
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
119 addition
and
179 deletion
+119
-179
examples/openpose/openpose.cpp
examples/openpose/openpose.cpp
+5
-5
examples/openpose/openposeBasicDemo.cpp
examples/openpose/openposeBasicDemo.cpp
+0
-86
examples/tests/handFromJsonTest.cpp
examples/tests/handFromJsonTest.cpp
+12
-10
examples/tutorial_pose/1_extract_from_image.cpp
examples/tutorial_pose/1_extract_from_image.cpp
+4
-5
examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.cpp
...es/tutorial_pose/2_extract_pose_or_heatmat_from_image.cpp
+4
-5
examples/tutorial_thread/1_openpose_read_and_display.cpp
examples/tutorial_thread/1_openpose_read_and_display.cpp
+1
-5
examples/tutorial_thread/2_user_processing_function.cpp
examples/tutorial_thread/2_user_processing_function.cpp
+0
-4
examples/tutorial_thread/3_user_input_processing_and_output.cpp
...es/tutorial_thread/3_user_input_processing_and_output.cpp
+0
-4
examples/tutorial_thread/4_user_input_processing_output_and_datum.cpp
...orial_thread/4_user_input_processing_output_and_datum.cpp
+0
-4
examples/tutorial_wrapper/1_user_asynchronous_output.cpp
examples/tutorial_wrapper/1_user_asynchronous_output.cpp
+5
-5
examples/tutorial_wrapper/2_user_synchronous.cpp
examples/tutorial_wrapper/2_user_synchronous.cpp
+5
-5
examples/tutorial_wrapper/3_user_asynchronous.cpp
examples/tutorial_wrapper/3_user_asynchronous.cpp
+5
-5
examples_beta/openpose3d/openpose3d.cpp
examples_beta/openpose3d/openpose3d.cpp
+5
-5
include/openpose/core/netCaffe.hpp
include/openpose/core/netCaffe.hpp
+1
-0
include/openpose/face/faceExtractorCaffe.hpp
include/openpose/face/faceExtractorCaffe.hpp
+5
-4
include/openpose/hand/handExtractorCaffe.hpp
include/openpose/hand/handExtractorCaffe.hpp
+6
-5
include/openpose/pose/poseExtractorCaffe.hpp
include/openpose/pose/poseExtractorCaffe.hpp
+2
-1
include/openpose/wrapper/wrapper.hpp
include/openpose/wrapper/wrapper.hpp
+6
-3
include/openpose/wrapper/wrapperStructPose.hpp
include/openpose/wrapper/wrapperStructPose.hpp
+11
-1
src/openpose/core/netCaffe.cpp
src/openpose/core/netCaffe.cpp
+22
-3
src/openpose/face/faceExtractorCaffe.cpp
src/openpose/face/faceExtractorCaffe.cpp
+5
-4
src/openpose/hand/handExtractorCaffe.cpp
src/openpose/hand/handExtractorCaffe.cpp
+6
-4
src/openpose/pose/poseExtractorCaffe.cpp
src/openpose/pose/poseExtractorCaffe.cpp
+5
-4
src/openpose/wrapper/wrapperStructPose.cpp
src/openpose/wrapper/wrapperStructPose.cpp
+4
-2
未找到文件。
examples/openpose/openpose.cpp
浏览文件 @
5de57b80
...
...
@@ -25,7 +25,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/headers.hpp>
...
...
@@ -197,6 +196,9 @@ int openPoseDemo()
const
auto
keypointScale
=
op
::
flagsToScaleMode
(
FLAGS_keypoint_scale
);
// heatmaps to add
const
auto
heatMapTypes
=
op
::
flagsToHeatMaps
(
FLAGS_heatmaps_add_parts
,
FLAGS_heatmaps_add_bkg
,
FLAGS_heatmaps_add_PAFs
);
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// OpenPose wrapper
...
...
@@ -208,7 +210,8 @@ int openPoseDemo()
op
::
flagsToRenderMode
(
FLAGS_render_pose
),
poseModel
,
!
FLAGS_disable_blending
,
(
float
)
FLAGS_alpha_pose
,
(
float
)
FLAGS_alpha_heatmap
,
FLAGS_part_to_show
,
FLAGS_model_folder
,
heatMapTypes
,
op
::
ScaleMode
::
UnsignedChar
,
(
float
)
FLAGS_render_threshold
};
heatMapTypes
,
op
::
ScaleMode
::
UnsignedChar
,
(
float
)
FLAGS_render_threshold
,
enableGoogleLogging
};
// Face configuration (use op::WrapperStructFace{} to disable it)
const
op
::
WrapperStructFace
wrapperStructFace
{
FLAGS_face
,
faceNetInputSize
,
op
::
flagsToRenderMode
(
FLAGS_face_render
,
FLAGS_render_pose
),
(
float
)
FLAGS_face_alpha_pose
,
(
float
)
FLAGS_face_alpha_heatmap
,
(
float
)
FLAGS_face_render_threshold
};
...
...
@@ -267,9 +270,6 @@ int openPoseDemo()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseDemo"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/openpose/openposeBasicDemo.cpp
已删除
100644 → 0
浏览文件 @
35a02f16
// ------------------------- OpenPose Library Tutorial - Real Time Pose Estimation -------------------------
// C++ std library dependencies
#include <chrono> // `std::chrono::` functions and classes, e.g. std::chrono::milliseconds
#include <thread> // std::this_thread
// Other 3rdparty dependencies
// GFlags: DEFINE_bool, _int32, _int64, _uint64, _double, _string
#include <gflags/gflags.h>
// Allow Google Flags in Ubuntu 14
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/headers.hpp>
// See all the available parameter options withe the `--help` flag. E.g. `./build/examples/openpose/openpose.bin --help`.
// Note: This command will show you flags for other unnecessary 3rdparty files. Check only the flags for the OpenPose
// executable. E.g. for `openpose.bin`, look for `Flags from examples/openpose/openpose.cpp:`.
// Producer
DEFINE_int32
(
camera
,
-
1
,
"The camera index for cv::VideoCapture. Integer in the range [0, 9]. Select a negative"
" number (by default), to auto-detect and open the first available camera."
);
DEFINE_string
(
camera_resolution
,
"1280x720"
,
"Size of the camera frames to ask for."
);
DEFINE_double
(
camera_fps
,
30.0
,
"Frame rate for the webcam (only used when saving video from webcam). Set this value to the"
" minimum value between the OpenPose displayed speed and the webcam real frame rate."
);
DEFINE_string
(
video
,
""
,
"Use a video file instead of the camera. Use `examples/media/video.avi` for our default"
" example video."
);
DEFINE_string
(
image_dir
,
""
,
"Process a directory of images. Use `examples/media/` for our default example folder with 20"
" images. Read all standard formats (jpg, png, bmp, etc.)."
);
DEFINE_string
(
ip_camera
,
""
,
"String with the IP camera URL. It supports protocols like RTSP and HTTP."
);
// Display
DEFINE_bool
(
no_gui_verbose
,
false
,
"Do not write text on output images on GUI (e.g. number of current frame and people). It"
" does not affect the pose rendering."
);
DEFINE_bool
(
no_display
,
false
,
"Do not open a display window. Useful if there is no X server and/or to slightly speed up"
" the processing if visual output is not required."
);
int
openPoseDemo
()
{
op
::
log
(
"Starting pose estimation demo."
,
op
::
Priority
::
High
);
const
auto
timerBegin
=
std
::
chrono
::
high_resolution_clock
::
now
();
// Applying user defined configuration - Google flags to program variables
const
auto
producerSharedPtr
=
op
::
flagsToProducer
(
FLAGS_image_dir
,
FLAGS_video
,
FLAGS_ip_camera
,
FLAGS_camera
,
FLAGS_camera_resolution
,
FLAGS_camera_fps
);
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// OpenPose wrapper
op
::
log
(
"Configuring OpenPose wrapper."
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
op
::
Wrapper
<
std
::
vector
<
op
::
Datum
>>
opWrapper
;
// Pose configuration (use WrapperStructPose{} for default and recommended configuration)
op
::
WrapperStructPose
wrapperStructPose
{};
wrapperStructPose
.
renderMode
=
op
::
RenderMode
::
Gpu
;
// Producer (use default to disable any input)
const
op
::
WrapperStructInput
wrapperStructInput
{
producerSharedPtr
};
// Consumer (comment or use default argument to disable any output)
const
op
::
WrapperStructOutput
wrapperStructOutput
{
!
FLAGS_no_display
,
!
FLAGS_no_gui_verbose
};
// Configure wrapper
opWrapper
.
configure
(
wrapperStructPose
,
wrapperStructInput
,
wrapperStructOutput
);
// Set to single-thread running (e.g. for debugging purposes)
// opWrapper.disableMultiThreading();
// Start processing
// Two different ways of running the program on multithread environment
op
::
log
(
"Starting thread(s)"
,
op
::
Priority
::
High
);
opWrapper
.
exec
();
// It blocks this thread until all threads have finished
// Measuring total time
const
auto
now
=
std
::
chrono
::
high_resolution_clock
::
now
();
const
auto
totalTimeSec
=
(
double
)
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
now
-
timerBegin
).
count
()
*
1e-9
;
const
auto
message
=
"Real-time pose estimation demo successfully finished. Total time: "
+
std
::
to_string
(
totalTimeSec
)
+
" seconds."
;
op
::
log
(
message
,
op
::
Priority
::
High
);
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseDemo"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
// Running openPoseDemo
return
openPoseDemo
();
}
examples/tests/handFromJsonTest.cpp
浏览文件 @
5de57b80
...
...
@@ -8,7 +8,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
#include <openpose/headers.hpp>
#include "wrapperHandFromJsonTest.hpp"
...
...
@@ -36,7 +35,8 @@ DEFINE_string(write_keypoint_json, "", "");
int
handFromJsonTest
()
{
// logging_level
op
::
check
(
0
<=
FLAGS_logging_level
&&
FLAGS_logging_level
<=
255
,
"Wrong logging_level value."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
op
::
check
(
0
<=
FLAGS_logging_level
&&
FLAGS_logging_level
<=
255
,
"Wrong logging_level value."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
op
::
ConfigureLog
::
setPriorityThreshold
((
op
::
Priority
)
FLAGS_logging_level
);
// op::ConfigureLog::setPriorityThreshold(op::Priority::None); // To print all logging messages
...
...
@@ -48,22 +48,26 @@ int handFromJsonTest()
const
auto
handNetInputSize
=
op
::
flagsToPoint
(
FLAGS_hand_net_resolution
,
"368x368 (multiples of 16)"
);
// producerType
const
auto
producerSharedPtr
=
op
::
flagsToProducer
(
FLAGS_image_dir
,
""
,
""
,
0
);
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// OpenPose wrapper
op
::
log
(
"Configuring OpenPose wrapper."
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
op
::
WrapperHandFromJsonTest
<
std
::
vector
<
op
::
Datum
>>
opWrapper
;
// Pose configuration (use WrapperStructPose{} for default and recommended configuration)
op
::
WrapperStructPose
wrapperStructPose
{
true
,
op
::
flagsToPoint
(
"656x368"
),
op
::
flagsToPoint
(
"1280x720"
),
op
::
ScaleMode
::
InputResolution
,
FLAGS_num_gpu
,
FLAGS_num_gpu_start
};
op
::
WrapperStructPose
wrapperStructPose
{
false
,
op
::
flagsToPoint
(
"656x368"
),
op
::
flagsToPoint
(
"1280x720"
),
op
::
ScaleMode
::
InputResolution
,
FLAGS_num_gpu
,
FLAGS_num_gpu_start
,
true
,
enableGoogleLogging
};
wrapperStructPose
.
modelFolder
=
FLAGS_model_folder
;
// Hand configuration (use op::WrapperStructHand{} to disable it)
const
op
::
WrapperStructHand
wrapperStructHand
{
FLAGS_hand
,
handNetInputSize
,
FLAGS_hand_scale_number
,
(
float
)
FLAGS_hand_scale_range
,
FLAGS_hand_tracking
,
op
::
flagsToRenderMode
(
1
)};
// Configure wrapper
opWrapper
.
configure
(
wrapperStructPose
,
wrapperStructHand
,
producerSharedPtr
,
FLAGS_hand_ground_truth
,
FLAGS_write_keypoint_json
,
!
FLAGS_no_display
);
opWrapper
.
configure
(
wrapperStructPose
,
wrapperStructHand
,
producerSharedPtr
,
FLAGS_hand_ground_truth
,
FLAGS_write_keypoint_json
,
!
FLAGS_no_display
);
// Start processing
op
::
log
(
"Starting thread(s)"
,
op
::
Priority
::
High
);
...
...
@@ -72,7 +76,8 @@ int handFromJsonTest()
// Measuring total time
const
auto
now
=
std
::
chrono
::
high_resolution_clock
::
now
();
const
auto
totalTimeSec
=
(
double
)
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
now
-
timerBegin
).
count
()
*
1e-9
;
const
auto
message
=
"Real-time pose estimation demo successfully finished. Total time: "
+
std
::
to_string
(
totalTimeSec
)
+
" seconds."
;
const
auto
message
=
"Real-time pose estimation demo successfully finished. Total time: "
+
std
::
to_string
(
totalTimeSec
)
+
" seconds."
;
op
::
log
(
message
,
op
::
Priority
::
High
);
return
0
;
...
...
@@ -80,9 +85,6 @@ int handFromJsonTest()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"handFromJsonTest"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_pose/1_extract_from_image.cpp
浏览文件 @
5de57b80
...
...
@@ -15,7 +15,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/core/headers.hpp>
#include <openpose/filestream/headers.hpp>
...
...
@@ -86,6 +85,8 @@ int openPoseTutorialPose1()
if
(
FLAGS_scale_gap
<=
0.
&&
FLAGS_scale_number
>
1
)
op
::
error
(
"Incompatible flag configuration: scale_gap must be greater than 0 or scale_number = 1."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Step 3 - Initialize all required classes
...
...
@@ -93,7 +94,8 @@ int openPoseTutorialPose1()
op
::
CvMatToOpInput
cvMatToOpInput
;
op
::
CvMatToOpOutput
cvMatToOpOutput
;
op
::
PoseExtractorCaffe
poseExtractorCaffe
{
netInputSize
,
netOutputSize
,
outputSize
,
FLAGS_scale_number
,
poseModel
,
FLAGS_model_folder
,
FLAGS_num_gpu_start
};
FLAGS_model_folder
,
FLAGS_num_gpu_start
,
{},
op
::
ScaleMode
::
ZeroToOne
,
enableGoogleLogging
};
op
::
PoseCpuRenderer
poseRenderer
{
poseModel
,
(
float
)
FLAGS_render_threshold
,
!
FLAGS_disable_blending
,
(
float
)
FLAGS_alpha_pose
};
op
::
OpOutputToCvMat
opOutputToCvMat
;
...
...
@@ -138,9 +140,6 @@ int openPoseTutorialPose1()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialPose1"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.cpp
浏览文件 @
5de57b80
...
...
@@ -15,7 +15,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/core/headers.hpp>
#include <openpose/filestream/headers.hpp>
...
...
@@ -91,6 +90,8 @@ int openPoseTutorialPose2()
if
(
FLAGS_scale_gap
<=
0.
&&
FLAGS_scale_number
>
1
)
op
::
error
(
"Incompatible flag configuration: scale_gap must be greater than 0 or scale_number = 1."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Step 3 - Initialize all required classes
...
...
@@ -98,7 +99,8 @@ int openPoseTutorialPose2()
op
::
CvMatToOpInput
cvMatToOpInput
;
op
::
CvMatToOpOutput
cvMatToOpOutput
;
auto
poseExtractorPtr
=
std
::
make_shared
<
op
::
PoseExtractorCaffe
>
(
netInputSize
,
netOutputSize
,
outputSize
,
FLAGS_scale_number
,
poseModel
,
FLAGS_model_folder
,
FLAGS_num_gpu_start
netInputSize
,
netOutputSize
,
outputSize
,
FLAGS_scale_number
,
poseModel
,
FLAGS_model_folder
,
FLAGS_num_gpu_start
,
std
::
vector
<
op
::
HeatMapType
>
{},
op
::
ScaleMode
::
ZeroToOne
,
enableGoogleLogging
);
op
::
PoseGpuRenderer
poseGpuRenderer
{
poseModel
,
poseExtractorPtr
,
(
float
)
FLAGS_render_threshold
,
!
FLAGS_disable_blending
,
(
float
)
FLAGS_alpha_pose
,
(
float
)
FLAGS_alpha_heatmap
};
...
...
@@ -146,9 +148,6 @@ int openPoseTutorialPose2()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialPose2"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_thread/1_openpose_read_and_display.cpp
浏览文件 @
5de57b80
...
...
@@ -14,7 +14,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/core/headers.hpp>
#include <openpose/gui/headers.hpp>
...
...
@@ -71,7 +70,7 @@ int openPoseTutorialThread1()
videoSeekSharedPtr
->
first
=
false
;
videoSeekSharedPtr
->
second
=
0
;
const
op
::
Point
<
int
>
producerSize
{(
int
)
producerSharedPtr
->
get
(
CV_CAP_PROP_FRAME_WIDTH
),
(
int
)
producerSharedPtr
->
get
(
CV_CAP_PROP_FRAME_HEIGHT
)};
(
int
)
producerSharedPtr
->
get
(
CV_CAP_PROP_FRAME_HEIGHT
)};
// Step 4 - Setting thread workers && manager
typedef
std
::
vector
<
op
::
Datum
>
TypedefDatumsNoPtr
;
typedef
std
::
shared_ptr
<
TypedefDatumsNoPtr
>
TypedefDatums
;
...
...
@@ -138,9 +137,6 @@ int openPoseTutorialThread1()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialThread1"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_thread/2_user_processing_function.cpp
浏览文件 @
5de57b80
...
...
@@ -15,7 +15,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/core/headers.hpp>
#include <openpose/gui/headers.hpp>
...
...
@@ -180,9 +179,6 @@ int openPoseTutorialThread2()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialThread2"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_thread/3_user_input_processing_and_output.cpp
浏览文件 @
5de57b80
...
...
@@ -15,7 +15,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
// Option a) Importing all modules
#include <openpose/headers.hpp>
...
...
@@ -228,9 +227,6 @@ int openPoseTutorialThread3()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialThread3"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_thread/4_user_input_processing_output_and_datum.cpp
浏览文件 @
5de57b80
...
...
@@ -15,7 +15,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
// Option a) Importing all modules
#include <openpose/headers.hpp>
...
...
@@ -241,9 +240,6 @@ int openPoseTutorialThread4()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialThread4"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_wrapper/1_user_asynchronous_output.cpp
浏览文件 @
5de57b80
...
...
@@ -25,7 +25,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/headers.hpp>
...
...
@@ -289,6 +288,9 @@ int openPoseTutorialWrapper3()
op
::
check
(
FLAGS_heatmaps_scale
>=
0
&&
FLAGS_heatmaps_scale
<=
2
,
"Non valid `heatmaps_scale`."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
const
auto
heatMapScale
=
(
FLAGS_heatmaps_scale
==
0
?
op
::
ScaleMode
::
PlusMinusOne
:
(
FLAGS_heatmaps_scale
==
1
?
op
::
ScaleMode
::
ZeroToOne
:
op
::
ScaleMode
::
UnsignedChar
));
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Configure OpenPose
...
...
@@ -300,7 +302,8 @@ int openPoseTutorialWrapper3()
op
::
flagsToRenderMode
(
FLAGS_render_pose
),
poseModel
,
!
FLAGS_disable_blending
,
(
float
)
FLAGS_alpha_pose
,
(
float
)
FLAGS_alpha_heatmap
,
FLAGS_part_to_show
,
FLAGS_model_folder
,
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
};
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
,
enableGoogleLogging
};
// Face configuration (use op::WrapperStructFace{} to disable it)
const
op
::
WrapperStructFace
wrapperStructFace
{
FLAGS_face
,
faceNetInputSize
,
op
::
flagsToRenderMode
(
FLAGS_face_render
,
FLAGS_render_pose
),
(
float
)
FLAGS_face_alpha_pose
,
(
float
)
FLAGS_face_alpha_heatmap
,
(
float
)
FLAGS_face_render_threshold
};
...
...
@@ -357,9 +360,6 @@ int openPoseTutorialWrapper3()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialWrapper3"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_wrapper/2_user_synchronous.cpp
浏览文件 @
5de57b80
...
...
@@ -25,7 +25,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/headers.hpp>
...
...
@@ -365,6 +364,9 @@ int openPoseTutorialWrapper2()
op
::
check
(
FLAGS_heatmaps_scale
>=
0
&&
FLAGS_heatmaps_scale
<=
2
,
"Non valid `heatmaps_scale`."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
const
auto
heatMapScale
=
(
FLAGS_heatmaps_scale
==
0
?
op
::
ScaleMode
::
PlusMinusOne
:
(
FLAGS_heatmaps_scale
==
1
?
op
::
ScaleMode
::
ZeroToOne
:
op
::
ScaleMode
::
UnsignedChar
));
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Initializing the user custom classes
...
...
@@ -392,7 +394,8 @@ int openPoseTutorialWrapper2()
op
::
flagsToRenderMode
(
FLAGS_render_pose
),
poseModel
,
!
FLAGS_disable_blending
,
(
float
)
FLAGS_alpha_pose
,
(
float
)
FLAGS_alpha_heatmap
,
FLAGS_part_to_show
,
FLAGS_model_folder
,
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
};
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
,
enableGoogleLogging
};
// Face configuration (use op::WrapperStructFace{} to disable it)
const
op
::
WrapperStructFace
wrapperStructFace
{
FLAGS_face
,
faceNetInputSize
,
op
::
flagsToRenderMode
(
FLAGS_face_render
,
FLAGS_render_pose
),
(
float
)
FLAGS_face_alpha_pose
,
(
float
)
FLAGS_face_alpha_heatmap
,
(
float
)
FLAGS_face_render_threshold
};
...
...
@@ -448,9 +451,6 @@ int openPoseTutorialWrapper2()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialWrapper2"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples/tutorial_wrapper/3_user_asynchronous.cpp
浏览文件 @
5de57b80
...
...
@@ -25,7 +25,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/headers.hpp>
...
...
@@ -324,6 +323,9 @@ int openPoseTutorialWrapper1()
op
::
check
(
FLAGS_heatmaps_scale
>=
0
&&
FLAGS_heatmaps_scale
<=
2
,
"Non valid `heatmaps_scale`."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
const
auto
heatMapScale
=
(
FLAGS_heatmaps_scale
==
0
?
op
::
ScaleMode
::
PlusMinusOne
:
(
FLAGS_heatmaps_scale
==
1
?
op
::
ScaleMode
::
ZeroToOne
:
op
::
ScaleMode
::
UnsignedChar
));
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Configure OpenPose
...
...
@@ -334,7 +336,8 @@ int openPoseTutorialWrapper1()
op
::
flagsToRenderMode
(
FLAGS_render_pose
),
poseModel
,
!
FLAGS_disable_blending
,
(
float
)
FLAGS_alpha_pose
,
(
float
)
FLAGS_alpha_heatmap
,
FLAGS_part_to_show
,
FLAGS_model_folder
,
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
};
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
,
enableGoogleLogging
};
// Face configuration (use op::WrapperStructFace{} to disable it)
const
op
::
WrapperStructFace
wrapperStructFace
{
FLAGS_face
,
faceNetInputSize
,
op
::
flagsToRenderMode
(
FLAGS_face_render
,
FLAGS_render_pose
),
(
float
)
FLAGS_face_alpha_pose
,
(
float
)
FLAGS_face_alpha_heatmap
,
(
float
)
FLAGS_face_render_threshold
};
...
...
@@ -396,9 +399,6 @@ int openPoseTutorialWrapper1()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openPoseTutorialWrapper1"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
examples_beta/openpose3d/openpose3d.cpp
浏览文件 @
5de57b80
...
...
@@ -25,7 +25,6 @@
#ifndef GFLAGS_GFLAGS_H_
namespace
gflags
=
google
;
#endif
#include <glog/logging.h> // google::InitGoogleLogging
// OpenPose dependencies
#include <openpose/headers.hpp>
...
...
@@ -177,6 +176,9 @@ int openpose3d()
op
::
check
(
FLAGS_heatmaps_scale
>=
0
&&
FLAGS_heatmaps_scale
<=
2
,
"Non valid `heatmaps_scale`."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
const
auto
heatMapScale
=
(
FLAGS_heatmaps_scale
==
0
?
op
::
ScaleMode
::
PlusMinusOne
:
(
FLAGS_heatmaps_scale
==
1
?
op
::
ScaleMode
::
ZeroToOne
:
op
::
ScaleMode
::
UnsignedChar
));
// Enabling Google Logging
const
bool
enableGoogleLogging
=
true
;
// Logging
op
::
log
(
""
,
op
::
Priority
::
Low
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Initializing the user custom classes
...
...
@@ -203,7 +205,8 @@ int openpose3d()
op
::
flagsToRenderMode
(
FLAGS_render_pose
),
poseModel
,
!
FLAGS_disable_blending
,
(
float
)
FLAGS_alpha_pose
,
(
float
)
FLAGS_alpha_heatmap
,
FLAGS_part_to_show
,
FLAGS_model_folder
,
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
};
heatMapTypes
,
heatMapScale
,
(
float
)
FLAGS_render_threshold
,
enableGoogleLogging
};
// Face configuration (use op::WrapperStructFace{} to disable it)
const
op
::
WrapperStructFace
wrapperStructFace
{
FLAGS_face
,
faceNetInputSize
,
op
::
flagsToRenderMode
(
FLAGS_face_render
,
FLAGS_render_pose
),
(
float
)
FLAGS_face_alpha_pose
,
(
float
)
FLAGS_face_alpha_heatmap
,
(
float
)
FLAGS_face_render_threshold
};
...
...
@@ -239,9 +242,6 @@ int openpose3d()
int
main
(
int
argc
,
char
*
argv
[])
{
// Initializing google logging (Caffe uses it for logging)
google
::
InitGoogleLogging
(
"openpose3d"
);
// Parsing command line flags
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
...
...
include/openpose/core/netCaffe.hpp
浏览文件 @
5de57b80
...
...
@@ -11,6 +11,7 @@ namespace op
public:
NetCaffe
(
const
std
::
array
<
int
,
4
>&
netInputSize4D
,
const
std
::
string
&
caffeProto
,
const
std
::
string
&
caffeTrainedModel
,
const
int
gpuId
=
0
,
const
bool
enableGoogleLogging
=
true
,
const
std
::
string
&
lastBlobName
=
"net_output"
);
virtual
~
NetCaffe
();
...
...
include/openpose/face/faceExtractorCaffe.hpp
浏览文件 @
5de57b80
...
...
@@ -19,10 +19,11 @@ namespace op
* @param netInputSize Size at which the cropped image (where the face is located) is resized.
* @param netOutputSize Size of the final results. At the moment, it must be equal than netOutputSize.
*/
explicit
FaceExtractorCaffe
(
const
Point
<
int
>&
netInputSize
,
const
Point
<
int
>&
netOutputSize
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
=
{},
const
ScaleMode
heatMapScale
=
ScaleMode
::
ZeroToOne
);
FaceExtractorCaffe
(
const
Point
<
int
>&
netInputSize
,
const
Point
<
int
>&
netOutputSize
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
=
{},
const
ScaleMode
heatMapScale
=
ScaleMode
::
ZeroToOne
,
const
bool
enableGoogleLogging
=
true
);
virtual
~
FaceExtractorCaffe
();
...
...
include/openpose/hand/handExtractorCaffe.hpp
浏览文件 @
5de57b80
...
...
@@ -24,11 +24,12 @@ namespace op
* accurate.
* @param rangeScales The range between the smaller and bigger scale.
*/
explicit
HandExtractorCaffe
(
const
Point
<
int
>&
netInputSize
,
const
Point
<
int
>&
netOutputSize
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
unsigned
short
numberScales
=
1
,
const
float
rangeScales
=
0.4
f
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
=
{},
const
ScaleMode
heatMapScale
=
ScaleMode
::
ZeroToOne
);
HandExtractorCaffe
(
const
Point
<
int
>&
netInputSize
,
const
Point
<
int
>&
netOutputSize
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
unsigned
short
numberScales
=
1
,
const
float
rangeScales
=
0.4
f
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
=
{},
const
ScaleMode
heatMapScale
=
ScaleMode
::
ZeroToOne
,
const
bool
enableGoogleLogging
=
true
);
/**
* Virtual destructor of the HandExtractor class.
...
...
include/openpose/pose/poseExtractorCaffe.hpp
浏览文件 @
5de57b80
...
...
@@ -14,7 +14,8 @@ namespace op
const
Point
<
int
>&
outputSize
,
const
int
scaleNumber
,
const
PoseModel
poseModel
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
=
{},
const
ScaleMode
heatMapScale
=
ScaleMode
::
ZeroToOne
);
const
ScaleMode
heatMapScale
=
ScaleMode
::
ZeroToOne
,
const
bool
enableGoogleLogging
=
true
);
virtual
~
PoseExtractorCaffe
();
...
...
include/openpose/wrapper/wrapper.hpp
浏览文件 @
5de57b80
...
...
@@ -641,7 +641,8 @@ namespace op
poseExtractors
.
emplace_back
(
std
::
make_shared
<
PoseExtractorCaffe
>
(
poseNetInputSize
,
poseNetOutputSize
,
finalOutputSize
,
wrapperStructPose
.
scalesNumber
,
wrapperStructPose
.
poseModel
,
modelFolder
,
gpuId
+
gpuNumberStart
,
wrapperStructPose
.
heatMapTypes
,
wrapperStructPose
.
heatMapScale
wrapperStructPose
.
heatMapTypes
,
wrapperStructPose
.
heatMapScale
,
wrapperStructPose
.
enableGoogleLogging
));
// Pose renderers
...
...
@@ -714,7 +715,8 @@ namespace op
const
auto
netOutputSize
=
wrapperStructFace
.
netInputSize
;
const
auto
faceExtractor
=
std
::
make_shared
<
FaceExtractorCaffe
>
(
wrapperStructFace
.
netInputSize
,
netOutputSize
,
modelFolder
,
gpu
+
gpuNumberStart
,
wrapperStructPose
.
heatMapTypes
,
wrapperStructPose
.
heatMapScale
gpu
+
gpuNumberStart
,
wrapperStructPose
.
heatMapTypes
,
wrapperStructPose
.
heatMapScale
,
wrapperStructPose
.
enableGoogleLogging
);
spWPoses
.
at
(
gpu
).
emplace_back
(
std
::
make_shared
<
WFaceExtractor
<
TDatumsPtr
>>
(
faceExtractor
));
}
...
...
@@ -740,7 +742,8 @@ namespace op
const
auto
handExtractor
=
std
::
make_shared
<
HandExtractorCaffe
>
(
wrapperStructHand
.
netInputSize
,
netOutputSize
,
modelFolder
,
gpu
+
gpuNumberStart
,
wrapperStructHand
.
scalesNumber
,
wrapperStructHand
.
scaleRange
,
wrapperStructPose
.
heatMapTypes
,
wrapperStructPose
.
heatMapScale
wrapperStructPose
.
heatMapTypes
,
wrapperStructPose
.
heatMapScale
,
wrapperStructPose
.
enableGoogleLogging
);
spWPoses
.
at
(
gpu
).
emplace_back
(
std
::
make_shared
<
WHandExtractor
<
TDatumsPtr
>>
(
handExtractor
));
// If tracking
...
...
include/openpose/wrapper/wrapperStructPose.hpp
浏览文件 @
5de57b80
...
...
@@ -141,6 +141,15 @@ namespace op
*/
float
renderThreshold
;
/**
* Whether to internally enable Google Logging.
* This option is only applicable if Caffe is used.
* Only disable it if the user is already calling google::InitGoogleLogging() in his code.
* If the user disables Google Logging and he does not call it by himself, then Caffe will start to pop up
* all the verbose messages.
*/
bool
enableGoogleLogging
;
/**
* Constructor of the struct.
* It has the recommended and default values we recommend for each element of the struct.
...
...
@@ -157,7 +166,8 @@ namespace op
const
int
defaultPartToRender
=
0
,
const
std
::
string
&
modelFolder
=
"models/"
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
=
{},
const
ScaleMode
heatMapScale
=
ScaleMode
::
ZeroToOne
,
const
float
renderThreshold
=
0.05
f
);
const
float
renderThreshold
=
0.05
f
,
const
bool
enableGoogleLogging
=
true
);
};
}
...
...
src/openpose/core/netCaffe.cpp
浏览文件 @
5de57b80
#include <numeric> // std::accumulate
#ifdef USE_CAFFE
#include <atomic>
#include <mutex>
#include <caffe/net.hpp>
#include <glog/logging.h> // google::InitGoogleLogging
#endif
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/fileSystem.hpp>
...
...
@@ -8,6 +11,9 @@
namespace
op
{
std
::
mutex
sMutex
;
std
::
atomic
<
bool
>
sGoogleLoggingInitialized
{
false
};
struct
NetCaffe
::
ImplNetCaffe
{
#ifdef USE_CAFFE
...
...
@@ -23,7 +29,8 @@ namespace op
boost
::
shared_ptr
<
caffe
::
Blob
<
float
>>
spOutputBlob
;
ImplNetCaffe
(
const
std
::
array
<
int
,
4
>&
netInputSize4D
,
const
std
::
string
&
caffeProto
,
const
std
::
string
&
caffeTrainedModel
,
const
int
gpuId
,
const
std
::
string
&
lastBlobName
)
:
const
std
::
string
&
caffeTrainedModel
,
const
int
gpuId
,
const
bool
enableGoogleLogging
,
const
std
::
string
&
lastBlobName
)
:
mGpuId
{
gpuId
},
// mNetInputSize4D{netInputSize4D}, // This line crashes on some devices with old G++
mNetInputSize4D
{
netInputSize4D
[
0
],
netInputSize4D
[
1
],
netInputSize4D
[
2
],
netInputSize4D
[
3
]},
...
...
@@ -41,14 +48,26 @@ namespace op
if
(
!
existFile
(
mCaffeTrainedModel
))
error
(
"Caffe trained model file not found: "
+
mCaffeTrainedModel
+
message
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Double if condition in order to speed up the program if it is called several times
if
(
enableGoogleLogging
&&
!
sGoogleLoggingInitialized
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
{
sMutex
};
if
(
enableGoogleLogging
&&
!
sGoogleLoggingInitialized
)
{
google
::
InitGoogleLogging
(
"OpenPose"
);
sGoogleLoggingInitialized
=
true
;
}
}
}
#endif
};
NetCaffe
::
NetCaffe
(
const
std
::
array
<
int
,
4
>&
netInputSize4D
,
const
std
::
string
&
caffeProto
,
const
std
::
string
&
caffeTrainedModel
,
const
int
gpuId
,
const
std
::
string
&
lastBlobName
)
const
std
::
string
&
caffeTrainedModel
,
const
int
gpuId
,
const
bool
enableGoogleLogging
,
const
std
::
string
&
lastBlobName
)
#ifdef USE_CAFFE
:
upImpl
{
new
ImplNetCaffe
{
netInputSize4D
,
caffeProto
,
caffeTrainedModel
,
gpuId
,
lastBlobName
}}
:
upImpl
{
new
ImplNetCaffe
{
netInputSize4D
,
caffeProto
,
caffeTrainedModel
,
gpuId
,
enableGoogleLogging
,
lastBlobName
}}
#endif
{
try
...
...
src/openpose/face/faceExtractorCaffe.cpp
浏览文件 @
5de57b80
...
...
@@ -25,10 +25,11 @@ namespace op
std
::
shared_ptr
<
caffe
::
Blob
<
float
>>
spPeaksBlob
;
ImplFaceExtractorCaffe
(
const
Point
<
int
>&
netOutputSize
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
)
:
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
bool
enableGoogleLogging
)
:
spNetCaffe
{
std
::
make_shared
<
NetCaffe
>
(
std
::
array
<
int
,
4
>
{
1
,
3
,
netOutputSize
.
y
,
netOutputSize
.
x
},
modelFolder
+
FACE_PROTOTXT
,
modelFolder
+
FACE_TRAINED_MODEL
,
gpuId
)},
gpuId
,
enableGoogleLogging
)},
spResizeAndMergeCaffe
{
std
::
make_shared
<
ResizeAndMergeCaffe
<
float
>>
()},
spMaximumCaffe
{
std
::
make_shared
<
MaximumCaffe
<
float
>>
()}
{
...
...
@@ -73,10 +74,10 @@ namespace op
FaceExtractorCaffe
::
FaceExtractorCaffe
(
const
Point
<
int
>&
netInputSize
,
const
Point
<
int
>&
netOutputSize
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
,
const
ScaleMode
heatMapScale
)
:
const
ScaleMode
heatMapScale
,
const
bool
enableGoogleLogging
)
:
FaceExtractor
{
netInputSize
,
netOutputSize
,
heatMapTypes
,
heatMapScale
}
#if defined USE_CAFFE && defined USE_CUDA
,
upImpl
{
new
ImplFaceExtractorCaffe
{
mNetOutputSize
,
modelFolder
,
gpuId
}}
,
upImpl
{
new
ImplFaceExtractorCaffe
{
mNetOutputSize
,
modelFolder
,
gpuId
,
enableGoogleLogging
}}
#endif
{
try
...
...
src/openpose/hand/handExtractorCaffe.cpp
浏览文件 @
5de57b80
...
...
@@ -26,10 +26,11 @@ namespace op
std
::
shared_ptr
<
caffe
::
Blob
<
float
>>
spPeaksBlob
;
ImplHandExtractorCaffe
(
const
Point
<
int
>&
netOutputSize
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
)
:
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
bool
enableGoogleLogging
)
:
spNetCaffe
{
std
::
make_shared
<
NetCaffe
>
(
std
::
array
<
int
,
4
>
{
1
,
3
,
netOutputSize
.
y
,
netOutputSize
.
x
},
modelFolder
+
HAND_PROTOTXT
,
modelFolder
+
HAND_TRAINED_MODEL
,
gpuId
)},
gpuId
,
enableGoogleLogging
)},
spResizeAndMergeCaffe
{
std
::
make_shared
<
ResizeAndMergeCaffe
<
float
>>
()},
spMaximumCaffe
{
std
::
make_shared
<
MaximumCaffe
<
float
>>
()}
{
...
...
@@ -159,10 +160,11 @@ namespace op
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
unsigned
short
numberScales
,
const
float
rangeScales
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
,
const
ScaleMode
heatMapScale
)
:
const
ScaleMode
heatMapScale
,
const
bool
enableGoogleLogging
)
:
HandExtractor
{
netInputSize
,
netOutputSize
,
numberScales
,
rangeScales
,
heatMapTypes
,
heatMapScale
}
#if defined USE_CAFFE && defined USE_CUDA
,
upImpl
{
new
ImplHandExtractorCaffe
{
mNetOutputSize
,
modelFolder
,
gpuId
}}
,
upImpl
{
new
ImplHandExtractorCaffe
{
mNetOutputSize
,
modelFolder
,
gpuId
,
enableGoogleLogging
}}
#endif
{
try
...
...
src/openpose/pose/poseExtractorCaffe.cpp
浏览文件 @
5de57b80
...
...
@@ -30,12 +30,13 @@ namespace op
ImplPoseExtractorCaffe
(
const
Point
<
int
>&
netInputSize
,
const
Point
<
int
>&
netOutputSize
,
const
int
scaleNumber
,
const
PoseModel
poseModel
,
const
int
gpuId
,
const
std
::
string
&
modelFolder
)
:
const
std
::
string
&
modelFolder
,
const
bool
enableGoogleLogging
)
:
mResizeScale
{
netOutputSize
.
x
/
(
float
)
netInputSize
.
x
},
spNetCaffe
{
std
::
make_shared
<
NetCaffe
>
(
std
::
array
<
int
,
4
>
{
scaleNumber
,
3
,
(
int
)
netInputSize
.
y
,
(
int
)
netInputSize
.
x
},
modelFolder
+
POSE_PROTOTXT
[(
int
)
poseModel
],
modelFolder
+
POSE_TRAINED_MODEL
[(
int
)
poseModel
],
gpuId
)},
modelFolder
+
POSE_TRAINED_MODEL
[(
int
)
poseModel
],
gpuId
,
enableGoogleLogging
)},
spResizeAndMergeCaffe
{
std
::
make_shared
<
ResizeAndMergeCaffe
<
float
>>
()},
spNmsCaffe
{
std
::
make_shared
<
NmsCaffe
<
float
>>
()},
spBodyPartConnectorCaffe
{
std
::
make_shared
<
BodyPartConnectorCaffe
<
float
>>
()}
...
...
@@ -48,11 +49,11 @@ namespace op
const
Point
<
int
>&
outputSize
,
const
int
scaleNumber
,
const
PoseModel
poseModel
,
const
std
::
string
&
modelFolder
,
const
int
gpuId
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes
,
const
ScaleMode
heatMapScale
)
:
const
ScaleMode
heatMapScale
,
const
bool
enableGoogleLogging
)
:
PoseExtractor
{
netOutputSize
,
outputSize
,
poseModel
,
heatMapTypes
,
heatMapScale
}
#ifdef USE_CAFFE
,
upImpl
{
new
ImplPoseExtractorCaffe
{
netInputSize
,
netOutputSize
,
scaleNumber
,
poseModel
,
gpuId
,
modelFolder
}}
gpuId
,
modelFolder
,
enableGoogleLogging
}}
#endif
{
try
...
...
src/openpose/wrapper/wrapperStructPose.cpp
浏览文件 @
5de57b80
...
...
@@ -11,7 +11,8 @@ namespace op
const
float
alphaHeatMap_
,
const
int
defaultPartToRender_
,
const
std
::
string
&
modelFolder_
,
const
std
::
vector
<
HeatMapType
>&
heatMapTypes_
,
const
ScaleMode
heatMapScale_
,
const
float
renderThreshold_
)
:
const
ScaleMode
heatMapScale_
,
const
float
renderThreshold_
,
const
bool
enableGoogleLogging_
)
:
enable
{
enable_
},
netInputSize
{
netInputSize_
},
outputSize
{
outputSize_
},
...
...
@@ -29,7 +30,8 @@ namespace op
modelFolder
{
modelFolder_
},
heatMapTypes
{
heatMapTypes_
},
heatMapScale
{
heatMapScale_
},
renderThreshold
{
renderThreshold_
}
renderThreshold
{
renderThreshold_
},
enableGoogleLogging
{
enableGoogleLogging_
}
{
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录