Commit a7a8f3e9 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

[refactoring_2016] Redefinition of the low level API

parent e4b4a95c
......@@ -31,7 +31,7 @@ from bob.db.base.sqlalchemy_migration import Enum, relationship
from sqlalchemy.orm import backref
from sqlalchemy.ext.declarative import declarative_base
import bob.db.verification.utils
import bob.db.base
import os
......@@ -133,7 +133,7 @@ class Annotation(Base):
class File(Base, bob.db.verification.utils.File):
class File(Base, bob.db.base.File):
"""
Information about the files of the CUHK-CUFS database.
......@@ -155,8 +155,7 @@ class File(Base, bob.db.verification.utils.File):
def __init__(self, id, image_name, client_id, modality):
# call base class constructor
bob.db.verification.utils.File.__init__(self, file_id = id, client_id = client_id, path = image_name)
#bob.db.verification.utils.File.__init__(self, client_id = client_id, path = image_name)
bob.db.base.File.__init__(self, file_id = id, client_id = client_id, path = image_name)
self.modality = modality
def annotations(self, annotation_type="eyes_center"):
......
......@@ -25,11 +25,11 @@ from .models import PROTOCOLS, GROUPS, PURPOSES
from .driver import Interface
import bob.db.verification.utils
import bob.db.base
SQLITE_FILE = Interface().files()[0]
class Database(bob.db.verification.utils.SQLiteDatabase, bob.db.verification.utils.ZTDatabase):
class Database(bob.db.base.SQLiteDatabase):
"""Wrapper class for the CUHK-CUFS database for Heterogeneous face recognition recognition (http://mmlab.ie.cuhk_cufs.edu.hk/archive/facesketch.html).
......@@ -37,8 +37,9 @@ class Database(bob.db.verification.utils.SQLiteDatabase, bob.db.verification.uti
def __init__(self, original_directory = None, original_extension = None, arface_directory="", xm2vts_directory=""):
# call base class constructors to open a session to the database
bob.db.verification.utils.SQLiteDatabase.__init__(self, SQLITE_FILE, File)
bob.db.verification.utils.ZTDatabase.__init__(self, original_directory=original_directory, original_extension=original_extension)
super(Database, self).__init__(SQLITE_FILE, File)
self.original_directory = original_directory
self.original_extension = original_extension
self.arface_directory = arface_directory
self.xm2vts_directory = xm2vts_directory
......@@ -92,7 +93,7 @@ class Database(bob.db.verification.utils.SQLiteDatabase, bob.db.verification.uti
def annotations(self, file, annotation_type="eyes_center"):
"""This function returns the annotations for the given file id as a dictionary.
Keyword parameters:
file : :py:class:`bob.db.verification.utils.File` or one of its derivatives
file : :py:class:`bob.db.base.File` or one of its derivatives
The File object you want to retrieve the annotations for,
Return value:
A dictionary of annotations, for face images usually something like {'leye':(le_y,le_x), 'reye':(re_y,re_x), ...},
......
......@@ -9,6 +9,9 @@ extensions = bob.buildout
mr.developer
auto-checkout = *
develop = src/bob.buildout
src/bob.blitz
src/bob.core
src/bob.io.base
src/bob.db.arface
src/bob.db.xm2vts
.
......@@ -20,6 +23,9 @@ newest = false
[sources]
bob.buildout = git https://gitlab.idiap.ch/bob/bob.buildout
bob.blitz = git https://gitlab.idiap.ch/bob/bob.blitz
bob.core = git https://gitlab.idiap.ch/bob/bob.core
bob.io.base = git https://gitlab.idiap.ch/bob/bob.io.base
bob.db.arface = git https://gitlab.idiap.ch/bob/bob.db.arface
bob.db.xm2vts = git https://gitlab.idiap.ch/bob/bob.db.xm2vts
......
......@@ -13,7 +13,7 @@ The actual raw data for the database should be downloaded from the original URL.
The Database Interface
----------------------
The :py:class:`bob.db.cuhk_cufs.Database` complies with the standard biometric verification database as described in :ref:`commons`, implementing both interfaces :py:class:`bob.db.verification.utils.SQLiteDatabase` and :py:class:`bob.db.verification.utils.ZTDatabase`.
The :py:class:`bob.db.cuhk_cufs.Database` complies with the standard biometric verification database as described in :ref:`commons`, implementing both interfaces :py:class:`bob.db.base.SQLiteDatabase`.
CUHK CUFS Protocols
......
......@@ -49,12 +49,7 @@ setup(
'bob.db',
],
entry_points = {
# declare database to bob
'bob.db': [
'cuhk_cufs = bob.db.cuhk_cufs.driver:Interface',
],
entry_points = {
# scripts should be declared using this entry:
'console_scripts' : [
'evaluate_cufs.py = bob.db.cuhk_cufs.scripts.evaluate_cufs:main',
......
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