Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.pad.face
Commits
11d0d666
Commit
11d0d666
authored
Nov 12, 2020
by
Amir MOHAMMADI
Browse files
update config files
parent
e793be09
Changes
11
Hide whitespace changes
Inline
Side-by-side
bob/pad/face/config/brsu.py
View file @
11d0d666
from
bob.pad.face.database
import
BRSUPadDatabase
from
bob.pad.base.pipelines.vanilla_pad
import
DatabaseConnector
from
bob.extension
import
rc
database
=
DatabaseConnector
(
BRSUPadDatabase
(
protocol
=
"test"
,
original_directory
=
rc
[
"bob.db.brsu.directory"
],
)
)
database
=
DatabaseConnector
(
BRSUPadDatabase
())
bob/pad/face/config/casiasurf.py
View file @
11d0d666
#!/usr/bin/env python
# encoding: utf-8
from
bob.pad.face.database
import
CasiaSurfPadDatabase
from
bob.
extension
import
rc
from
bob.
pad.base.pipelines.vanilla_pad
import
DatabaseConnector
database
=
CasiaSurfPadDatabase
(
protocol
=
'all'
,
original_directory
=
rc
[
'bob.db.casiasurf.directory'
],
original_extension
=
".jpg"
,
)
database
=
DatabaseConnector
(
CasiaSurfPadDatabase
())
bob/pad/face/config/casiasurf_color.py
View file @
11d0d666
from
bob.pad.face.database
import
CasiaSurfPadDatabase
from
bob.pad.base.pipelines.vanilla_pad
import
DatabaseConnector
from
bob.extension
import
rc
database
=
DatabaseConnector
(
CasiaSurfPadDatabase
(
protocol
=
"color"
,
original_directory
=
rc
.
get
(
"bob.db.casiasurf.directory"
),
original_extension
=
".jpg"
,
)
)
database
=
DatabaseConnector
(
CasiaSurfPadDatabase
())
bob/pad/face/config/celeb_a.py
View file @
11d0d666
...
...
@@ -8,15 +8,7 @@ the link.
"""
from
bob.extension
import
rc
from
bob.pad.base.pipelines.vanilla_pad
import
DatabaseConnector
from
bob.pad.face.database.celeb_a
import
CELEBAPadDatabase
database
=
DatabaseConnector
(
CELEBAPadDatabase
(
protocol
=
"grandtest"
,
original_directory
=
rc
.
get
(
"bob.db.celeba.directory"
),
original_extension
=
""
,
training_depends_on_protocol
=
True
,
)
)
database
=
DatabaseConnector
(
CELEBAPadDatabase
())
bob/pad/face/config/lbp_64.py
View file @
11d0d666
import
bob.pipelines
as
mario
from
bob.bio.face.helpers
import
face_crop_solver
from
bob.bio.video
import
VideoLikeContainer
from
bob.bio.video.transformer
import
Wrapper
as
TransformerWrapper
from
bob.bio.video.transformer
import
VideoWrapper
from
bob.pad.face.extractor
import
LBPHistogram
database
=
globals
().
get
(
"database"
)
...
...
@@ -16,31 +15,22 @@ else:
cropper
=
face_crop_solver
(
cropped_image_size
=
64
,
cropped_positions
=
annotation_type
,
color_channel
=
"gray"
)
preprocessor
=
Transformer
Wrapper
(
cropper
)
preprocessor
=
Video
Wrapper
(
cropper
)
preprocessor
=
mario
.
wrap
(
[
"sample"
,
"checkpoint"
],
[
"sample"
],
preprocessor
,
transform_extra_arguments
=
((
"annotations"
,
"annotations"
),),
features_dir
=
"temp/faces-64"
,
save_func
=
VideoLikeContainer
.
save
,
load_func
=
VideoLikeContainer
.
load
,
)
# Extractor #
extractor
=
Transformer
Wrapper
(
extractor
=
Video
Wrapper
(
LBPHistogram
(
lbptype
=
"uniform"
,
elbptype
=
"regular"
,
rad
=
1
,
lbp
_
type
=
"uniform"
,
elbp
_
type
=
"regular"
,
rad
ius
=
1
,
neighbors
=
8
,
circ
=
False
,
circ
ular
=
False
,
dtype
=
None
,
)
)
extractor
=
mario
.
wrap
(
[
"sample"
,
"checkpoint"
],
extractor
,
features_dir
=
"temp/iqm-features"
,
save_func
=
VideoLikeContainer
.
save
,
load_func
=
VideoLikeContainer
.
load
,
)
extractor
=
mario
.
wrap
([
"sample"
],
extractor
)
bob/pad/face/config/maskattack.py
View file @
11d0d666
from
bob.pad.face.database
import
MaskAttackPadDatabase
from
bob.pad.base.pipelines.vanilla_pad
import
DatabaseConnector
from
bob.extension
import
rc
database
=
DatabaseConnector
(
MaskAttackPadDatabase
(
protocol
=
"classification"
,
original_directory
=
rc
.
get
(
"bob.db.maskattack.directory"
),
original_extension
=
".avi"
,
)
)
database
=
DatabaseConnector
(
MaskAttackPadDatabase
())
bob/pad/face/config/mifs.py
View file @
11d0d666
...
...
@@ -17,12 +17,5 @@ the link.
"""
from
bob.pad.face.database
import
MIFSPadDatabase
from
bob.pad.base.pipelines.vanilla_pad
import
DatabaseConnector
from
bob.extension
import
rc
database
=
DatabaseConnector
(
MIFSPadDatabase
(
protocol
=
"grandtest"
,
original_directory
=
rc
.
get
(
"bob.db.mifs.directory"
),
original_extension
=
""
,
)
)
database
=
DatabaseConnector
(
MIFSPadDatabase
())
bob/pad/face/config/qm_64.py
View file @
11d0d666
import
bob.pipelines
as
mario
from
bob.bio.face.helpers
import
face_crop_solver
from
bob.bio.video
import
VideoLikeContainer
from
bob.bio.video.transformer
import
Wrapper
as
TransformerWrapper
from
bob.bio.video.transformer
import
VideoWrapper
from
bob.pad.face.extractor
import
ImageQualityMeasure
database
=
globals
().
get
(
"database"
)
...
...
@@ -14,22 +13,13 @@ else:
# Preprocessor #
cropper
=
face_crop_solver
(
cropped_image_size
=
64
,
cropped_positions
=
annotation_type
)
preprocessor
=
Transformer
Wrapper
(
cropper
)
preprocessor
=
Video
Wrapper
(
cropper
)
preprocessor
=
mario
.
wrap
(
[
"sample"
,
"checkpoint"
],
[
"sample"
],
preprocessor
,
transform_extra_arguments
=
((
"annotations"
,
"annotations"
),),
features_dir
=
"temp/faces-64"
,
save_func
=
VideoLikeContainer
.
save
,
load_func
=
VideoLikeContainer
.
load
,
)
# Extractor #
extractor
=
TransformerWrapper
(
ImageQualityMeasure
(
galbally
=
True
,
msu
=
True
,
dtype
=
None
))
extractor
=
mario
.
wrap
(
[
"sample"
,
"checkpoint"
],
extractor
,
features_dir
=
"temp/iqm-features"
,
save_func
=
VideoLikeContainer
.
save
,
load_func
=
VideoLikeContainer
.
load
,
)
extractor
=
VideoWrapper
(
ImageQualityMeasure
(
galbally
=
True
,
msu
=
True
,
dtype
=
None
))
extractor
=
mario
.
wrap
([
"sample"
],
extractor
)
bob/pad/face/config/replay_attack.py
View file @
11d0d666
...
...
@@ -11,12 +11,5 @@ the link.
"""
from
bob.pad.face.database
import
ReplayPadDatabase
from
bob.pad.base.pipelines.vanilla_pad
import
DatabaseConnector
from
bob.extension
import
rc
database
=
DatabaseConnector
(
ReplayPadDatabase
(
protocol
=
"grandtest"
,
original_directory
=
rc
.
get
(
"bob.db.replay.directory"
),
original_extension
=
".mov"
,
)
)
database
=
DatabaseConnector
(
ReplayPadDatabase
())
bob/pad/face/config/replay_mobile.py
View file @
11d0d666
...
...
@@ -14,12 +14,5 @@ the link.
"""
from
bob.pad.face.database
import
ReplayMobilePadDatabase
from
bob.pad.base.pipelines.vanilla_pad
import
DatabaseConnector
from
bob.extension
import
rc
database
=
DatabaseConnector
(
ReplayMobilePadDatabase
(
protocol
=
"grandtest"
,
original_directory
=
rc
.
get
(
"bob.db.replaymobile.directory"
),
original_extension
=
".mov"
,
)
)
database
=
DatabaseConnector
(
ReplayMobilePadDatabase
())
bob/pad/face/config/svm_frames.py
View file @
11d0d666
import
bob.pipelines
as
mario
from
bob.pad.face.transformer
import
VideoToFrames
from
sklearn.model_selection
import
GridSearchCV
from
sklearn.pipeline
import
make_p
ipeline
from
sklearn.pipeline
import
P
ipeline
from
sklearn.svm
import
SVC
preprocessor
=
globals
().
get
(
"preprocessor"
)
...
...
@@ -20,13 +20,16 @@ param_grid = [
classifier
=
GridSearchCV
(
SVC
(),
param_grid
=
param_grid
,
cv
=
3
)
classifier
=
mario
.
wrap
(
[
"sample"
,
"checkpoint"
],
[
"sample"
],
classifier
,
fit_extra_arguments
=
[(
"y"
,
"is_bonafide"
)],
model_path
=
"temp/svm.pkl"
,
)
# Pipeline #
frames_classifier
=
make_pipeline
(
frame_cont_to_array
,
classifier
)
pipeline
=
make_pipeline
(
preprocessor
,
extractor
,
frames_classifier
)
frames_classifier
=
Pipeline
([(
"frame_cont_to_array"
,
frame_cont_to_array
),
(
"classifier"
,
classifier
)])
pipeline
=
Pipeline
([
(
"preprocessor"
,
preprocessor
),
(
"extractor"
,
extractor
),
(
"svm"
,
frames_classifier
),
])
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment