Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
shy_201992
openpose
提交
c42443f6
O
openpose
项目概览
shy_201992
/
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 搜索 >>
提交
c42443f6
编写于
10月 13, 2017
作者:
G
gineshidalgo99
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Profiler working again
上级
24d29e59
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
26 deletion
+33
-26
include/openpose/pose/poseParameters.hpp
include/openpose/pose/poseParameters.hpp
+19
-15
src/openpose/core/netCaffe.cpp
src/openpose/core/netCaffe.cpp
+2
-2
src/openpose/filestream/cocoJsonSaver.cpp
src/openpose/filestream/cocoJsonSaver.cpp
+6
-3
src/openpose/utilities/profiler.cpp
src/openpose/utilities/profiler.cpp
+6
-6
未找到文件。
include/openpose/pose/poseParameters.hpp
浏览文件 @
c42443f6
...
...
@@ -7,7 +7,7 @@
namespace
op
{
//
#define when needed in
CUDA code
//
All #define are for
CUDA code
// Constant Global Parameters
const
unsigned
int
POSE_MAX_PEOPLE
=
96u
;
...
...
@@ -206,31 +206,35 @@ namespace op
{
22
,
"LEar"
},
{
23
,
"Background"
}
};
const
unsigned
int
POSE_BODY_23_NUMBER_PARTS
=
2
2
u
;
// Equivalent to size of std::map POSE_BODY_23_BODY_PARTS - 1 (removing background)
const
unsigned
int
POSE_BODY_23_NUMBER_PARTS
=
2
3
u
;
// Equivalent to size of std::map POSE_BODY_23_BODY_PARTS - 1 (removing background)
const
std
::
vector
<
unsigned
int
>
POSE_BODY_23_MAP_IDX
{
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
64
,
65
,
66
,
67
,
68
,
69
,
70
,
71
};
#define POSE_BODY_23_PAIRS_RENDER_GPU { 0,1, 0,4, 1,2, 2,3, 4,5, 5,6, 0,7, 7,8, 7,13, 8,9, 9,10,10,11,1
0,12,13,14,14,15,15,16,15
,17, 0,18,18,19,18,21,19,20,21,22}
#define POSE_BODY_23_PAIRS_RENDER_GPU { 0,1, 0,4, 1,2, 2,3, 4,5, 5,6, 0,7, 7,8, 7,13, 8,9, 9,10,10,11,1
1,12,13,14,14,15,15,16,16
,17, 0,18,18,19,18,21,19,20,21,22}
const
std
::
vector
<
unsigned
int
>
POSE_BODY_23_PAIRS_RENDER
{
POSE_BODY_23_PAIRS_RENDER_GPU
};
const
std
::
vector
<
unsigned
int
>
POSE_BODY_23_PAIRS
{
0
,
1
,
0
,
4
,
1
,
2
,
2
,
3
,
4
,
5
,
5
,
6
,
0
,
7
,
7
,
8
,
7
,
13
,
8
,
9
,
9
,
10
,
10
,
11
,
10
,
12
,
13
,
14
,
14
,
15
,
15
,
16
,
15
,
17
,
0
,
18
,
18
,
19
,
18
,
21
,
19
,
20
,
21
,
22
,
1
,
20
,
4
,
22
};
#define POSE_BODY_23_COLORS_RENDER_GPU \
255.f, 0.f, 85.f, \
255.f, 0.f, 0.f, \
255.f, 85.f, 0.f, \
255.f, 170.f, 0.f, \
255.f, 55.f, 0.f, \
255.f, 110.f, 0.f, \
255.f, 165.f, 0.f, \
255.f, 215.f, 0.f, \
255.f, 235.f, 0.f, \
255.f, 255.f, 0.f, \
170.f, 255.f, 0.f, \
255.f, 0.f, 0.f, \
175.f, 255.f, 0.f, \
85.f, 255.f, 0.f, \
0.f, 255.f, 0.f, \
255.f, 0.f, 0.f, \
0.f, 255.f, 85.f, \
0.f, 255.f, 170.f, \
0.f, 255.f, 255.f, \
0.f, 170.f, 255.f, \
25.f, 25.f, 128.f, \
0.f, 85.f, 255.f, \
0.f, 0.f, 255.f, \
255.f, 0.f, 170.f, \
170.f, 0.f, 255.f, \
0.f, 170.f, 255.f, \
0.f, 212.5f, 255.f, \
0.f, 255.f, 255.f, \
255.f, 0.f, 0.f, \
255.f, 0.f, 255.f, \
85.f, 0.f, 255.f
238.f, 130.f, 238.f, \
138.f, 43.f, 226.f, \
75.f, 0.f, 130.f
const
std
::
vector
<
float
>
POSE_BODY_23_COLORS_RENDER
{
POSE_BODY_23_COLORS_RENDER_GPU
};
// Constant Array Parameters
...
...
@@ -269,7 +273,7 @@ namespace op
"pose/mpi/pose_iter_160000.caffemodel"
,
"pose/body_18/pose_iter_XXXXXX.caffemodel"
,
"pose/body_19/pose_iter_XXXXXX.caffemodel"
,
"pose/body_23/pose_iter_
42000
.caffemodel"
"pose/body_23/pose_iter_
XXXXXX
.caffemodel"
};
// POSE_BODY_PART_MAPPING crashes on Windows at dynamic initialization, to avoid this crash:
// POSE_BODY_PART_MAPPING has been moved to poseParameters.cpp and getPoseBodyPartMapping() wraps it
...
...
src/openpose/core/netCaffe.cpp
浏览文件 @
c42443f6
...
...
@@ -11,7 +11,7 @@
namespace
op
{
std
::
mutex
sMutex
;
std
::
mutex
sMutex
NetCaffe
;
std
::
atomic
<
bool
>
sGoogleLoggingInitialized
{
false
};
struct
NetCaffe
::
ImplNetCaffe
...
...
@@ -51,7 +51,7 @@ namespace op
// 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
};
std
::
lock_guard
<
std
::
mutex
>
lock
{
sMutex
NetCaffe
};
if
(
enableGoogleLogging
&&
!
sGoogleLoggingInitialized
)
{
google
::
InitGoogleLogging
(
"OpenPose"
);
...
...
src/openpose/filestream/cocoJsonSaver.cpp
浏览文件 @
c42443f6
...
...
@@ -64,11 +64,14 @@ namespace op
mJsonOfstream
.
arrayOpen
();
std
::
vector
<
int
>
indexesInCocoOrder
;
if
(
numberBodyParts
==
18
)
indexesInCocoOrder
=
std
::
vector
<
int
>
{
0
,
15
,
14
,
17
,
16
,
5
,
2
,
6
,
3
,
7
,
4
,
11
,
8
,
12
,
9
,
13
,
10
};
indexesInCocoOrder
=
std
::
vector
<
int
>
{
0
,
15
,
14
,
17
,
16
,
5
,
2
,
6
,
3
,
7
,
4
,
11
,
8
,
12
,
9
,
13
,
10
};
else
if
(
numberBodyParts
==
19
)
indexesInCocoOrder
=
std
::
vector
<
int
>
{
0
,
16
,
15
,
18
,
17
,
5
,
2
,
6
,
3
,
7
,
4
,
12
,
9
,
13
,
10
,
14
,
11
};
indexesInCocoOrder
=
std
::
vector
<
int
>
{
0
,
16
,
15
,
18
,
17
,
5
,
2
,
6
,
3
,
7
,
4
,
12
,
9
,
13
,
10
,
14
,
11
};
else
if
(
numberBodyParts
==
23
)
indexesInCocoOrder
=
std
::
vector
<
int
>
{
18
,
21
,
19
,
22
,
20
,
4
,
1
,
5
,
2
,
6
,
3
,
13
,
8
,
14
,
9
,
15
,
10
};
else
error
(
"Unvalid number of body parts ("
+
std
::
to_string
(
numberBodyParts
)
+
")."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
error
(
"Unvalid number of body parts ("
+
std
::
to_string
(
numberBodyParts
)
+
")."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
for
(
auto
bodyPart
=
0u
;
bodyPart
<
indexesInCocoOrder
.
size
()
;
bodyPart
++
)
{
const
auto
finalIndex
=
3
*
(
person
*
numberBodyParts
+
indexesInCocoOrder
.
at
(
bodyPart
));
...
...
src/openpose/utilities/profiler.cpp
浏览文件 @
c42443f6
...
...
@@ -17,7 +17,7 @@ namespace op
std
::
map
<
std
::
string
,
std
::
tuple
<
double
,
unsigned
long
long
,
std
::
chrono
::
high_resolution_clock
::
time_point
>>
sProfilerTuple
{
std
::
map
<
std
::
string
,
std
::
tuple
<
double
,
unsigned
long
long
,
std
::
chrono
::
high_resolution_clock
::
time_point
>>
()
};
std
::
mutex
sMutex
{};
std
::
mutex
sMutex
Profiler
{};
std
::
string
getKey
(
const
int
line
,
const
std
::
string
&
function
,
const
std
::
string
&
file
)
{
...
...
@@ -37,7 +37,7 @@ namespace op
{
#ifdef PROFILER_ENABLED
const
auto
key
=
getKey
(
line
,
function
,
file
);
std
::
unique_lock
<
std
::
mutex
>
lock
{
sMutex
};
std
::
unique_lock
<
std
::
mutex
>
lock
{
sMutex
Profiler
};
if
(
sProfilerTuple
.
count
(
key
)
>
0
)
std
::
get
<
2
>
(
sProfilerTuple
[
key
])
=
std
::
chrono
::
high_resolution_clock
::
now
();
else
...
...
@@ -55,7 +55,7 @@ namespace op
void
Profiler
::
timerEnd
(
const
std
::
string
&
key
)
{
#ifdef PROFILER_ENABLED
const
std
::
lock_guard
<
std
::
mutex
>
lock
{
sMutex
};
const
std
::
lock_guard
<
std
::
mutex
>
lock
{
sMutex
Profiler
};
if
(
sProfilerTuple
.
count
(
key
)
>
0
)
{
auto
tuple
=
sProfilerTuple
[
key
];
...
...
@@ -77,7 +77,7 @@ namespace op
void
Profiler
::
printAveragedTimeMsOnIterationX
(
const
std
::
string
&
key
,
const
int
line
,
const
std
::
string
&
function
,
const
std
::
string
&
file
,
const
unsigned
long
long
x
)
{
#ifdef PROFILER_ENABLED
std
::
unique_lock
<
std
::
mutex
>
lock
{
sMutex
};
std
::
unique_lock
<
std
::
mutex
>
lock
{
sMutex
Profiler
};
if
(
sProfilerTuple
.
count
(
key
)
>
0
)
{
const
auto
tuple
=
sProfilerTuple
[
key
];
...
...
@@ -101,7 +101,7 @@ namespace op
void
Profiler
::
printAveragedTimeMsEveryXIterations
(
const
std
::
string
&
key
,
const
int
line
,
const
std
::
string
&
function
,
const
std
::
string
&
file
,
const
unsigned
long
long
x
)
{
#ifdef PROFILER_ENABLED
std
::
unique_lock
<
std
::
mutex
>
lock
{
sMutex
};
std
::
unique_lock
<
std
::
mutex
>
lock
{
sMutex
Profiler
};
if
(
sProfilerTuple
.
count
(
key
)
>
0
)
{
const
auto
tuple
=
sProfilerTuple
[
key
];
...
...
@@ -111,7 +111,7 @@ namespace op
printAveragedTimeMsCommon
(
std
::
get
<
0
>
(
tuple
),
std
::
get
<
1
>
(
tuple
),
line
,
function
,
file
);
// Reset
const
std
::
lock_guard
<
std
::
mutex
>
lock
{
sMutex
};
const
std
::
lock_guard
<
std
::
mutex
>
lock
{
sMutex
Profiler
};
auto
&
tuple
=
sProfilerTuple
[
key
];
std
::
get
<
0
>
(
tuple
)
=
0.
;
std
::
get
<
1
>
(
tuple
)
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录