Commit b67bf2ff authored by Davis King's avatar Davis King

merged

parents d207348a 2967a94d
cmake_minimum_required(VERSION 2.8.4)
add_subdirectory(dlib)
......@@ -188,6 +188,13 @@ if (NOT TARGET dlib)
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.
if (WIN32 AND NOT CYGWIN) ###############################################################################
if (DLIB_NO_GUI_SUPPORT)
......@@ -196,9 +203,6 @@ if (NOT TARGET dlib)
set (dlib_needed_libraries ws2_32 winmm comctl32 gdi32 imm32)
endif()
elseif(APPLE) ############################################################################
find_library(pthreadlib pthread)
set (dlib_needed_libraries ${pthreadlib})
if (NOT DLIB_NO_GUI_SUPPORT)
find_package(X11 QUIET)
if (X11_FOUND)
......@@ -235,9 +239,6 @@ if (NOT TARGET dlib)
mark_as_advanced(pthreadlib xlib xlib_path x11_path)
else () ##################################################################################
find_library(pthreadlib pthread)
set (dlib_needed_libraries ${pthreadlib})
# link to the nsl library if it exists. this is something you need sometimes
find_library(nsllib nsl)
if (nsllib)
......@@ -575,7 +576,7 @@ if (NOT TARGET dlib)
ARCHIVE DESTINATION lib)
endif()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/ DESTINATION include/dlib
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include/dlib
FILES_MATCHING PATTERN "*.h"
REGEX "${CMAKE_CURRENT_BINARY_DIR}" EXCLUDE)
......
......@@ -80,6 +80,10 @@ namespace dlib
fout << " ignore='" << b.ignore << "'";
if (b.angle != 0)
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)
{
......@@ -192,6 +196,8 @@ namespace dlib
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("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.right() += temp_box.rect.left()-1;
......
......@@ -34,6 +34,8 @@ namespace dlib
truncated(false),
occluded(false),
ignore(false),
pose(0),
detection_score(0),
angle(0)
{}
......@@ -45,6 +47,8 @@ namespace dlib
truncated(false),
occluded(false),
ignore(false),
pose(0),
detection_score(0),
angle(0)
{}
......@@ -58,6 +62,8 @@ namespace dlib
bool truncated;
bool occluded;
bool ignore;
double pose;
double detection_score;
// 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
......
......@@ -260,6 +260,19 @@ namespace dlib
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:
long l;
long t;
......@@ -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_
......@@ -363,6 +363,16 @@ namespace dlib
ensures
- 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
}
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_
......@@ -7,6 +7,42 @@
<!-- ************************************************************************* -->
<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?">
There are instructions on the <a href="compile.html">How to Compile</a> page.
......
......@@ -507,9 +507,9 @@ subject to the following constraint:
0.5*trans(lambda)*lambda - trans(lambda)*A*alpha - trans(lambda)*d
subject to the following constraints:
sum(alpha) == C
min(alpha) >= 0
min(lambda) >= 0
max(lambda) <= max_lambda
min(alpha) &gt;= 0
min(lambda) &gt;= 0
max(lambda) &lt;= max_lambda
Where f is convex. This means that Q should be positive-semidefinite.
</pre>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment