Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
70076e51
Commit
70076e51
authored
Aug 26, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more versioning information into the serialization methods for
these objects.
parent
c2dd8912
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
object_detector.h
dlib/image_processing/object_detector.h
+8
-0
scan_image_pyramid.h
dlib/image_processing/scan_image_pyramid.h
+7
-0
No files found.
dlib/image_processing/object_detector.h
View file @
70076e51
...
...
@@ -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
);
...
...
dlib/image_processing/scan_image_pyramid.h
View file @
70076e51
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment