diff --git a/dlib/data_io/image_dataset_metadata.cpp b/dlib/data_io/image_dataset_metadata.cpp index a7d6f3235..65bef818f 100644 --- a/dlib/data_io/image_dataset_metadata.cpp +++ b/dlib/data_io/image_dataset_metadata.cpp @@ -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; diff --git a/dlib/data_io/image_dataset_metadata.h b/dlib/data_io/image_dataset_metadata.h index b052ed1cc..08c298423 100644 --- a/dlib/data_io/image_dataset_metadata.h +++ b/dlib/data_io/image_dataset_metadata.h @@ -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 diff --git a/dlib/geometry/rectangle.h b/dlib/geometry/rectangle.h index c4c71106b..7e7bb781b 100644 --- a/dlib/geometry/rectangle.h +++ b/dlib/geometry/rectangle.h @@ -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 so that you can use rectangles in the associative containers. - !*/ - template<> - struct less : public binary_function - { - 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_ diff --git a/dlib/geometry/rectangle_abstract.h b/dlib/geometry/rectangle_abstract.h index 08e860494..1c1e89089 100644 --- a/dlib/geometry/rectangle_abstract.h +++ b/dlib/geometry/rectangle_abstract.h @@ -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 so that you can use rectangles in the associative containers. - !*/ - template<> - struct less : public binary_function - { - 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_ diff --git a/docs/docs/faq.xml b/docs/docs/faq.xml index a963819a0..bfeeabb68 100644 --- a/docs/docs/faq.xml +++ b/docs/docs/faq.xml @@ -7,6 +7,42 @@ + + 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. + +

+ If you think you found some kind of bug or problem in dlib then feel + free to post on sourceforge + or github. + But include the version of dlib you are using, what you + are trying, what happened, what you expected to have happened instead, etc. +

+ +

+ 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 post your question on sourceforge. + 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. +

+ +

+ 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 + reading one of the excellent books on the topic + than by an infinite sequence of questions posted in the dlib forums. +

+ +
There are instructions on the How to Compile page. diff --git a/docs/docs/optimization.xml b/docs/docs/optimization.xml index b0559b358..cd71818fd 100644 --- a/docs/docs/optimization.xml +++ b/docs/docs/optimization.xml @@ -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) >= 0 + min(lambda) >= 0 + max(lambda) <= max_lambda Where f is convex. This means that Q should be positive-semidefinite.