Commit 5c5ce25e authored by Olegs NIKISINS's avatar Olegs NIKISINS
Browse files

Added python API to the doc, fixed sphinx wornings

parent a45be389
Pipeline #10661 passed with stages
in 9 minutes and 25 seconds
......@@ -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
#!/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>
"""
#==============================================================================
......
......@@ -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::
......
......@@ -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
----------
......
......@@ -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``.
"""
#==========================================================================
......
.. 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
......@@ -24,7 +24,7 @@ Users Guide
baselines
references
resources
py_api
api
.. todolist::
......
.. 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
===================================
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