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
b67bf2ff
Commit
b67bf2ff
authored
Feb 29, 2016
by
Davis King
Browse files
merged
parents
d207348a
2967a94d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
56 deletions
+84
-56
CMakeLists.txt
CMakeLists.txt
+2
-0
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+8
-7
dlib/data_io/image_dataset_metadata.cpp
dlib/data_io/image_dataset_metadata.cpp
+6
-0
dlib/data_io/image_dataset_metadata.h
dlib/data_io/image_dataset_metadata.h
+6
-0
dlib/geometry/rectangle.h
dlib/geometry/rectangle.h
+13
-23
dlib/geometry/rectangle_abstract.h
dlib/geometry/rectangle_abstract.h
+10
-23
docs/docs/faq.xml
docs/docs/faq.xml
+36
-0
docs/docs/optimization.xml
docs/docs/optimization.xml
+3
-3
No files found.
CMakeLists.txt
0 → 100644
View file @
b67bf2ff
cmake_minimum_required
(
VERSION 2.8.4
)
add_subdirectory
(
dlib
)
dlib/CMakeLists.txt
View file @
b67bf2ff
...
@@ -188,6 +188,13 @@ if (NOT TARGET dlib)
...
@@ -188,6 +188,13 @@ if (NOT TARGET dlib)
stack_trace.cpp
stack_trace.cpp
)
)
set
(
dlib_needed_libraries
)
if
(
UNIX
)
set
(
CMAKE_THREAD_PREFER_PTHREAD ON
)
find_package
(
Threads REQUIRED
)
set
(
dlib_needed_libraries
${
dlib_needed_libraries
}
${
CMAKE_THREAD_LIBS_INIT
}
)
endif
()
# we want to link to the right stuff depending on our platform.
# we want to link to the right stuff depending on our platform.
if
(
WIN32 AND NOT CYGWIN
)
###############################################################################
if
(
WIN32 AND NOT CYGWIN
)
###############################################################################
if
(
DLIB_NO_GUI_SUPPORT
)
if
(
DLIB_NO_GUI_SUPPORT
)
...
@@ -196,9 +203,6 @@ if (NOT TARGET dlib)
...
@@ -196,9 +203,6 @@ if (NOT TARGET dlib)
set
(
dlib_needed_libraries ws2_32 winmm comctl32 gdi32 imm32
)
set
(
dlib_needed_libraries ws2_32 winmm comctl32 gdi32 imm32
)
endif
()
endif
()
elseif
(
APPLE
)
############################################################################
elseif
(
APPLE
)
############################################################################
find_library
(
pthreadlib pthread
)
set
(
dlib_needed_libraries
${
pthreadlib
}
)
if
(
NOT DLIB_NO_GUI_SUPPORT
)
if
(
NOT DLIB_NO_GUI_SUPPORT
)
find_package
(
X11 QUIET
)
find_package
(
X11 QUIET
)
if
(
X11_FOUND
)
if
(
X11_FOUND
)
...
@@ -235,9 +239,6 @@ if (NOT TARGET dlib)
...
@@ -235,9 +239,6 @@ if (NOT TARGET dlib)
mark_as_advanced
(
pthreadlib xlib xlib_path x11_path
)
mark_as_advanced
(
pthreadlib xlib xlib_path x11_path
)
else
()
##################################################################################
else
()
##################################################################################
find_library
(
pthreadlib pthread
)
set
(
dlib_needed_libraries
${
pthreadlib
}
)
# link to the nsl library if it exists. this is something you need sometimes
# link to the nsl library if it exists. this is something you need sometimes
find_library
(
nsllib nsl
)
find_library
(
nsllib nsl
)
if
(
nsllib
)
if
(
nsllib
)
...
@@ -575,7 +576,7 @@ if (NOT TARGET dlib)
...
@@ -575,7 +576,7 @@ if (NOT TARGET dlib)
ARCHIVE DESTINATION lib
)
ARCHIVE DESTINATION lib
)
endif
()
endif
()
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/ DESTINATION include/dlib
install
(
DIRECTORY
${
CMAKE_
CURRENT_
SOURCE_DIR
}
/ DESTINATION include/dlib
FILES_MATCHING PATTERN
"*.h"
FILES_MATCHING PATTERN
"*.h"
REGEX
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
EXCLUDE
)
REGEX
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
EXCLUDE
)
...
...
dlib/data_io/image_dataset_metadata.cpp
View file @
b67bf2ff
...
@@ -80,6 +80,10 @@ namespace dlib
...
@@ -80,6 +80,10 @@ namespace dlib
fout
<<
" ignore='"
<<
b
.
ignore
<<
"'"
;
fout
<<
" ignore='"
<<
b
.
ignore
<<
"'"
;
if
(
b
.
angle
!=
0
)
if
(
b
.
angle
!=
0
)
fout
<<
" angle='"
<<
b
.
angle
<<
"'"
;
fout
<<
" angle='"
<<
b
.
angle
<<
"'"
;
if
(
b
.
pose
!=
0
)
fout
<<
" pose='"
<<
b
.
pose
<<
"'"
;
if
(
b
.
detection_score
!=
0
)
fout
<<
" detection_score='"
<<
b
.
detection_score
<<
"'"
;
if
(
b
.
has_label
()
||
b
.
parts
.
size
()
!=
0
)
if
(
b
.
has_label
()
||
b
.
parts
.
size
()
!=
0
)
{
{
...
@@ -192,6 +196,8 @@ namespace dlib
...
@@ -192,6 +196,8 @@ namespace dlib
if
(
atts
.
is_in_list
(
"occluded"
))
temp_box
.
occluded
=
sa
=
atts
[
"occluded"
];
if
(
atts
.
is_in_list
(
"occluded"
))
temp_box
.
occluded
=
sa
=
atts
[
"occluded"
];
if
(
atts
.
is_in_list
(
"ignore"
))
temp_box
.
ignore
=
sa
=
atts
[
"ignore"
];
if
(
atts
.
is_in_list
(
"ignore"
))
temp_box
.
ignore
=
sa
=
atts
[
"ignore"
];
if
(
atts
.
is_in_list
(
"angle"
))
temp_box
.
angle
=
sa
=
atts
[
"angle"
];
if
(
atts
.
is_in_list
(
"angle"
))
temp_box
.
angle
=
sa
=
atts
[
"angle"
];
if
(
atts
.
is_in_list
(
"pose"
))
temp_box
.
pose
=
sa
=
atts
[
"pose"
];
if
(
atts
.
is_in_list
(
"detection_score"
))
temp_box
.
detection_score
=
sa
=
atts
[
"detection_score"
];
temp_box
.
rect
.
bottom
()
+=
temp_box
.
rect
.
top
()
-
1
;
temp_box
.
rect
.
bottom
()
+=
temp_box
.
rect
.
top
()
-
1
;
temp_box
.
rect
.
right
()
+=
temp_box
.
rect
.
left
()
-
1
;
temp_box
.
rect
.
right
()
+=
temp_box
.
rect
.
left
()
-
1
;
...
...
dlib/data_io/image_dataset_metadata.h
View file @
b67bf2ff
...
@@ -34,6 +34,8 @@ namespace dlib
...
@@ -34,6 +34,8 @@ namespace dlib
truncated
(
false
),
truncated
(
false
),
occluded
(
false
),
occluded
(
false
),
ignore
(
false
),
ignore
(
false
),
pose
(
0
),
detection_score
(
0
),
angle
(
0
)
angle
(
0
)
{}
{}
...
@@ -45,6 +47,8 @@ namespace dlib
...
@@ -45,6 +47,8 @@ namespace dlib
truncated
(
false
),
truncated
(
false
),
occluded
(
false
),
occluded
(
false
),
ignore
(
false
),
ignore
(
false
),
pose
(
0
),
detection_score
(
0
),
angle
(
0
)
angle
(
0
)
{}
{}
...
@@ -58,6 +62,8 @@ namespace dlib
...
@@ -58,6 +62,8 @@ namespace dlib
bool
truncated
;
bool
truncated
;
bool
occluded
;
bool
occluded
;
bool
ignore
;
bool
ignore
;
double
pose
;
double
detection_score
;
// The angle of the object in radians. Positive values indicate that the
// The angle of the object in radians. Positive values indicate that the
// object at the center of the box is rotated clockwise by angle radians. A
// object at the center of the box is rotated clockwise by angle radians. A
...
...
dlib/geometry/rectangle.h
View file @
b67bf2ff
...
@@ -260,6 +260,19 @@ namespace dlib
...
@@ -260,6 +260,19 @@ namespace dlib
return
!
(
*
this
==
rect
);
return
!
(
*
this
==
rect
);
}
}
inline
bool
operator
<
(
const
dlib
::
rectangle
&
b
)
const
{
if
(
left
()
<
b
.
left
())
return
true
;
else
if
(
left
()
>
b
.
left
())
return
false
;
else
if
(
top
()
<
b
.
top
())
return
true
;
else
if
(
top
()
>
b
.
top
())
return
false
;
else
if
(
right
()
<
b
.
right
())
return
true
;
else
if
(
right
()
>
b
.
right
())
return
false
;
else
if
(
bottom
()
<
b
.
bottom
())
return
true
;
else
if
(
bottom
()
>
b
.
bottom
())
return
false
;
else
return
false
;
}
private:
private:
long
l
;
long
l
;
long
t
;
long
t
;
...
@@ -753,29 +766,6 @@ namespace dlib
...
@@ -753,29 +766,6 @@ namespace dlib
}
}
namespace
std
{
/*!
Define std::less<rectangle> so that you can use rectangles in the associative containers.
!*/
template
<
>
struct
less
<
dlib
::
rectangle
>
:
public
binary_function
<
dlib
::
rectangle
,
dlib
::
rectangle
,
bool
>
{
inline
bool
operator
()
(
const
dlib
::
rectangle
&
a
,
const
dlib
::
rectangle
&
b
)
const
{
if
(
a
.
left
()
<
b
.
left
())
return
true
;
else
if
(
a
.
left
()
>
b
.
left
())
return
false
;
else
if
(
a
.
top
()
<
b
.
top
())
return
true
;
else
if
(
a
.
top
()
>
b
.
top
())
return
false
;
else
if
(
a
.
right
()
<
b
.
right
())
return
true
;
else
if
(
a
.
right
()
>
b
.
right
())
return
false
;
else
if
(
a
.
bottom
()
<
b
.
bottom
())
return
true
;
else
if
(
a
.
bottom
()
>
b
.
bottom
())
return
false
;
else
return
false
;
}
};
}
#endif // DLIB_RECTANGLe_
#endif // DLIB_RECTANGLe_
dlib/geometry/rectangle_abstract.h
View file @
b67bf2ff
...
@@ -363,6 +363,16 @@ namespace dlib
...
@@ -363,6 +363,16 @@ namespace dlib
ensures
ensures
- returns !(*this == rect)
- returns !(*this == rect)
!*/
!*/
bool
operator
<
(
const
dlib
::
rectangle
&
a
,
const
dlib
::
rectangle
&
b
)
const
;
/*!
ensures
- Defines a total ordering over rectangles so they can be used in
associative containers.
!*/
};
};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -789,28 +799,5 @@ namespace dlib
...
@@ -789,28 +799,5 @@ namespace dlib
}
}
namespace
std
{
/*!
Define std::less<rectangle> so that you can use rectangles in the associative containers.
!*/
template
<
>
struct
less
<
dlib
::
rectangle
>
:
public
binary_function
<
dlib
::
rectangle
,
dlib
::
rectangle
,
bool
>
{
inline
bool
operator
()
(
const
dlib
::
rectangle
&
a
,
const
dlib
::
rectangle
&
b
)
const
{
if
(
a
.
left
()
<
b
.
left
())
return
true
;
else
if
(
a
.
left
()
>
b
.
left
())
return
false
;
else
if
(
a
.
top
()
<
b
.
top
())
return
true
;
else
if
(
a
.
top
()
>
b
.
top
())
return
false
;
else
if
(
a
.
right
()
<
b
.
right
())
return
true
;
else
if
(
a
.
right
()
>
b
.
right
())
return
false
;
else
if
(
a
.
bottom
()
<
b
.
bottom
())
return
true
;
else
if
(
a
.
bottom
()
>
b
.
bottom
())
return
false
;
else
return
false
;
}
};
}
#endif // DLIB_RECTANGLe_ABSTRACT_
#endif // DLIB_RECTANGLe_ABSTRACT_
docs/docs/faq.xml
View file @
b67bf2ff
...
@@ -7,6 +7,42 @@
...
@@ -7,6 +7,42 @@
<!-- ************************************************************************* -->
<!-- ************************************************************************* -->
<questions
group=
"General"
>
<questions
group=
"General"
>
<question
text=
"It doesn't work?"
>
Do not post a question like "I'm using dlib, and it doesn't work?" or
"I'm using the object detector and it doesn't work, what do I do?".
If this is all you say then I have no idea what is wrong. 99% of the
time it's some kind of user error. 1% of the time it's some problem
in dlib. But again, without more information it's impossible to know.
So please don't post questions like this.
<p>
If you think you found some kind of bug or problem in dlib then feel
free to post on
<a
href=
"https://sourceforge.net/p/dclib/discussion"
>
sourceforge
</a>
or
<a
href=
"https://github.com/davisking/dlib/issues"
>
github
</a>
.
But include the version of dlib you are using, what you
are trying, what happened, what you expected to have happened instead, etc.
</p>
<p>
On the other hand, if you haven't found a bug or problem in dlib, but
instead are looking for machine learning/computer vision/programming
consulting then you can still
<a
href=
"https://sourceforge.net/p/dclib/discussion"
>
post your question on sourceforge
</a>
.
But be clear that this is what you are asking for. Maybe someone will
help you or you can find someone to pay money in exchange for a
solution to your problem.
</p>
<p>
However, don't try to get someone to write your code for you by
repeatedly asking a question like "ok, what do I type next to make a
program that does X?". I get this question all the time from people
who obviously don't know how to program. If you are not familiar
with C++ it's much better to learn it by
<a
href=
"http://dlib.net/books.html"
>
reading one of the excellent books on the topic
</a>
than by an infinite sequence of questions posted in the dlib forums.
</p>
</question>
<question
text=
"How can I use dlib in Visual Studio?"
>
<question
text=
"How can I use dlib in Visual Studio?"
>
There are instructions on the
<a
href=
"compile.html"
>
How to Compile
</a>
page.
There are instructions on the
<a
href=
"compile.html"
>
How to Compile
</a>
page.
...
...
docs/docs/optimization.xml
View file @
b67bf2ff
...
@@ -507,9 +507,9 @@ subject to the following constraint:
...
@@ -507,9 +507,9 @@ subject to the following constraint:
0.5*trans(lambda)*lambda - trans(lambda)*A*alpha - trans(lambda)*d
0.5*trans(lambda)*lambda - trans(lambda)*A*alpha - trans(lambda)*d
subject to the following constraints:
subject to the following constraints:
sum(alpha) == C
sum(alpha) == C
min(alpha)
>
= 0
min(alpha)
>
= 0
min(lambda)
>
= 0
min(lambda)
>
= 0
max(lambda)
<
= max_lambda
max(lambda)
<
= max_lambda
Where f is convex. This means that Q should be positive-semidefinite.
Where f is convex. This means that Q should be positive-semidefinite.
</pre>
</pre>
...
...
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