Commit 70076e51 authored by Davis King's avatar Davis King

Added more versioning information into the serialization methods for

these objects.
parent c2dd8912
......@@ -127,6 +127,9 @@ namespace dlib
std::ostream& out
)
{
int version = 1;
serialize(version, out);
T scanner;
scanner.copy_configuration(item.scanner);
serialize(scanner, out);
......@@ -142,6 +145,11 @@ namespace dlib
std::istream& in
)
{
int version = 0;
deserialize(version, in);
if (version != 1)
throw serialization_error("Unexpected version encountered while deserializing a dlib::object_detector object.");
deserialize(item.scanner, in);
deserialize(item.w, in);
deserialize(item.boxes_overlap, in);
......
......@@ -152,12 +152,19 @@ namespace dlib
friend void serialize(const detection_template& item, std::ostream& out)
{
int version = 1;
serialize(version, out);
serialize(item.object_box, out);
serialize(item.rects, out);
serialize(item.movable_rects, out);
}
friend void deserialize(detection_template& item, std::istream& in)
{
int version = 0;
deserialize(version, in);
if (version != 1)
throw serialization_error("Unexpected version found while deserializing a dlib::scan_image_pyramid::detection_template object.");
deserialize(item.object_box, in);
deserialize(item.rects, in);
deserialize(item.movable_rects, in);
......
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