diff --git a/bob/pad/face/algorithm/VideoSvmPadAlgorithm.py b/bob/pad/face/algorithm/VideoSvmPadAlgorithm.py index e99f7572ee5560bc808643c86c96534569faf9e6..110c07866f644525d86cf6385d13416a602069ad 100644 --- a/bob/pad/face/algorithm/VideoSvmPadAlgorithm.py +++ b/bob/pad/face/algorithm/VideoSvmPadAlgorithm.py @@ -137,9 +137,9 @@ class VideoSvmPadAlgorithm(Algorithm): **Parameters:** - ``frame_containers`` : :py:class:`list` - Each element in the list is a Frame Container, , see ``bob.bio.video.utils.FrameContainer``. - Each frame Container conteins feature vectors for the particular individual/person. + ``frame_containers`` : [FrameContainer] + A list of Frame Containers, , see ``bob.bio.video.utils.FrameContainer``. + Each frame Container contains feature vectors for the particular individual/person. **Returns:** @@ -173,8 +173,8 @@ class VideoSvmPadAlgorithm(Algorithm): **Returns:** - ``combinations`` : :py:class:`list` - List of dictionaries containing the combinations. + ``combinations`` : [:py:class:`dict`] + A list of dictionaries containing the combinations. """ varNames = sorted(input_dict) @@ -257,10 +257,10 @@ class VideoSvmPadAlgorithm(Algorithm): **Parameters:** - ``training_features`` : :py:class:`list` + ``training_features`` : [[FrameContainer], [FrameContainer]] A list containing two elements: [0] - a list of Frame Containers with - feature vectors fot the real class; [1] - a list of Frame Containers with - feature vectors fot the attack class. + feature vectors for the real class; [1] - a list of Frame Containers with + feature vectors for the attack class. ``n_samples`` : :py:class:`int` Number of uniformly selected feature vectors per class. @@ -457,10 +457,10 @@ class VideoSvmPadAlgorithm(Algorithm): **Parameters:** - ``training_features`` : :py:class:`list` + ``training_features`` : [[FrameContainer], [FrameContainer]] A list containing two elements: [0] - a list of Frame Containers with - feature vectors fot the real class; [1] - a list of Frame Containers with - feature vectors fot the attack class. + feature vectors for the real class; [1] - a list of Frame Containers with + feature vectors for the attack class. ``n_samples`` : :py:class:`int` Number of uniformly selected feature vectors per class defining the @@ -589,10 +589,10 @@ class VideoSvmPadAlgorithm(Algorithm): **Parameters:** - ``training_features`` : :py:class:`list` + ``training_features`` : [[FrameContainer], [FrameContainer]] A list containing two elements: [0] - a list of Frame Containers with - feature vectors fot the real class; [1] - a list of Frame Containers with - feature vectors fot the attack class. + feature vectors for the real class; [1] - a list of Frame Containers with + feature vectors for the attack class. ``projector_file`` : :py:class:`str` The file to save the trained projector to. @@ -660,16 +660,14 @@ class VideoSvmPadAlgorithm(Algorithm): An array containing class probabilities for each frame. First column contains probabilities for each frame being a real class. Second column contains probabilities for each frame being an attack class. - Must be writable with the :py:meth:`write_feature` function and - readable with the :py:meth:`read_feature` function. + Must be writable with the ``write_feature`` function and + readable with the ``read_feature`` function. """ features_array = self.convert_frame_cont_to_array(feature) probabilities = self.machine.predict_class_and_probabilities(features_array)[1] -# probabilities = self.machine.predict_class_and_scores(features_array)[1] - return probabilities @@ -716,12 +714,10 @@ class VideoSvmPadAlgorithm(Algorithm): **Returns:** - ``list_of_scores`` : list + ``list_of_scores`` : [:py:class:`float`] A list containing the scores. """ -# import ipdb; ipdb.set_trace() - if self.frame_level_scores_flag: list_of_scores = self.score(toscore) @@ -733,53 +729,3 @@ class VideoSvmPadAlgorithm(Algorithm): return list_of_scores - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bob/pad/face/database/replay.py b/bob/pad/face/database/replay.py index e8f052f2a725f6c8da4172f52ca92636afe4e3b0..fd8bb048677703d1675c44eedce1d732c8161cdf 100644 --- a/bob/pad/face/database/replay.py +++ b/bob/pad/face/database/replay.py @@ -1,12 +1,6 @@ #!/usr/bin/env python2 # -*- coding: utf-8 -*- -""" -Created on Thu May 4 12:03:36 2017 -High level implementation for the REPLAY-ATTACK database - -@author: Olegs Nikisins <olegs.nikisins@idiap.ch> -""" #============================================================================== diff --git a/bob/pad/face/extractor/FrameDiffFeatures.py b/bob/pad/face/extractor/FrameDiffFeatures.py index 8b14085a5f7001ccb26803ce032a4ce7b65b620b..8560a5fe6257754efa0dbae68bdc1d2a6b8f7e99 100644 --- a/bob/pad/face/extractor/FrameDiffFeatures.py +++ b/bob/pad/face/extractor/FrameDiffFeatures.py @@ -35,7 +35,7 @@ class FrameDiffFeatures(Extractor): .. math:: - D(N) = \frac{\sum_{i=1}^N{|FFT_i|}}{|FFT_0|} + D(N) = (\sum_{i=1}^N{|FFT_i|}) / (|FFT_0|) **Parameters:** @@ -66,7 +66,7 @@ class FrameDiffFeatures(Extractor): .. math:: - D(N) = \frac{\sum_{i=1}^N{|FFT_i|}}{|FFT_0|} + D(N) = (\sum_{i=1}^N{|FFT_i|}) / (|FFT_0|) **Parameters:** @@ -146,7 +146,7 @@ class FrameDiffFeatures(Extractor): .. math:: - D(N) = \frac{\sum_{i=1}^N{|FFT_i|}}{|FFT_0|} + D(N) = (\sum_{i=1}^N{|FFT_i|}) / (|FFT_0|) .. note:: diff --git a/bob/pad/face/extractor/LBPHistogram.py b/bob/pad/face/extractor/LBPHistogram.py index ee0a583b57f225dbc89e084d941842364171ddb3..a1b15e16a5cc272599b13f9051a30ac8e3ed5547 100644 --- a/bob/pad/face/extractor/LBPHistogram.py +++ b/bob/pad/face/extractor/LBPHistogram.py @@ -7,7 +7,7 @@ import numpy class LBPHistogram(Extractor): """Calculates a normalized LBP histogram over an image. - These features are implemented based on [ChingovskaEffectivnes12]_. + These features are implemented based on [CAM12]_. Parameters ---------- diff --git a/bob/pad/face/preprocessor/VideoFaceCrop.py b/bob/pad/face/preprocessor/VideoFaceCrop.py index 3ea266c98fece64d37d3d751c5c14ad894678ef1..02a4371afec104036954e946bd02fd68ae9b44f1 100644 --- a/bob/pad/face/preprocessor/VideoFaceCrop.py +++ b/bob/pad/face/preprocessor/VideoFaceCrop.py @@ -77,7 +77,7 @@ class VideoFaceCrop(Preprocessor, object): Default: ``False``. ``kwargs`` - Remaining keyword parameters passed to the :py:class:`Base` constructor, such as ``color_channel`` or ``dtype``. + Remaining keyword parameters passed to the Base constructor, such as ``color_channel`` or ``dtype``. """ #========================================================================== diff --git a/doc/api.rst b/doc/api.rst new file mode 100644 index 0000000000000000000000000000000000000000..4d29355e650ea5fb22acf9ce2fe438ddd99b2df4 --- /dev/null +++ b/doc/api.rst @@ -0,0 +1,37 @@ +.. vim: set fileencoding=utf-8 : + +.. _bob.pad.face.api: + +============ + Python API +============ + +This section lists all the functionality available in this library allowing to run face PAD experiments. + + +Database Interfaces +------------------------------ + + +REPLAY-ATTACK Database +======================== + +.. automodule:: bob.pad.face.database.replay + + +Pre-processors +------------------------------ + +.. automodule:: bob.pad.face.preprocessor + + +Feature Extractors +------------------------------ + +.. automodule:: bob.pad.face.extractor + + +Matching Algorithms +------------------------------ + +.. automodule:: bob.pad.face.algorithm \ No newline at end of file diff --git a/doc/index.rst b/doc/index.rst index a260d13f553315f56fd1407ed957d81afaa60135..fda461eacc018b1a0541c6b1dcb084586916eee3 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -24,7 +24,7 @@ Users Guide baselines references resources - py_api + api .. todolist:: diff --git a/doc/py_api.rst b/doc/py_api.rst deleted file mode 100644 index be29aac297535990753e19e6adb5ae437289a09c..0000000000000000000000000000000000000000 --- a/doc/py_api.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. vim: set fileencoding=utf-8 : - -.. _bob.pad.face.py_api: - -=================================== - Tools implemented in bob.pad.face -=================================== - -This section listst all the functionality available in this library allowing to run face PAD experiments. - -Databases -=================================== - -Image Preprocessors -=================================== - -Video Preprocessors -=================================== - -Image Extractors -=================================== - -Video Extractors -=================================== - -Image Extractors -=================================== - -