Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.base
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.base
Commits
caf9f93e
Commit
caf9f93e
authored
3 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
remove support for legacy databases
parent
ebb608e9
No related branches found
No related tags found
1 merge request
!94
remove support for legacy databases
Pipeline
#60825
passed
3 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/pad/base/pipelines/vanilla_pad/__init__.py
+0
-2
0 additions, 2 deletions
bob/pad/base/pipelines/vanilla_pad/__init__.py
bob/pad/base/pipelines/vanilla_pad/legacy.py
+0
-61
0 additions, 61 deletions
bob/pad/base/pipelines/vanilla_pad/legacy.py
doc/implemented.rst
+0
-1
0 additions, 1 deletion
doc/implemented.rst
with
0 additions
and
64 deletions
bob/pad/base/pipelines/vanilla_pad/__init__.py
+
0
−
2
View file @
caf9f93e
from
.abstract_classes
import
Database
from
.legacy
import
DatabaseConnector
# gets sphinx autodoc done right - don't remove it
...
...
@@ -20,6 +19,5 @@ def __appropriate__(*args):
__appropriate__
(
Database
,
DatabaseConnector
,
)
__all__
=
[
_
for
_
in
dir
()
if
not
_
.
startswith
(
"
_
"
)]
This diff is collapsed.
Click to expand it.
bob/pad/base/pipelines/vanilla_pad/legacy.py
deleted
100644 → 0
+
0
−
61
View file @
ebb608e9
"""
Re-usable blocks for legacy bob.pad.base databases
"""
import
logging
from
bob.pipelines.sample
import
DelayedSample
from
.abstract_classes
import
Database
logger
=
logging
.
getLogger
(
__name__
)
def
_padfile_to_delayed_sample
(
padfile
,
database
):
return
DelayedSample
(
load
=
padfile
.
load
,
subject
=
str
(
padfile
.
client_id
),
attack_type
=
padfile
.
attack_type
,
key
=
padfile
.
path
,
delayed_attributes
=
dict
(
annotations
=
lambda
:
padfile
.
annotations
),
is_bonafide
=
padfile
.
attack_type
is
None
,
)
class
DatabaseConnector
(
Database
):
"""
Wraps a bob.pad.base database and generates conforming samples
This connector allows wrapping generic bob.pad.base datasets and generate samples
that conform to the specifications of pad pipelines defined in this package.
Parameters
----------
database : object
An instantiated version of a bob.pad.base.Database object
"""
def
__init__
(
self
,
database
,
annotation_type
=
"
eyes-center
"
,
fixed_positions
=
None
,
**
kwargs
,
):
super
().
__init__
(
**
kwargs
)
self
.
database
=
database
self
.
annotation_type
=
annotation_type
self
.
fixed_positions
=
fixed_positions
def
fit_samples
(
self
):
objects
=
self
.
database
.
training_files
(
flat
=
True
)
return
[
_padfile_to_delayed_sample
(
k
,
self
.
database
)
for
k
in
objects
]
def
predict_samples
(
self
,
group
=
"
dev
"
):
objects
=
self
.
database
.
all_files
(
groups
=
group
,
flat
=
True
)
return
[
_padfile_to_delayed_sample
(
k
,
self
.
database
)
for
k
in
objects
]
def
__repr__
(
self
)
->
str
:
return
f
"""
{
self
.
__class__
.
__name__
}
(
database=
{
self
.
database
}
,
annotation_type=
{
self
.
annotation_type
}
,
fixed_positions=
{
self
.
fixed_positions
}
)
"""
This diff is collapsed.
Click to expand it.
doc/implemented.rst
+
0
−
1
View file @
caf9f93e
...
...
@@ -20,7 +20,6 @@ Implementations
.. autosummary::
bob.pad.base.pipelines.vanilla_pad.Database
bob.pad.base.pipelines.vanilla_pad.DatabaseConnector
bob.pad.base.database.FileListPadDatabase
Preprocessors and Extractors
...
...
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