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
281993c4
Commit
281993c4
authored
4 years ago
by
Laurent COLBOIS
Browse files
Options
Downloads
Patches
Plain Diff
[Database][IJBC] Updated Fast IJBC database wrapper
parent
60b60bf6
No related branches found
No related tags found
No related merge requests found
Pipeline
#46199
failed
4 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/face/config/database/ijbc.py
+30
-16
30 additions, 16 deletions
bob/bio/face/config/database/ijbc.py
with
30 additions
and
16 deletions
bob/bio/face/config/database/ijbc.py
+
30
−
16
View file @
281993c4
#!/usr/bin/env python
#!/usr/bin/env python
from
bob.bio.face.database
import
IJBCBioDatabase
from
bob.bio.base.pipelines.vanilla_biometrics
import
DatabaseConnector
from
bob.extension
import
rc
import
pickle
import
pickle
import
os
import
os
ijbc_directory
=
rc
[
"
bob.db.ijbc.directory
"
]
ijbc_directory
=
"
/idiap/resource/database/IJB-C/IJB/IJB-C/images
"
ijbc_pkl_directory
=
rc
[
"
bob.db.ijbc.pkl_directory
"
]
ijbc_pkl_directory
=
"
/idiap/temp/tpereira/ijbc_metadata/
"
from
bob.pipelines.utils
import
hash_string
class
MetadataLinker
:
def
__init__
(
self
,
name
,
protocol
):
self
.
name
=
name
self
.
protocol
=
protocol
class
FastIJBCDatabase
:
class
FastIJBCDatabase
:
def
__init__
(
self
,
pkl_directory
):
def
__init__
(
self
,
pkl_directory
):
self
.
pkl_directory
=
pkl_directory
self
.
pkl_directory
=
pkl_directory
self
.
annotation_type
=
'
bounding-box
'
self
.
annotation_type
=
"
bounding-box
"
self
.
fixed_positions
=
None
self
.
fixed_positions
=
None
self
.
allow_scoring_with_all_biometric_references
=
False
self
.
hash_fn
=
hash_string
self
.
memory_demanding
=
True
def
_assert_group
(
self
,
group
):
def
_assert_group
(
self
,
group
):
assert
group
==
"
dev
"
,
"
The IJBC database only has a `dev` group. Received : {}
"
.
format
(
group
)
assert
(
group
==
"
dev
"
),
"
The IJBC database only has a `dev` group. Received : {}
"
.
format
(
group
)
def
references
(
self
,
group
=
"
dev
"
):
def
references
(
self
,
group
=
"
dev
"
):
self
.
_assert_group
(
group
)
self
.
_assert_group
(
group
)
return
pickle
.
loads
(
open
(
os
.
path
.
join
(
self
.
pkl_directory
,
"
db_references.pickle
"
),
"
rb
"
).
read
())
return
pickle
.
loads
(
open
(
os
.
path
.
join
(
self
.
pkl_directory
,
"
db_references.pickle
"
),
"
rb
"
).
read
()
)
def
probes
(
self
,
group
=
"
dev
"
):
def
probes
(
self
,
group
=
"
dev
"
):
self
.
_assert_group
(
group
)
self
.
_assert_group
(
group
)
return
pickle
.
loads
(
open
(
os
.
path
.
join
(
self
.
pkl_directory
,
"
db_probes.pickle
"
),
"
rb
"
).
read
())
return
pickle
.
loads
(
open
(
os
.
path
.
join
(
self
.
pkl_directory
,
"
db_probes.pickle
"
),
"
rb
"
).
read
()
)
def
background_model_samples
(
self
,
group
=
"
dev
"
):
def
background_model_samples
(
self
,
group
=
"
dev
"
):
self
.
_assert_group
(
group
)
self
.
_assert_group
(
group
)
return
pickle
.
loads
(
open
(
os
.
path
.
join
(
self
.
pkl_directory
,
"
db_background_model_samples.pickle
"
),
"
rb
"
).
read
())
return
pickle
.
loads
(
open
(
database
=
FastIJBCDatabase
(
os
.
path
.
join
(
self
.
pkl_directory
,
"
db_background_model_samples.pickle
"
),
pkl_directory
=
ijbc_pkl_directory
"
rb
"
,
)
).
read
()
)
database
=
FastIJBCDatabase
(
pkl_directory
=
ijbc_pkl_directory
)
# database = DatabaseConnector(
# database = DatabaseConnector(
# IJBCBioDatabase(original_directory=ijbc_directory, protocol="1:1"),
# IJBCBioDatabase(original_directory=ijbc_directory, protocol="1:1"),
...
...
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