Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
ball_tracking
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Gomez-Gonzalez
ball_tracking
Commits
b1770e53
Commit
b1770e53
authored
7 years ago
by
Sebastian Gomez-Gonzalez
Browse files
Options
Downloads
Patches
Plain Diff
Getting average processing time for the CPU and GPU examples
parent
6ebfd8b7
Branches
sebas_dev
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/tracking/gpu_track.cpp
+24
-0
24 additions, 0 deletions
examples/tracking/gpu_track.cpp
examples/tracking/track.cpp
+24
-0
24 additions, 0 deletions
examples/tracking/track.cpp
include/ball_tracking/utils.hpp
+3
-0
3 additions, 0 deletions
include/ball_tracking/utils.hpp
with
51 additions
and
0 deletions
examples/tracking/gpu_track.cpp
+
24
−
0
View file @
b1770e53
...
...
@@ -9,12 +9,35 @@
#include
<boost/program_options.hpp>
#include
<json.hpp>
#include
<chrono>
#include
<cmath>
using
namespace
cv
;
using
namespace
std
;
using
namespace
ball_tracking
;
using
json
=
nlohmann
::
json
;
struct
TimeStats
{
double
mean
;
double
std
;
};
TimeStats
comp_stats
(
const
vector
<
double
>&
time
)
{
double
sum_1
=
0.0
,
sum_sq
=
0.0
;
for
(
double
t
:
time
)
{
sum_1
+=
t
;
sum_sq
+=
t
*
t
;
}
int
N
=
time
.
size
();
double
mu
=
sum_1
/
N
;
double
var
=
(
sum_sq
/
N
)
-
mu
*
mu
;
return
{
mu
,
sqrt
(
var
)};
}
ostream
&
operator
<<
(
ostream
&
a
,
const
TimeStats
&
st
)
{
a
<<
"{mean="
<<
st
.
mean
<<
", std="
<<
st
.
std
<<
"}"
;
return
a
;
}
int
main
(
int
argc
,
char
**
argv
)
{
try
{
namespace
po
=
boost
::
program_options
;
...
...
@@ -136,6 +159,7 @@ int main(int argc, char** argv) {
<<
" ms"
<<
endl
;
if
(
k
==
27
)
break
;
}
cout
<<
"llh: "
<<
comp_stats
(
llh_time
)
<<
" us, bin: "
<<
comp_stats
(
bin_time
)
<<
" us, blob: "
<<
comp_stats
(
blob_time
)
<<
" us"
<<
endl
;
return
0
;
}
catch
(
std
::
exception
&
ex
)
{
cerr
<<
"Exception: "
<<
ex
.
what
()
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
examples/tracking/track.cpp
+
24
−
0
View file @
b1770e53
...
...
@@ -7,12 +7,35 @@
#include
<boost/program_options.hpp>
#include
<json.hpp>
#include
<chrono>
#include
<cmath>
using
namespace
cv
;
using
namespace
std
;
using
namespace
ball_tracking
;
using
json
=
nlohmann
::
json
;
struct
TimeStats
{
double
mean
;
double
std
;
};
TimeStats
comp_stats
(
const
vector
<
double
>&
time
)
{
double
sum_1
=
0.0
,
sum_sq
=
0.0
;
for
(
double
t
:
time
)
{
sum_1
+=
t
;
sum_sq
+=
t
*
t
;
}
int
N
=
time
.
size
();
double
mu
=
sum_1
/
N
;
double
var
=
(
sum_sq
/
N
)
-
mu
*
mu
;
return
{
mu
,
sqrt
(
var
)};
}
ostream
&
operator
<<
(
ostream
&
a
,
const
TimeStats
&
st
)
{
a
<<
"{mean="
<<
st
.
mean
<<
", std="
<<
st
.
std
<<
"}"
;
return
a
;
}
int
main
(
int
argc
,
char
**
argv
)
{
try
{
namespace
po
=
boost
::
program_options
;
...
...
@@ -127,6 +150,7 @@ int main(int argc, char** argv) {
<<
" ms"
<<
endl
;
if
(
k
==
27
)
break
;
}
cout
<<
"llh: "
<<
comp_stats
(
llh_time
)
<<
" us, bin: "
<<
comp_stats
(
bin_time
)
<<
" us, blob: "
<<
comp_stats
(
blob_time
)
<<
" us"
<<
endl
;
return
0
;
}
catch
(
std
::
exception
&
ex
)
{
cerr
<<
"Exception: "
<<
ex
.
what
()
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
include/ball_tracking/utils.hpp
+
3
−
0
View file @
b1770e53
...
...
@@ -4,6 +4,8 @@
#include
<opencv2/opencv.hpp>
#include
<json.hpp>
#include
<string>
#include
<vector>
#include
<iostream>
namespace
ball_tracking
{
...
...
@@ -24,6 +26,7 @@ namespace ball_tracking {
* @returns a JSON object
*/
nlohmann
::
json
load_json
(
const
std
::
string
&
file_name
);
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment