Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.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.pad.face
Commits
a9b50665
Commit
a9b50665
authored
6 years ago
by
Guillaume HEUSCH
Browse files
Options
Downloads
Patches
Plain Diff
fixed casiasurf high-level implementation, put it in __init__ and as an entry point
parent
d40132d2
No related branches found
No related tags found
1 merge request
!77
CASIA-SURF database
Pipeline
#26002
passed
6 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/pad/face/database/__init__.py
+1
-0
1 addition, 0 deletions
bob/pad/face/database/__init__.py
bob/pad/face/database/casiasurf.py
+29
-15
29 additions, 15 deletions
bob/pad/face/database/casiasurf.py
setup.py
+1
-0
1 addition, 0 deletions
setup.py
with
31 additions
and
15 deletions
bob/pad/face/database/__init__.py
+
1
−
0
View file @
a9b50665
...
...
@@ -7,6 +7,7 @@ from .mifs import MIFSPadDatabase
from
.batl
import
BatlPadDatabase
from
.celeb_a
import
CELEBAPadDatabase
from
.maskattack
import
MaskAttackPadDatabase
from
.casiasurf
import
CasiaSurfPadDatabase
# gets sphinx autodoc done right - don't remove it
def
__appropriate__
(
*
args
):
...
...
This diff is collapsed.
Click to expand it.
bob/pad/face/database/casiasurf.py
+
29
−
15
View file @
a9b50665
...
...
@@ -24,7 +24,7 @@ class CasiaSurfPadFile(VideoPadFile):
"""
def
__init__
(
self
,
f
,
stream_type
):
def
__init__
(
self
,
f
,
stream_type
,
attack_type
):
"""
Init
Parameters
...
...
@@ -63,7 +63,7 @@ class CasiaSurfPadFile(VideoPadFile):
"""
# get the dict of numpy array
data
=
self
.
f
.
load
(
directory
,
extension
,
modality
=
self
.
modality
)
data
=
self
.
f
.
load
(
directory
,
extension
,
modality
=
self
.
stream_type
)
# convert that to dict of FrameContainer
data_to_return
=
{}
...
...
@@ -93,21 +93,35 @@ class CasiaSurfPadDatabase(PadDatabase):
the group names in the high-level interface (train, dev, eval)
"""
def
__init__
(
self
,
protocol
=
'
all
'
,
original_directory
=
None
,
original_extension
=
'
.jpg
'
,
**
kwargs
):
"""
Init function
Parameters
----------
protocol : :py:class:`str`
The name of the protocol that defines the default experimental setup for this database.
original_directory : :py:class:`str`
The directory where the original data of the database are stored.
original_extension : :py:class:`str`
The file name extension of the original data.
from
bob.db.casiasurf
import
Database
as
LowLevelDatabase
self
.
db
=
LowLevelDatabase
()
"""
from
bob.db.casiasurf
import
Database
as
LowLevelDatabase
self
.
db
=
LowLevelDatabase
()
self
.
low_level_group_names
=
(
'
train
'
,
'
validation
'
,
'
test
'
)
self
.
high_level_group_names
=
(
'
train
'
,
'
dev
'
,
'
eval
'
)
self
.
low_level_group_names
=
(
'
train
'
,
'
validation
'
,
'
test
'
)
self
.
high_level_group_names
=
(
'
train
'
,
'
dev
'
,
'
eval
'
)
super
(
CasiaSurfPadDatabase
,
self
).
__init__
(
name
=
'
casiasurf
'
,
protocol
=
protocol
,
original_directory
=
original_directory
,
original_extension
=
original_extension
,
**
kwargs
)
super
(
CasiaSurfPadDatabase
,
self
).
__init__
(
name
=
'
casiasurf
'
,
protocol
=
protocol
,
original_directory
=
original_directory
,
original_extension
=
original_extension
,
**
kwargs
)
@property
@property
def
original_directory
(
self
):
return
self
.
db
.
original_directory
...
...
@@ -160,8 +174,8 @@ class CasiaSurfPadDatabase(PadDatabase):
if
(
'
dev
'
in
groups
or
'
test
'
in
groups
)
and
purposes
==
'
attack
'
:
lowlevel_purposes
.
append
(
'
unknown
'
)
samples
=
self
.
db
.
objects
(
set
s
=
groups
,
purposes
=
lowlevel_purposes
,
**
kwargs
)
samples
=
[
CasiaSurfPadFile
(
s
)
for
s
in
samples
]
samples
=
self
.
db
.
objects
(
group
s
=
groups
,
purposes
=
lowlevel_purposes
,
**
kwargs
)
samples
=
[
CasiaSurfPadFile
(
s
,
stream_type
=
protocol
,
attack_type
=
s
.
attack_type
)
for
s
in
samples
]
return
samples
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
0
View file @
a9b50665
...
...
@@ -74,6 +74,7 @@ setup(
'
batl-db-thermal = bob.pad.face.config.batl_db_thermal:database
'
,
'
celeb-a = bob.pad.face.config.celeb_a:database
'
,
'
maskattack = bob.pad.face.config.maskattack:database
'
,
'
casiasurf = bob.pad.face.config.casiasurf:database
'
,
],
# registered configurations:
...
...
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