MCPcopy Create free account
hub / github.com/davisking/dlib / deserialize

Function deserialize

dlib/image_processing/scan_image_pyramid.h:256–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254
255 template <typename T, typename U>
256 void deserialize (
257 scan_image_pyramid<T,U>& item,
258 std::istream& in
259 )
260 {
261 int version = 0;
262 deserialize(version, in);
263 if (version != 3)
264 throw serialization_error("Unsupported version found when deserializing a scan_image_pyramid object.");
265
266 deserialize(item.feats_config, in);
267 deserialize(item.feats, in);
268 deserialize(item.det_templates, in);
269 deserialize(item.max_dets_per_template, in);
270 deserialize(item.max_pyramid_levels, in);
271 deserialize(item.min_pyramid_layer_width, in);
272 deserialize(item.min_pyramid_layer_height, in);
273
274 // When developing some feature extractor, it's easy to accidentally change its
275 // number of dimensions and then try to deserialize data from an older version of
276 // your extractor into the current code. This check is here to catch that kind of
277 // user error.
278 long dims;
279 deserialize(dims, in);
280 if (item.get_num_dimensions() != dims)
281 throw serialization_error("Number of dimensions in serialized scan_image_pyramid doesn't match the expected number.");
282 }
283
284// ----------------------------------------------------------------------------------------
285// ----------------------------------------------------------------------------------------

Callers 1

deserializeMethod · 0.70

Calls 2

serialization_errorClass · 0.85
get_num_dimensionsMethod · 0.45

Tested by

no test coverage detected