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
0a8d94ad
Commit
0a8d94ad
authored
Mar 22, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added age and gender fields to image metadata.
parent
2dfbf778
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
image_dataset_metadata.cpp
dlib/data_io/image_dataset_metadata.cpp
+18
-0
image_dataset_metadata.h
dlib/data_io/image_dataset_metadata.h
+18
-2
No files found.
dlib/data_io/image_dataset_metadata.cpp
View file @
0a8d94ad
...
@@ -80,6 +80,12 @@ namespace dlib
...
@@ -80,6 +80,12 @@ namespace dlib
fout
<<
" ignore='"
<<
b
.
ignore
<<
"'"
;
fout
<<
" ignore='"
<<
b
.
ignore
<<
"'"
;
if
(
b
.
angle
!=
0
)
if
(
b
.
angle
!=
0
)
fout
<<
" angle='"
<<
b
.
angle
<<
"'"
;
fout
<<
" angle='"
<<
b
.
angle
<<
"'"
;
if
(
b
.
age
!=
0
)
fout
<<
" age='"
<<
b
.
age
<<
"'"
;
if
(
b
.
gender
==
FEMALE
)
fout
<<
" gender='female'"
;
else
if
(
b
.
gender
==
MALE
)
fout
<<
" gender='male'"
;
if
(
b
.
pose
!=
0
)
if
(
b
.
pose
!=
0
)
fout
<<
" pose='"
<<
b
.
pose
<<
"'"
;
fout
<<
" pose='"
<<
b
.
pose
<<
"'"
;
if
(
b
.
detection_score
!=
0
)
if
(
b
.
detection_score
!=
0
)
...
@@ -196,6 +202,18 @@ namespace dlib
...
@@ -196,6 +202,18 @@ namespace dlib
if
(
atts
.
is_in_list
(
"occluded"
))
temp_box
.
occluded
=
sa
=
atts
[
"occluded"
];
if
(
atts
.
is_in_list
(
"occluded"
))
temp_box
.
occluded
=
sa
=
atts
[
"occluded"
];
if
(
atts
.
is_in_list
(
"ignore"
))
temp_box
.
ignore
=
sa
=
atts
[
"ignore"
];
if
(
atts
.
is_in_list
(
"ignore"
))
temp_box
.
ignore
=
sa
=
atts
[
"ignore"
];
if
(
atts
.
is_in_list
(
"angle"
))
temp_box
.
angle
=
sa
=
atts
[
"angle"
];
if
(
atts
.
is_in_list
(
"angle"
))
temp_box
.
angle
=
sa
=
atts
[
"angle"
];
if
(
atts
.
is_in_list
(
"age"
))
temp_box
.
age
=
sa
=
atts
[
"age"
];
if
(
atts
.
is_in_list
(
"gender"
))
{
if
(
atts
[
"gender"
]
==
"male"
)
temp_box
.
gender
=
MALE
;
else
if
(
atts
[
"gender"
]
==
"female"
)
temp_box
.
gender
=
FEMALE
;
else
if
(
atts
[
"gender"
]
==
"unknown"
)
temp_box
.
gender
=
UNKNOWN
;
else
throw
dlib
::
error
(
"Invalid gender string in box attribute."
);
}
if
(
atts
.
is_in_list
(
"pose"
))
temp_box
.
pose
=
sa
=
atts
[
"pose"
];
if
(
atts
.
is_in_list
(
"pose"
))
temp_box
.
pose
=
sa
=
atts
[
"pose"
];
if
(
atts
.
is_in_list
(
"detection_score"
))
temp_box
.
detection_score
=
sa
=
atts
[
"detection_score"
];
if
(
atts
.
is_in_list
(
"detection_score"
))
temp_box
.
detection_score
=
sa
=
atts
[
"detection_score"
];
...
...
dlib/data_io/image_dataset_metadata.h
View file @
0a8d94ad
...
@@ -14,6 +14,15 @@ namespace dlib
...
@@ -14,6 +14,15 @@ namespace dlib
namespace
image_dataset_metadata
namespace
image_dataset_metadata
{
{
// ------------------------------------------------------------------------------------
enum
gender_t
{
UNKNOWN
,
MALE
,
FEMALE
};
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
struct
box
struct
box
...
@@ -36,7 +45,9 @@ namespace dlib
...
@@ -36,7 +45,9 @@ namespace dlib
ignore
(
false
),
ignore
(
false
),
pose
(
0
),
pose
(
0
),
detection_score
(
0
),
detection_score
(
0
),
angle
(
0
)
angle
(
0
),
gender
(
UNKNOWN
),
age
(
0
)
{}
{}
box
(
box
(
...
@@ -49,7 +60,9 @@ namespace dlib
...
@@ -49,7 +60,9 @@ namespace dlib
ignore
(
false
),
ignore
(
false
),
pose
(
0
),
pose
(
0
),
detection_score
(
0
),
detection_score
(
0
),
angle
(
0
)
angle
(
0
),
gender
(
UNKNOWN
),
age
(
0
)
{}
{}
rectangle
rect
;
rectangle
rect
;
...
@@ -72,6 +85,9 @@ namespace dlib
...
@@ -72,6 +85,9 @@ namespace dlib
// image counter-clockwise by angle radians.
// image counter-clockwise by angle radians.
double
angle
;
double
angle
;
gender_t
gender
;
double
age
;
bool
has_label
()
const
{
return
label
.
size
()
!=
0
;
}
bool
has_label
()
const
{
return
label
.
size
()
!=
0
;
}
/*!
/*!
ensures
ensures
...
...
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