Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.face
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.face
Commits
497aa635
Commit
497aa635
authored
3 years ago
by
Tiago de Freitas Pereira
Browse files
Options
Downloads
Patches
Plain Diff
Appending the extra metadata to IJC-C
parent
90213c31
No related branches found
No related tags found
1 merge request
!124
Resolve "IJBC database will fail on non-Idiap filesystems"
Pipeline
#51942
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/face/database/ijbc.py
+57
-0
57 additions, 0 deletions
bob/bio/face/database/ijbc.py
with
57 additions
and
0 deletions
bob/bio/face/database/ijbc.py
+
57
−
0
View file @
497aa635
...
@@ -20,6 +20,29 @@ def _make_sample_from_template_row(row, image_directory):
...
@@ -20,6 +20,29 @@ def _make_sample_from_template_row(row, image_directory):
reference_id
=
str
(
row
[
"
TEMPLATE_ID
"
]),
reference_id
=
str
(
row
[
"
TEMPLATE_ID
"
]),
subject_id
=
str
(
row
[
"
SUBJECT_ID
"
]),
subject_id
=
str
(
row
[
"
SUBJECT_ID
"
]),
key
=
os
.
path
.
splitext
(
row
[
"
FILENAME
"
])[
0
]
+
"
-
"
+
hashstr
,
key
=
os
.
path
.
splitext
(
row
[
"
FILENAME
"
])[
0
]
+
"
-
"
+
hashstr
,
gender
=
row
[
"
GENDER
"
],
indoor_outdoor
=
row
[
"
INDOOR_OUTDOOR
"
],
skintone
=
row
[
"
SKINTONE
"
],
yaw
=
row
[
"
YAW
"
],
rool
=
row
[
"
ROLL
"
],
occ1
=
row
[
"
OCC1
"
],
occ2
=
row
[
"
OCC2
"
],
occ3
=
row
[
"
OCC3
"
],
occ4
=
row
[
"
OCC4
"
],
occ5
=
row
[
"
OCC5
"
],
occ6
=
row
[
"
OCC6
"
],
occ7
=
row
[
"
OCC7
"
],
occ8
=
row
[
"
OCC8
"
],
occ9
=
row
[
"
OCC9
"
],
occ10
=
row
[
"
OCC10
"
],
occ11
=
row
[
"
OCC11
"
],
occ12
=
row
[
"
OCC12
"
],
occ13
=
row
[
"
OCC13
"
],
occ14
=
row
[
"
OCC14
"
],
occ15
=
row
[
"
OCC15
"
],
occ16
=
row
[
"
OCC16
"
],
occ17
=
row
[
"
OCC17
"
],
occ18
=
row
[
"
OCC18
"
],
annotations
=
{
annotations
=
{
"
topleft
"
:
(
float
(
row
[
"
FACE_Y
"
]),
float
(
row
[
"
FACE_X
"
])),
"
topleft
"
:
(
float
(
row
[
"
FACE_Y
"
]),
float
(
row
[
"
FACE_X
"
])),
"
bottomright
"
:
(
"
bottomright
"
:
(
...
@@ -140,6 +163,40 @@ class IJBCDatabase(Database):
...
@@ -140,6 +163,40 @@ class IJBCDatabase(Database):
os
.
path
.
join
(
self
.
protocol_directory
,
"
ijbc_11_G1_G2_matches.csv
"
),
os
.
path
.
join
(
self
.
protocol_directory
,
"
ijbc_11_G1_G2_matches.csv
"
),
names
=
[
"
REFERENCE_TEMPLATE_ID
"
,
"
PROBE_TEMPLATE_ID
"
],
names
=
[
"
REFERENCE_TEMPLATE_ID
"
,
"
PROBE_TEMPLATE_ID
"
],
).
astype
(
"
str
"
)
).
astype
(
"
str
"
)
self
.
metadata
=
pd
.
read_csv
(
os
.
path
.
join
(
self
.
protocol_directory
,
"
ijbc_metadata.csv
"
),
usecols
=
[
"
SUBJECT_ID
"
,
"
FILENAME
"
,
"
SIGHTING_ID
"
,
"
FACIAL_HAIR
"
,
"
AGE
"
,
"
INDOOR_OUTDOOR
"
,
"
SKINTONE
"
,
"
GENDER
"
,
"
YAW
"
,
"
ROLL
"
,
]
+
[
f
"
OCC
{
i
}
"
for
i
in
range
(
1
,
19
)],
)
# LEFT JOIN WITH METADATA
self
.
probe_templates
=
pd
.
merge
(
self
.
probe_templates
,
self
.
metadata
,
on
=
[
"
SUBJECT_ID
"
,
"
FILENAME
"
,
"
SIGHTING_ID
"
],
how
=
"
left
"
,
)
# LEFT JOIN WITH METADATA
self
.
reference_templates
=
pd
.
merge
(
self
.
reference_templates
,
self
.
metadata
,
on
=
[
"
SUBJECT_ID
"
,
"
FILENAME
"
,
"
SIGHTING_ID
"
],
how
=
"
left
"
,
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
f
"
Protocol `
{
protocol
}
` not supported. We do accept merge requests :-)
"
f
"
Protocol `
{
protocol
}
` not supported. We do accept merge requests :-)
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment