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
470b12f3
Commit
470b12f3
authored
Mar 13, 2018
by
André Anjos
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adaptations to allow vulnerability analysis
parent
a1dd2f3d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
8 deletions
+31
-8
bob/bio/vein/configurations/verafinger.py
bob/bio/vein/configurations/verafinger.py
+6
-0
bob/bio/vein/database/verafinger.py
bob/bio/vein/database/verafinger.py
+22
-7
doc/baselines.rst
doc/baselines.rst
+2
-1
doc/links.rst
doc/links.rst
+1
-0
No files found.
bob/bio/vein/configurations/verafinger.py
View file @
470b12f3
...
@@ -43,4 +43,10 @@ protocol = 'Nom'
...
@@ -43,4 +43,10 @@ protocol = 'Nom'
You may modify this at runtime by specifying the option ``--protocol`` on the
You may modify this at runtime by specifying the option ``--protocol`` on the
command-line of ``verify.py`` or using the keyword ``protocol`` on a
command-line of ``verify.py`` or using the keyword ``protocol`` on a
configuration file that is loaded **after** this configuration resource.
configuration file that is loaded **after** this configuration resource.
We accept any biometric recognition protocol implemented by bob.db.verafinger.
Variants of the biometric recognition protocol ending in ``-va`` can be used to
test for vulnerability analysis. For example, use the protocol ``Nom-va`` to
test the vulnerability of a biometric recognition pipeline using the ``Nom``
protocol for enrollment and probe samples from presentation attacks.
"""
"""
bob/bio/vein/database/verafinger.py
View file @
470b12f3
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# vim: set fileencoding=utf-8 :
# vim: set fileencoding=utf-8 :
# Tue 27 Sep 2016 16:48:57 CEST
# Tue 27 Sep 2016 16:48:57 CEST
import
os
from
bob.bio.base.database
import
BioFile
,
BioDatabase
from
bob.bio.base.database
import
BioFile
,
BioDatabase
...
@@ -22,8 +23,9 @@ class File(BioFile):
...
@@ -22,8 +23,9 @@ class File(BioFile):
def
__init__
(
self
,
f
):
def
__init__
(
self
,
f
):
super
(
File
,
self
).
__init__
(
client_id
=
f
.
unique_finger_name
,
path
=
f
.
path
,
id_
=
f
.
finger
.
unique_name
file_id
=
f
.
id
)
if
f
.
source
==
'pa'
:
id_
=
'attack/%s'
%
id_
super
(
File
,
self
).
__init__
(
client_id
=
id_
,
path
=
f
.
path
,
file_id
=
f
.
id
)
self
.
__f
=
f
self
.
__f
=
f
...
@@ -31,8 +33,14 @@ class File(BioFile):
...
@@ -31,8 +33,14 @@ class File(BioFile):
"""(Overrides base method) Loads both image and mask"""
"""(Overrides base method) Loads both image and mask"""
image
=
super
(
File
,
self
).
load
(
*
args
,
**
kwargs
)
image
=
super
(
File
,
self
).
load
(
*
args
,
**
kwargs
)
roi
=
self
.
__f
.
roi
()
basedir
=
args
[
0
]
if
args
else
kwargs
[
'directory'
]
return
AnnotatedArray
(
image
,
metadata
=
dict
(
roi
=
roi
))
annotdir
=
os
.
path
.
join
(
basedir
,
'annotations'
,
'roi'
)
if
os
.
path
.
exists
(
annotdir
):
print
(
'loading annotations'
)
roi
=
self
.
__f
.
roi
(
args
[
0
])
return
AnnotatedArray
(
image
,
metadata
=
dict
(
roi
=
roi
))
print
(
'NOT loading annotations'
)
return
image
class
Database
(
BioDatabase
):
class
Database
(
BioDatabase
):
...
@@ -72,9 +80,16 @@ class Database(BioDatabase):
...
@@ -72,9 +80,16 @@ class Database(BioDatabase):
groups
=
self
.
convert_names_to_lowlevel
(
groups
,
groups
=
self
.
convert_names_to_lowlevel
(
groups
,
self
.
low_level_group_names
,
self
.
high_level_group_names
)
self
.
low_level_group_names
,
self
.
high_level_group_names
)
retval
=
self
.
_db
.
objects
(
groups
=
groups
,
protocol
=
protocol
,
purposes
=
purposes
,
model_ids
=
model_ids
,
if
(
protocol
.
endswith
(
'-va'
)
or
protocol
.
endswith
(
'-VA'
))
and
\
**
kwargs
)
purposes
==
'probe'
:
#the user actually means 'attack'
retval
=
self
.
_db
.
objects
(
groups
=
groups
,
protocol
=
protocol
[:
-
3
],
purposes
=
'attack'
,
model_ids
=
model_ids
,
**
kwargs
)
else
:
retval
=
self
.
_db
.
objects
(
groups
=
groups
,
protocol
=
protocol
,
purposes
=
purposes
,
model_ids
=
model_ids
,
**
kwargs
)
return
[
File
(
f
)
for
f
in
retval
]
return
[
File
(
f
)
for
f
in
retval
]
...
...
doc/baselines.rst
View file @
470b12f3
...
@@ -105,7 +105,8 @@ protocol, do the following:
...
@@ -105,7 +105,8 @@ protocol, do the following:
If you have more processing cores on your local machine and don't want to
If you have more processing cores on your local machine and don't want to
submit your job for SGE execution, you can run it in parallel (using 4
submit your job for SGE execution, you can run it in parallel (using 4
parallel tasks) by adding the options ``--parallel=4 --nice=10``.
parallel tasks) by adding the options ``--parallel=4 --nice=10``. **Before**
doing so, make sure the package gridtk_ is properly installed.
Optionally, you may use the ``parallel`` resource configuration which
Optionally, you may use the ``parallel`` resource configuration which
already sets the number of parallel jobs to the number of hardware cores you
already sets the number of parallel jobs to the number of hardware cores you
...
...
doc/links.rst
View file @
470b12f3
...
@@ -22,3 +22,4 @@
...
@@ -22,3 +22,4 @@
.. _bob.bio.base: https://pypi.python.org/pypi/bob.bio.base
.. _bob.bio.base: https://pypi.python.org/pypi/bob.bio.base
.. _jaccard index: https://en.wikipedia.org/wiki/Jaccard_index
.. _jaccard index: https://en.wikipedia.org/wiki/Jaccard_index
.. _watershed: https://en.wikipedia.org/wiki/Watershed_(image_processing)
.. _watershed: https://en.wikipedia.org/wiki/Watershed_(image_processing)
.. _gridtk: https://pypi.python.org/pypi/gridtk
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