mirror of https://github.com/davisking/dlib.git
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.
This commit is contained in:
parent
ba430be591
commit
618f1084d2
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue