Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.bio.vein
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.bio.vein
Commits
8a3dbb59
Commit
8a3dbb59
authored
Feb 20, 2018
by
André Anjos
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update utfvp interface
parent
ee9bb4ee
Pipeline
#16954
failed with stage
in 107 minutes and 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
16 deletions
+44
-16
bob/bio/vein/database/utfvp.py
bob/bio/vein/database/utfvp.py
+41
-13
bob/bio/vein/tests/test_databases.py
bob/bio/vein/tests/test_databases.py
+3
-3
No files found.
bob/bio/vein/database/utfvp.py
View file @
8a3dbb59
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Fri 04 Nov 2016 14:46:53 CET
# Tue 27 Sep 2016 16:48:57 CEST
from
bob.bio.base.database
import
BioFile
,
BioDatabase
from
.
import
AnnotatedArray
from
..preprocessor.utils
import
poly_to_mask
class
File
(
BioFile
):
"""
Implements extra properties of vein files for the UTFVP
Fingervein
database
Implements extra properties of vein files for the UTFVP database
Parameters:
f (object): Low-level file (or sample) object that is kept inside
f (object): Low-level file (or sample) object that is kept inside
"""
def
__init__
(
self
,
f
):
super
(
File
,
self
).
__init__
(
client_id
=
f
.
client_id
,
path
=
f
.
path
,
file_id
=
f
.
id
)
super
(
File
,
self
).
__init__
(
client_id
=
f
.
unique_finger_name
,
path
=
f
.
path
,
file_id
=
f
.
id
)
self
.
__f
=
f
def
load
(
self
,
*
args
,
**
kwargs
):
"""(Overrides base method) Loads both image and mask"""
image
=
super
(
File
,
self
).
load
(
*
args
,
**
kwargs
)
roi
=
self
.
__f
.
roi
()
return
AnnotatedArray
(
image
,
metadata
=
dict
(
roi
=
roi
))
class
Database
(
BioDatabase
):
"""
Implements verification API for querying UTFVP
Fingervein
database.
Implements verification API for querying UTFVP database.
"""
def
__init__
(
self
,
**
kwargs
):
...
...
@@ -34,22 +46,38 @@ class Database(BioDatabase):
from
bob.db.utfvp.query
import
Database
as
LowLevelDatabase
self
.
_db
=
LowLevelDatabase
()
self
.
low_level_group_names
=
(
'train'
,
'dev'
)
self
.
high_level_group_names
=
(
'world'
,
'dev'
)
def
groups
(
self
):
return
self
.
convert_names_to_highlevel
(
self
.
_db
.
groups
(),
self
.
low_level_group_names
,
self
.
high_level_group_names
)
def
client_id_from_model_id
(
self
,
model_id
,
group
=
'dev'
):
"""Required as ``model_id != client_id`` on this database"""
return
self
.
_db
.
finger_name_from_model_id
(
model_id
)
def
model_ids_with_protocol
(
self
,
groups
=
None
,
protocol
=
None
,
**
kwargs
):
protocol
=
protocol
if
protocol
is
not
None
else
self
.
protocol
groups
=
self
.
convert_names_to_lowlevel
(
groups
,
self
.
low_level_group_names
,
self
.
high_level_group_names
)
return
self
.
_db
.
model_ids
(
groups
=
groups
,
protocol
=
protocol
)
def
objects
(
self
,
groups
=
None
,
protocol
=
None
,
purposes
=
None
,
model_ids
=
None
,
**
kwargs
):
groups
=
self
.
convert_names_to_lowlevel
(
groups
,
self
.
low_level_group_names
,
self
.
high_level_group_names
)
retval
=
self
.
_db
.
objects
(
groups
=
groups
,
protocol
=
protocol
,
purposes
=
purposes
,
model_ids
=
model_ids
,
**
kwargs
)
purposes
=
purposes
,
model_ids
=
model_ids
,
**
kwargs
)
return
[
File
(
f
)
for
f
in
retval
]
def
annotations
(
self
,
file
):
return
None
def
client_id_from_model_id
(
self
,
model_id
,
group
=
'dev'
):
"""Required as ``model_id != client_id`` on this database"""
return
self
.
_db
.
get_client_id_from_model_id
(
model_id
)
bob/bio/vein/tests/test_databases.py
View file @
8a3dbb59
...
...
@@ -14,8 +14,8 @@ def test_utfvp():
module
=
bob
.
bio
.
base
.
load_resource
(
'utfvp'
,
'config'
,
preferred_package
=
'bob.bio.vein'
)
try
:
check_database
(
module
.
database
,
protocol
=
module
.
protocol
,
groups
=
(
'dev'
,
'eval'
))
check_database
(
module
.
database
,
protocol
=
'nomLeftIndex'
,
groups
=
(
'dev'
,
'eval'
))
except
IOError
as
e
:
raise
SkipTest
(
"The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'"
%
e
)
...
...
@@ -52,4 +52,4 @@ def test_putvein():
check_database
(
module
.
database
,
protocol
=
'wrist-LR_1'
,
groups
=
(
'dev'
,))
except
IOError
as
e
:
raise
SkipTest
(
"The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'"
%
e
)
\ No newline at end of file
"The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'"
%
e
)
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