Made labeled_detection serializable.

This commit is contained in:
Davis King 2014-02-26 21:05:39 -05:00
parent b294f4d4c7
commit 7f3550d983
2 changed files with 38 additions and 1 deletions

View File

@ -321,6 +321,26 @@ namespace dlib
label_type label;
};
template <
typename detection_type_,
typename label_type_
>
inline void serialize ( const labeled_detection<detection_type_,label_type_>& item, std::ostream& out)
{
serialize(item.det, out);
serialize(item.label, out);
}
template <
typename detection_type_,
typename label_type_
>
inline void deserialize (labeled_detection<detection_type_,label_type_>& item, std::istream& in)
{
deserialize(item.det, in);
deserialize(item.label, in);
}
// ----------------------------------------------------------------------------------------
template <

View File

@ -185,8 +185,25 @@ namespace dlib
label_type label;
};
// ----------------------------------------------------------------------------------------
template <
typename detection_type_,
typename label_type_
>
void serialize (const labeled_detection<detection_type_,label_type_>& item, std::ostream& out);
/*!
provides serialization support
!*/
template <
typename detection_type_,
typename label_type_
>
void deserialize (labeled_detection<detection_type_,label_type_>& item, std::istream& in);
/*!
provides deserialization support
!*/
// ----------------------------------------------------------------------------------------
template <
typename detection_type,