[refactoring_2016] Redefinition low level API

parent 13a489c4
Pipeline #3235 passed with stages
in 20 minutes and 37 seconds
......@@ -26,7 +26,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
......@@ -52,7 +52,7 @@ class Client(Base):
return "<Client('%d')>" % self.id
class Directory(Base, bob.db.verification.utils.File):
class Directory(Base, bob.db.base.File):
"""Information about the directories of the Youtube Faces database."""
__tablename__ = 'directory'
......@@ -71,7 +71,7 @@ class Directory(Base, bob.db.verification.utils.File):
def __init__(self, file_id, client_id, path):
# call base class constructor
shot_id = int(os.path.basename(path))
bob.db.verification.utils.File.__init__(self, file_id = file_id, client_id = client_id, path = path)
bob.db.base.File.__init__(self, file_id = file_id, client_id = client_id, path = path)
self.shot_id = shot_id
......
......@@ -28,11 +28,11 @@ from sqlalchemy.orm import aliased
from .driver import Interface
import glob
import bob.db.verification.utils
import bob.db.base
SQLITE_FILE = Interface().files()[0]
class Database(bob.db.verification.utils.SQLiteDatabase):
class Database(bob.db.base.SQLiteDatabase):
"""The dataset class opens and maintains a connection opened to the Database.
It provides many different ways to probe for the characteristics of the data
......@@ -52,7 +52,10 @@ class Database(bob.db.verification.utils.SQLiteDatabase):
The filename extension of the annotation files; rarely changed
"""
# call base class constructor
bob.db.verification.utils.SQLiteDatabase.__init__(self, SQLITE_FILE, Directory, original_directory=original_directory, original_extension=original_extension)
super(Database, self).__init__(SQLITE_FILE, Directory)
self.original_directory = original_directory
self.original_extension = original_extension
self.m_valid_protocols = ('fold1', 'fold2', 'fold3', 'fold4', 'fold5', 'fold6', 'fold7', 'fold8', 'fold9', 'fold10')
self.m_valid_groups = ('world', 'dev', 'eval')
......@@ -563,7 +566,15 @@ class Database(bob.db.verification.utils.SQLiteDatabase):
"""
# get original filename expression for the directory
file_name_filter = bob.db.verification.utils.SQLiteDatabase.original_file_name(self, directory, check_existence = False)
#file_name_filter = bob.db.base.Database.original_file_name(self, directory, check_existence = False)
# check if directory is set
if not self.original_directory or not self.original_extension:
raise ValueError("The original_directory and/or the original_extension were not specified in the constructor.")
# extract file name
file_name_list = directory.make_path(self.original_directory, self.original_extension)
if not check_existence or os.path.exists(file_name):
return file_name_list
# list the data
import glob
......
......@@ -14,7 +14,6 @@ develop = src/bob.extension
src/bob.io.base
src/bob.io.matlab
src/bob.db.base
src/bob.db.verification.utils
.
; options for bob.buildout extension
......@@ -29,7 +28,6 @@ bob.core = git https://gitlab.idiap.ch/bob/bob.core
bob.io.base = git https://gitlab.idiap.ch/bob/bob.io.base
bob.io.matlab = git https://gitlab.idiap.ch/bob/bob.io.matlab
bob.db.base = git https://gitlab.idiap.ch/bob/bob.db.base
bob.db.verification.utils = git https://gitlab.idiap.ch/bob/bob.db.verification.utils
[scripts]
recipe = bob.buildout:scripts
......
......@@ -10,7 +10,7 @@
YOUR_DATABASE_DIRECTORY = '/idiap/resource/database/YouTubeFaces/frame_images_DB'
==============
User's Guide
User's Guide
==============
This package contains the access API and descriptions for the `YouTube Faces`_ 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