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
90213c31
Commit
90213c31
authored
3 years ago
by
Laurent COLBOIS
Browse files
Options
Downloads
Patches
Plain Diff
Set all ids to strings which is expected. Fix annotation-type. Fix incomplete probe caching
parent
2ad9af6f
No related branches found
No related tags found
1 merge request
!124
Resolve "IJBC database will fail on non-Idiap filesystems"
Pipeline
#51872
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
+17
-14
17 additions, 14 deletions
bob/bio/face/database/ijbc.py
with
17 additions
and
14 deletions
bob/bio/face/database/ijbc.py
+
17
−
14
View file @
90213c31
...
@@ -17,8 +17,8 @@ def _make_sample_from_template_row(row, image_directory):
...
@@ -17,8 +17,8 @@ def _make_sample_from_template_row(row, image_directory):
return
DelayedSample
(
return
DelayedSample
(
load
=
partial
(
bob
.
io
.
image
.
load
,
os
.
path
.
join
(
image_directory
,
row
[
"
FILENAME
"
])),
load
=
partial
(
bob
.
io
.
image
.
load
,
os
.
path
.
join
(
image_directory
,
row
[
"
FILENAME
"
])),
reference_id
=
row
[
"
TEMPLATE_ID
"
],
reference_id
=
str
(
row
[
"
TEMPLATE_ID
"
]
)
,
subject_id
=
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
,
annotations
=
{
annotations
=
{
"
topleft
"
:
(
float
(
row
[
"
FACE_Y
"
]),
float
(
row
[
"
FACE_X
"
])),
"
topleft
"
:
(
float
(
row
[
"
FACE_Y
"
]),
float
(
row
[
"
FACE_X
"
])),
...
@@ -39,7 +39,10 @@ def _make_sample_set_from_template_group(template_group, image_directory):
...
@@ -39,7 +39,10 @@ def _make_sample_set_from_template_group(template_group, image_directory):
)
)
)
)
return
SampleSet
(
return
SampleSet
(
samples
,
reference_id
=
samples
[
0
].
reference_id
,
subject_id
=
samples
[
0
].
subject_id
samples
,
reference_id
=
samples
[
0
].
reference_id
,
subject_id
=
samples
[
0
].
subject_id
,
key
=
samples
[
0
].
reference_id
,
)
)
...
@@ -102,7 +105,7 @@ class IJBCDatabase(Database):
...
@@ -102,7 +105,7 @@ class IJBCDatabase(Database):
name
=
"
ijbc
"
,
name
=
"
ijbc
"
,
protocol
=
protocol
,
protocol
=
protocol
,
allow_scoring_with_all_biometric_references
=
False
,
allow_scoring_with_all_biometric_references
=
False
,
annotation_type
=
"
eyes-center
"
,
annotation_type
=
"
bounding-box
"
,
fixed_positions
=
None
,
fixed_positions
=
None
,
memory_demanding
=
True
,
memory_demanding
=
True
,
)
)
...
@@ -136,7 +139,7 @@ class IJBCDatabase(Database):
...
@@ -136,7 +139,7 @@ class IJBCDatabase(Database):
self
.
matches
=
pd
.
read_csv
(
self
.
matches
=
pd
.
read_csv
(
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
"
)
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 :-)
"
...
@@ -155,15 +158,15 @@ class IJBCDatabase(Database):
...
@@ -155,15 +158,15 @@ class IJBCDatabase(Database):
)
)
)
)
# Link probes to the references they have to be compared with
# Link probes to the references they have to be compared with
# We might make that faster if we manage to write it as a Panda instruction
# We might make that faster if we manage to write it as a Panda instruction
grouped_matches
=
self
.
matches
.
groupby
(
"
PROBE_TEMPLATE_ID
"
)
grouped_matches
=
self
.
matches
.
groupby
(
"
PROBE_TEMPLATE_ID
"
)
for
probe_sampleset
in
self
.
_cached_probes
:
for
probe_sampleset
in
self
.
_cached_probes
:
probe_sampleset
.
references
=
list
(
probe_sampleset
.
references
=
list
(
grouped_matches
.
get_group
(
probe_sampleset
.
reference_id
)[
grouped_matches
.
get_group
(
probe_sampleset
.
reference_id
)[
"
REFERENCE_TEMPLATE_ID
"
"
REFERENCE_TEMPLATE_ID
"
]
]
)
)
return
self
.
_cached_probes
return
self
.
_cached_probes
...
...
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