Commit 618f1084 authored by Davis King's avatar Davis King

The input_rgb_image_sized is supposed to be convertible to input_rgb_image,

which it was in all ways except you couldn't deserialize directly like you
would expect.  This has now been fixed.
parent ba430be5
......@@ -125,11 +125,19 @@ namespace dlib
{
std::string version;
deserialize(version, in);
if (version != "input_rgb_image")
if (version != "input_rgb_image" && version != "input_rgb_image_sized")
throw serialization_error("Unexpected version found while deserializing dlib::input_rgb_image.");
deserialize(item.avg_red, in);
deserialize(item.avg_green, in);
deserialize(item.avg_blue, in);
// read and discard the sizes if this was really a sized input layer.
if (version == "input_rgb_image_sized")
{
size_t nr, nc;
deserialize(nr, in);
deserialize(nc, in);
}
}
friend std::ostream& operator<<(std::ostream& out, const input_rgb_image& item)
......
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