Commit 11d0d666 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

update config files

parent e793be09
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())
#!/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())
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())
......@@ -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())
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 = TransformerWrapper(cropper)
preprocessor = VideoWrapper(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(
extractor = VideoWrapper(
LBPHistogram(
lbptype="uniform",
elbptype="regular",
rad=1,
lbp_type="uniform",
elbp_type="regular",
radius=1,
neighbors=8,
circ=False,
circular=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)
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())
......@@ -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())
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 = TransformerWrapper(cropper)
preprocessor = VideoWrapper(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)
......@@ -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())
......@@ -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())
import bob.pipelines as mario
from bob.pad.face.transformer import VideoToFrames
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import make_pipeline
from sklearn.pipeline import Pipeline
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),
])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment