Commit 7f3550d9 authored by Davis King's avatar Davis King

Made labeled_detection serializable.

parent b294f4d4
...@@ -321,6 +321,26 @@ namespace dlib ...@@ -321,6 +321,26 @@ namespace dlib
label_type label; 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 < template <
......
...@@ -185,8 +185,25 @@ namespace dlib ...@@ -185,8 +185,25 @@ namespace dlib
label_type label; 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 < template <
typename detection_type, typename detection_type,
......
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