Commit 65f0b81f authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Add a base pad file for all face pad databases

parent 360523c5
Pipeline #14274 passed with stages
in 11 minutes and 57 seconds
from .database import VideoPadFile
from .replay import ReplayPadDatabase
from .replay_mobile import ReplayMobilePadDatabase
from .msu_mfsd import MsuMfsdPadDatabase
......@@ -8,8 +9,8 @@ from .mifs import MIFSPadDatabase
# gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
"""Says object was actually declared here, and not in the import module.
Fixing sphinx warnings of not being able to find classes, when path is shortened.
Parameters:
Fixing sphinx warnings of not being able to find classes, when path is
shortened. Parameters:
*args: An iterable of objects to modify
......@@ -22,6 +23,7 @@ def __appropriate__(*args):
__appropriate__(
VideoPadFile,
ReplayPadDatabase,
ReplayMobilePadDatabase,
MsuMfsdPadDatabase,
......
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#==============================================================================
from bob.pad.base.database import PadFile # Used in ReplayPadFile class
from bob.pad.face.database import VideoPadFile # Used in ReplayPadFile class
from bob.pad.base.database import PadDatabase
......@@ -21,7 +21,7 @@ import numpy as np
#==============================================================================
class AggregatedDbPadFile(PadFile):
class AggregatedDbPadFile(VideoPadFile):
"""
A high level implementation of the File class for the Aggregated Database
uniting 4 databases: REPLAY-ATTACK, REPLAY-MOBILE, MSU MFSD and Mobio.
......@@ -190,7 +190,7 @@ class AggregatedDbPadFile(PadFile):
#==========================================================================
def load(self, directory=None, extension='.mov'):
"""
Overridden version of the load method defined in the ``PadFile``.
Overridden version of the load method defined in the ``VideoPadFile``.
**Parameters:**
......
from bob.pad.base.database import PadFile
from bob.bio.video.database import VideoBioFile
class VideoPadFile(VideoBioFile, PadFile):
"""A simple base class that defines basic properties of File object for the
use in PAD experiments
"""
def __init__(self, attack_type, client_id, path, file_id=None):
VideoBioFile.__init__(
self,
client_id=client_id,
path=path,
file_id=file_id,
)
PadFile.__init__(
self,
attack_type=attack_type,
client_id=client_id,
path=path,
file_id=file_id,
)
......@@ -10,14 +10,14 @@ from bob.bio.video import FrameSelector, FrameContainer
import bob.io.base
import numpy as np
from bob.pad.base.database import PadFile # Used in ReplayPadFile class
from bob.pad.face.database import VideoPadFile # Used in ReplayPadFile class
from bob.pad.base.database import FileListPadDatabase
#==============================================================================
class MIFSPadFile(PadFile):
class MIFSPadFile(VideoPadFile):
"""
A high level implementation of the File class for the MIFS database.
"""
......@@ -29,7 +29,7 @@ class MIFSPadFile(PadFile):
#==========================================================================
def load(self, directory=None, extension=None, frame_selector=FrameSelector(selection_style='all')):
"""
Overridden version of the load method defined in the ``PadFile``.
Overridden version of the load method defined in the ``VideoPadFile``.
**Parameters:**
......
......@@ -5,7 +5,7 @@
# Used in ReplayMobilePadFile class
from bob.bio.video import FrameSelector, FrameContainer
from bob.pad.base.database import PadFile # Used in MsuMfsdPadFile class
from bob.pad.face.database import VideoPadFile # Used in MsuMfsdPadFile class
from bob.pad.base.database import PadDatabase
......@@ -15,7 +15,7 @@ import numpy as np
#==============================================================================
class MsuMfsdPadFile(PadFile):
class MsuMfsdPadFile(VideoPadFile):
"""
A high level implementation of the File class for the MSU MFSD database.
"""
......@@ -53,7 +53,7 @@ class MsuMfsdPadFile(PadFile):
#==========================================================================
def load(self, directory=None, extension=None, frame_selector=FrameSelector(selection_style='all')):
"""
Overridden version of the load method defined in the ``PadFile``.
Overridden version of the load method defined in the ``VideoPadFile``.
**Parameters:**
......
......@@ -6,14 +6,14 @@
# Used in ReplayMobilePadFile class
from bob.bio.video import FrameSelector, FrameContainer
from bob.pad.base.database import PadFile # Used in ReplayPadFile class
from bob.pad.face.database import VideoPadFile # Used in ReplayPadFile class
from bob.pad.base.database import PadDatabase
#==============================================================================
class ReplayPadFile(PadFile):
class ReplayPadFile(VideoPadFile):
"""
A high level implementation of the File class for the REPLAY-ATTACK database.
"""
......@@ -51,7 +51,7 @@ class ReplayPadFile(PadFile):
#==========================================================================
def load(self, directory=None, extension='.mov', frame_selector=FrameSelector(selection_style='all')):
"""
Overridden version of the load method defined in the ``PadFile``.
Overridden version of the load method defined in the ``VideoPadFile``.
**Parameters:**
......
......@@ -5,13 +5,13 @@
# Used in ReplayMobilePadFile class
from bob.bio.video import FrameSelector, FrameContainer
from bob.pad.base.database import PadFile # Used in ReplayMobilePadFile class
from bob.pad.face.database import VideoPadFile # Used in ReplayMobilePadFile class
from bob.pad.base.database import PadDatabase
#==============================================================================
class ReplayMobilePadFile(PadFile):
class ReplayMobilePadFile(VideoPadFile):
"""
A high level implementation of the File class for the Replay-Mobile database.
"""
......@@ -49,7 +49,7 @@ class ReplayMobilePadFile(PadFile):
#==========================================================================
def load(self, directory=None, extension='.mov', frame_selector=FrameSelector(selection_style='all')):
"""
Overridden version of the load method defined in the ``PadFile``.
Overridden version of the load method defined in the ``VideoPadFile``.
**Parameters:**
......
......@@ -12,6 +12,11 @@ This section lists all the functionality available in this library allowing to r
Database Interfaces
------------------------------
Base classes
============
.. autoclass:: bob.pad.face.database.VideoPadFile
REPLAY-ATTACK Database
========================
......
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