Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
huiyeruzhou
openpose
提交
2a07aa59
O
openpose
项目概览
huiyeruzhou
/
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 搜索 >>
提交
2a07aa59
编写于
5月 07, 2017
作者:
G
gineshidalgo99
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Now working on OpenCV with Qt support
上级
8a963bda
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
89 addition
and
67 deletion
+89
-67
examples/openpose/rtpose.cpp
examples/openpose/rtpose.cpp
+20
-17
examples/tutorial_thread/1_openpose_read_and_display.cpp
examples/tutorial_thread/1_openpose_read_and_display.cpp
+12
-9
examples/tutorial_thread/2_user_processing_function.cpp
examples/tutorial_thread/2_user_processing_function.cpp
+12
-9
examples/tutorial_thread/3_user_input_processing_and_output.cpp
...es/tutorial_thread/3_user_input_processing_and_output.cpp
+12
-9
examples/tutorial_thread/4_user_input_processing_output_and_datum.cpp
...orial_thread/4_user_input_processing_output_and_datum.cpp
+12
-9
examples/tutorial_wrapper/2_user_synchronous.cpp
examples/tutorial_wrapper/2_user_synchronous.cpp
+17
-14
include/openpose/wrapper/wrapper.hpp
include/openpose/wrapper/wrapper.hpp
+4
-0
未找到文件。
examples/openpose/rtpose.cpp
浏览文件 @
2a07aa59
...
...
@@ -268,24 +268,27 @@ int opRealTimePoseDemo()
op
::
log
(
"Starting thread(s)"
,
op
::
Priority
::
Max
);
// Option a) Recommended - Also using the main thread (this thread) for processing (it saves 1 thread)
// Start, run & stop threads
//
opWrapper.exec(); // It blocks this thread until all threads have finished
opWrapper
.
exec
();
// It blocks this thread until all threads have finished
// Option b) Keeping this thread free in case you want to do something else meanwhile, e.g. profiling the GPU memory
// Start threads
opWrapper
.
start
();
// Profile used GPU memory
// 1: wait ~10sec so the memory has been totally loaded on GPU
// 2: profile the GPU memory
const
auto
sleepTimeMs
=
10
;
for
(
auto
i
=
0
;
i
<
10000
/
sleepTimeMs
&&
opWrapper
.
isRunning
()
;
i
++
)
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
sleepTimeMs
});
op
::
Profiler
::
profileGpuMemory
(
__LINE__
,
__FUNCTION__
,
__FILE__
);
// Keep program alive while running threads
while
(
opWrapper
.
isRunning
())
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
sleepTimeMs
});
// Stop and join threads
op
::
log
(
"Stopping thread(s)"
,
op
::
Priority
::
Max
);
opWrapper
.
stop
();
// // Option b) Keeping this thread free in case you want to do something else meanwhile, e.g. profiling the GPU memory
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// opWrapper.start();
// // Profile used GPU memory
// // 1: wait ~10sec so the memory has been totally loaded on GPU
// // 2: profile the GPU memory
// const auto sleepTimeMs = 10;
// for (auto i = 0 ; i < 10000/sleepTimeMs && opWrapper.isRunning() ; i++)
// std::this_thread::sleep_for(std::chrono::milliseconds{sleepTimeMs});
// op::Profiler::profileGpuMemory(__LINE__, __FUNCTION__, __FILE__);
// // Keep program alive while running threads
// while (opWrapper.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{sleepTimeMs});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// opWrapper.stop();
// Measuring total time
const
auto
totalTimeSec
=
(
double
)
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
timerBegin
).
count
()
*
1e-9
;
...
...
examples/tutorial_thread/1_openpose_read_and_display.cpp
浏览文件 @
2a07aa59
...
...
@@ -164,16 +164,19 @@ int openPoseTutorialThread1()
op
::
log
(
"Starting thread(s)"
,
op
::
Priority
::
Max
);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
//
threadManager.exec(); // It blocks this thread until all threads have finished
threadManager
.
exec
();
// It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager
.
start
();
// Keep program alive while running threads. Here the user could perform any other desired function
while
(
threadManager
.
isRunning
())
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
33
});
// Stop and join threads
op
::
log
(
"Stopping thread(s)"
,
op
::
Priority
::
Max
);
threadManager
.
stop
();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message
...
...
examples/tutorial_thread/2_user_processing_function.cpp
浏览文件 @
2a07aa59
...
...
@@ -206,16 +206,19 @@ int openPoseTutorialThread2()
op
::
log
(
"Starting thread(s)"
,
op
::
Priority
::
Max
);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
//
threadManager.exec(); // It blocks this thread until all threads have finished
threadManager
.
exec
();
// It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager
.
start
();
// Keep program alive while running threads. Here the user could perform any other desired function
while
(
threadManager
.
isRunning
())
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
33
});
// Stop and join threads
op
::
log
(
"Stopping thread(s)"
,
op
::
Priority
::
Max
);
threadManager
.
stop
();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message
...
...
examples/tutorial_thread/3_user_input_processing_and_output.cpp
浏览文件 @
2a07aa59
...
...
@@ -197,16 +197,19 @@ int openPoseTutorialThread3()
op
::
log
(
"Starting thread(s)"
,
op
::
Priority
::
Max
);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
//
threadManager.exec(); // It blocks this thread until all threads have finished
threadManager
.
exec
();
// It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager
.
start
();
// Keep program alive while running threads. Here the user could perform any other desired function
while
(
threadManager
.
isRunning
())
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
33
});
// Stop and join threads
op
::
log
(
"Stopping thread(s)"
,
op
::
Priority
::
Max
);
threadManager
.
stop
();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message
...
...
examples/tutorial_thread/4_user_input_processing_output_and_datum.cpp
浏览文件 @
2a07aa59
...
...
@@ -209,16 +209,19 @@ int openPoseTutorialThread4()
op
::
log
(
"Starting thread(s)"
,
op
::
Priority
::
Max
);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
//
threadManager.exec(); // It blocks this thread until all threads have finished
threadManager
.
exec
();
// It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager
.
start
();
// Keep program alive while running threads. Here the user could perform any other desired function
while
(
threadManager
.
isRunning
())
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
33
});
// Stop and join threads
op
::
log
(
"Stopping thread(s)"
,
op
::
Priority
::
Max
);
threadManager
.
stop
();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message
...
...
examples/tutorial_wrapper/2_user_synchronous.cpp
浏览文件 @
2a07aa59
...
...
@@ -365,22 +365,25 @@ int openPoseTutorialWrapper2()
// Two different ways of running the program on multithread enviroment
// // Option a) Recommended - Also using the main thread (this thread) for processing (it saves 1 thread)
// // Start, run & stop threads
//
opWrapper.exec(); // It blocks this thread until all threads have finished
opWrapper
.
exec
();
// It blocks this thread until all threads have finished
// Option b) Keeping this thread free in case you want to do something else meanwhile, e.g. profiling the GPU memory
// Start threads
opWrapper
.
start
();
// Profile used GPU memory
// 1: wait ~10sec so the memory has been totally loaded on GPU
// 2: profile the GPU memory
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
1000
});
op
::
log
(
"Random task here..."
,
op
::
Priority
::
Max
);
// Keep program alive while running threads
while
(
opWrapper
.
isRunning
())
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
33
});
// Stop and join threads
op
::
log
(
"Stopping thread(s)"
,
op
::
Priority
::
Max
);
opWrapper
.
stop
();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// opWrapper.start();
// // Profile used GPU memory
// // 1: wait ~10sec so the memory has been totally loaded on GPU
// // 2: profile the GPU memory
// std::this_thread::sleep_for(std::chrono::milliseconds{1000});
// op::log("Random task here...", op::Priority::Max);
// // Keep program alive while running threads
// while (opWrapper.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// opWrapper.stop();
// Measuring total time
const
auto
totalTimeSec
=
(
double
)
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
timerBegin
).
count
()
*
1e-9
;
...
...
include/openpose/wrapper/wrapper.hpp
浏览文件 @
2a07aa59
...
...
@@ -123,6 +123,10 @@ namespace op
* Function to start multi-threading.
* Similar to exec(), but start() does not block the thread that calls the function. It just opens new threads, so it
* lets the user perform other tasks meanwhile on the calling thread.
* VERY IMPORTANT NOTE: if the GUI is selected and OpenCV is compiled with Qt support, this option will not work. Qt
* needs the main thread to plot visual results, so the final GUI (which uses OpenCV) would return an exception
* similar to: `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`. Use exec()
* in that case.
*/
void
start
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录