Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
5ed1c2f2
"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "9f48c6274f66f71dd0cabe6a48bde84c8f239abe"
Commit
5ed1c2f2
authored
Jun 10, 2018
by
Davis King
Browse files
Made it so you can construct dlib.image_windows from detectors.
parent
653d0483
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
tools/python/src/gui.cpp
tools/python/src/gui.cpp
+34
-0
No files found.
tools/python/src/gui.cpp
View file @
5ed1c2f2
...
@@ -107,6 +107,36 @@ std::shared_ptr<image_window> make_image_window_from_image_and_title(const numpy
...
@@ -107,6 +107,36 @@ std::shared_ptr<image_window> make_image_window_from_image_and_title(const numpy
return
win
;
return
win
;
}
}
std
::
shared_ptr
<
image_window
>
make_image_window_from_detector
(
const
simple_object_detector
&
detector
)
{
auto
win
=
std
::
make_shared
<
image_window
>
();
win
->
set_image
(
draw_fhog
(
detector
));
return
win
;
}
std
::
shared_ptr
<
image_window
>
make_image_window_from_detector_py
(
const
simple_object_detector_py
&
detector
)
{
auto
win
=
std
::
make_shared
<
image_window
>
();
win
->
set_image
(
draw_fhog
(
detector
.
detector
));
return
win
;
}
std
::
shared_ptr
<
image_window
>
make_image_window_from_detector_and_title
(
const
simple_object_detector
&
detector
,
const
string
&
title
)
{
auto
win
=
std
::
make_shared
<
image_window
>
();
win
->
set_image
(
draw_fhog
(
detector
));
win
->
set_title
(
title
);
return
win
;
}
std
::
shared_ptr
<
image_window
>
make_image_window_from_detector_py_and_title
(
const
simple_object_detector_py
&
detector
,
const
string
&
title
)
{
auto
win
=
std
::
make_shared
<
image_window
>
();
win
->
set_image
(
draw_fhog
(
detector
.
detector
));
win
->
set_title
(
title
);
return
win
;
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
void
bind_gui
(
py
::
module
&
m
)
void
bind_gui
(
py
::
module
&
m
)
...
@@ -122,6 +152,10 @@ void bind_gui(py::module& m)
...
@@ -122,6 +152,10 @@ void bind_gui(py::module& m)
py
::
class_
<
type
,
std
::
shared_ptr
<
type
>>
(
m
,
"image_window"
,
py
::
class_
<
type
,
std
::
shared_ptr
<
type
>>
(
m
,
"image_window"
,
"This is a GUI window capable of showing images on the screen."
)
"This is a GUI window capable of showing images on the screen."
)
.
def
(
py
::
init
())
.
def
(
py
::
init
())
.
def
(
py
::
init
(
&
make_image_window_from_detector
))
.
def
(
py
::
init
(
&
make_image_window_from_detector_py
))
.
def
(
py
::
init
(
&
make_image_window_from_detector_and_title
))
.
def
(
py
::
init
(
&
make_image_window_from_detector_py_and_title
))
.
def
(
py
::
init
(
&
make_image_window_from_image
<
uint8_t
>
))
.
def
(
py
::
init
(
&
make_image_window_from_image
<
uint8_t
>
))
.
def
(
py
::
init
(
&
make_image_window_from_image
<
uint16_t
>
))
.
def
(
py
::
init
(
&
make_image_window_from_image
<
uint16_t
>
))
.
def
(
py
::
init
(
&
make_image_window_from_image
<
uint32_t
>
))
.
def
(
py
::
init
(
&
make_image_window_from_image
<
uint32_t
>
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment