diff --git a/dlib/svm/svm.h b/dlib/svm/svm.h index f3899fd01..d18641631 100644 --- a/dlib/svm/svm.h +++ b/dlib/svm/svm.h @@ -321,6 +321,26 @@ namespace dlib label_type label; }; + template < + typename detection_type_, + typename label_type_ + > + inline void serialize ( const labeled_detection& item, std::ostream& out) + { + serialize(item.det, out); + serialize(item.label, out); + } + + template < + typename detection_type_, + typename label_type_ + > + inline void deserialize (labeled_detection& item, std::istream& in) + { + deserialize(item.det, in); + deserialize(item.label, in); + } + // ---------------------------------------------------------------------------------------- template < diff --git a/dlib/svm/svm_abstract.h b/dlib/svm/svm_abstract.h index da03966ab..abd54c32f 100644 --- a/dlib/svm/svm_abstract.h +++ b/dlib/svm/svm_abstract.h @@ -185,8 +185,25 @@ namespace dlib label_type label; }; -// ---------------------------------------------------------------------------------------- + template < + typename detection_type_, + typename label_type_ + > + void serialize (const labeled_detection& item, std::ostream& out); + /*! + provides serialization support + !*/ + template < + typename detection_type_, + typename label_type_ + > + void deserialize (labeled_detection& item, std::istream& in); + /*! + provides deserialization support + !*/ + +// ---------------------------------------------------------------------------------------- template < typename detection_type,