Commit 6059a383 authored by André Anjos's avatar André Anjos 💬
Browse files

Fix documentation errors

parent b3ffa161
Pipeline #6100 passed with stages
in 5 minutes and 7 seconds
......@@ -5,7 +5,7 @@
"""
from .query import Database
from .reader import get_templates
from .reader import File, Template, get_templates, read_annotations
def get_config():
......@@ -30,7 +30,10 @@ def __appropriate__(*args):
__appropriate__(
Database,
File,
Template,
get_templates,
read_annotations,
)
__all__ = [_ for _ in dir() if not _.startswith('_')]
......@@ -6,6 +6,7 @@
import os
import sys
import pkg_resources
from bob.db.base.driver import Interface as BaseInterface
......@@ -81,7 +82,6 @@ class Interface(BaseInterface):
def version(self):
import pkg_resources # part of setuptools
return pkg_resources.require('bob.db.%s' % self.name())[0].version
......
data/IJB-A_11_sets/.dircksum
data/IJB-A_11_sets/split1/.dircksum
data/IJB-A_11_sets/split1/train_1.csv
data/IJB-A_11_sets/split1/verify_comparisons_1.csv
data/IJB-A_11_sets/split1/verify_metadata_1.csv
data/IJB-A_11_sets/split10/.dircksum
data/IJB-A_11_sets/split10/train_10.csv
data/IJB-A_11_sets/split10/verify_comparisons_10.csv
data/IJB-A_11_sets/split10/verify_metadata_10.csv
data/IJB-A_11_sets/split2/.dircksum
data/IJB-A_11_sets/split2/train_2.csv
data/IJB-A_11_sets/split2/verify_comparisons_2.csv
data/IJB-A_11_sets/split2/verify_metadata_2.csv
data/IJB-A_11_sets/split3/.dircksum
data/IJB-A_11_sets/split3/train_3.csv
data/IJB-A_11_sets/split3/verify_comparisons_3.csv
data/IJB-A_11_sets/split3/verify_metadata_3.csv
data/IJB-A_11_sets/split4/.dircksum
data/IJB-A_11_sets/split4/train_4.csv
data/IJB-A_11_sets/split4/verify_comparisons_4.csv
data/IJB-A_11_sets/split4/verify_metadata_4.csv
data/IJB-A_11_sets/split5/.dircksum
data/IJB-A_11_sets/split5/train_5.csv
data/IJB-A_11_sets/split5/verify_comparisons_5.csv
data/IJB-A_11_sets/split5/verify_metadata_5.csv
data/IJB-A_11_sets/split6/.dircksum
data/IJB-A_11_sets/split6/train_6.csv
data/IJB-A_11_sets/split6/verify_comparisons_6.csv
data/IJB-A_11_sets/split6/verify_metadata_6.csv
data/IJB-A_11_sets/split7/.dircksum
data/IJB-A_11_sets/split7/train_7.csv
data/IJB-A_11_sets/split7/verify_comparisons_7.csv
data/IJB-A_11_sets/split7/verify_metadata_7.csv
data/IJB-A_11_sets/split8/.dircksum
data/IJB-A_11_sets/split8/train_8.csv
data/IJB-A_11_sets/split8/verify_comparisons_8.csv
data/IJB-A_11_sets/split8/verify_metadata_8.csv
data/IJB-A_11_sets/split9/.dircksum
data/IJB-A_11_sets/split9/train_9.csv
data/IJB-A_11_sets/split9/verify_comparisons_9.csv
data/IJB-A_11_sets/split9/verify_metadata_9.csv
data/IJB-A_1N_sets/.dircksum
data/IJB-A_1N_sets/split1/.dircksum
data/IJB-A_1N_sets/split1/search_gallery_1.csv
data/IJB-A_1N_sets/split1/search_probe_1.csv
data/IJB-A_1N_sets/split1/train_1.csv
data/IJB-A_1N_sets/split10/.dircksum
data/IJB-A_1N_sets/split10/search_gallery_10.csv
data/IJB-A_1N_sets/split10/search_probe_10.csv
data/IJB-A_1N_sets/split10/train_10.csv
data/IJB-A_1N_sets/split2/.dircksum
data/IJB-A_1N_sets/split2/search_gallery_2.csv
data/IJB-A_1N_sets/split2/search_probe_2.csv
data/IJB-A_1N_sets/split2/train_2.csv
data/IJB-A_1N_sets/split3/.dircksum
data/IJB-A_1N_sets/split3/search_gallery_3.csv
data/IJB-A_1N_sets/split3/search_probe_3.csv
data/IJB-A_1N_sets/split3/train_3.csv
data/IJB-A_1N_sets/split4/.dircksum
data/IJB-A_1N_sets/split4/search_gallery_4.csv
data/IJB-A_1N_sets/split4/search_probe_4.csv
data/IJB-A_1N_sets/split4/train_4.csv
data/IJB-A_1N_sets/split5/.dircksum
data/IJB-A_1N_sets/split5/search_gallery_5.csv
data/IJB-A_1N_sets/split5/search_probe_5.csv
data/IJB-A_1N_sets/split5/train_5.csv
data/IJB-A_1N_sets/split6/.dircksum
data/IJB-A_1N_sets/split6/search_gallery_6.csv
data/IJB-A_1N_sets/split6/search_probe_6.csv
data/IJB-A_1N_sets/split6/train_6.csv
data/IJB-A_1N_sets/split7/.dircksum
data/IJB-A_1N_sets/split7/search_gallery_7.csv
data/IJB-A_1N_sets/split7/search_probe_7.csv
data/IJB-A_1N_sets/split7/train_7.csv
data/IJB-A_1N_sets/split8/.dircksum
data/IJB-A_1N_sets/split8/search_gallery_8.csv
data/IJB-A_1N_sets/split8/search_probe_8.csv
data/IJB-A_1N_sets/split8/train_8.csv
data/IJB-A_1N_sets/split9/.dircksum
data/IJB-A_1N_sets/split9/search_gallery_9.csv
data/IJB-A_1N_sets/split9/search_probe_9.csv
data/IJB-A_1N_sets/split9/train_9.csv
......@@ -33,7 +33,8 @@ class Database(bob.db.base.Database):
self.templates = {} #Dictionary with the templates in a unique list
if(annotations_directory is None):#Get the default location
annotations_directory = bob.db.ijba.driver.Interface().files()[0]
import pkg_resources
annotations_directory = pkg_resources.resource_filename(__name__, 'data')
self.annotations_directory = annotations_directory
......@@ -395,8 +396,10 @@ class Database(bob.db.base.Database):
def annotations(self, file):
"""Returns the annotations for the given :py:class:`File` object as a dictionary, see :py:class:`Annotation` for details."""
# return annotations as obtained from the __call__ command of the Annotation class
"""Returns the annotations for the given :py:class:`File` object as a
dictionary, see :py:func:`read_annotations` for details.
"""
return file.annotations
......
......@@ -47,17 +47,30 @@ class File(bob.db.base.File):
class Template():
"""A ``Template`` contains a list of :py:class:`File` objects belonging to the same subject (there might be several templates per subject).
class Template:
"""A ``Template`` contains a list of :py:class:`File` objects belonging to
the same subject (there might be several templates per subject).
These are listed in the ``self.files`` field.
A ``Template`` can serve for training, model enrollment, or for probing.
Each template belongs specifically to a certain protocol, as the template_id in the original file lists might differ for different protocols.
The according :py:class:`ProtocolPurpose` can be obtained using the ``self.protocol_purpose`` after creation of the database.
Note that the ``template_id`` corresponds to the template_id of the file lists, while the ``id`` is only used as a un
ique key for querying the database.
For convenience, the template also contains a ``path``, which is a concatenation of the first :py:attr:`File.media_id
` of the first file, and the ``self.template_id``, making it unique (at least per protocol).
Each template belongs specifically to a certain protocol, as the template_id
in the original file lists might differ for different protocols.
The protocol purpose can be obtained using ``self.protocol_purpose`` after
creation of the database.
Note that the ``template_id`` corresponds to the template_id of the file
lists, while the ``id`` is only used as a unique key for querying the
database.
For convenience, the template also contains a ``path``, which is a
concatenation of the ``File.media_id`` of the first file, and the
``self.template_id``, making it unique (at least per protocol).
"""
def __init__(self, template_id, subject_id, files):
self.id = template_id
self.client_id = subject_id
......
......@@ -69,6 +69,3 @@ def test03_comparison_objects():
enroll_files = [4260, 4765, 3995, 4458, 4216, 3875, 4137, 4556, 3922, 4260]
for i in range(10):
assert len(db.objects(groups='dev', purposes='enroll', protocol=COMPARISON_PROTOCOLS[i])) == enroll_files[i]
python
numpy
bob.bio.base
py:class bob.db.base.file.File
py:class bob.db.base.database.SQLiteDatabase
py:class bob.db.base.database.Database
py:class sqlalchemy.ext.declarative.api.Base
py:class File
py:class Annotation
py:class Template
py:class bob.db.ijba.Template
py:exc ValueError
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