Commit 49fe4f3e authored by Davis King's avatar Davis King

merged

parents d207348a 57534130
......@@ -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,7 +34,9 @@ namespace dlib
truncated(false),
occluded(false),
ignore(false),
angle(0)
angle(0),
pose(0),
detection_score(0)
{}
box (
......@@ -45,7 +47,9 @@ namespace dlib
truncated(false),
occluded(false),
ignore(false),
angle(0)
angle(0),
pose(0),
detection_score(0)
{}
rectangle rect;
......@@ -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