Commit 1e98aa17 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Fix issue bob.db.base#16

parent 4b9f2304
Pipeline #9203 passed with stages
in 27 minutes and 7 seconds
......@@ -29,11 +29,13 @@ dummy_data = {'train_real': 1.0, 'train_attack': 2.0,
class TestFile(PadFile):
def __init__(self, path, id):
attack_type = None
if "attack" in path:
attack_type = "attack"
PadFile.__init__(self, client_id=1, path=path, file_id=id, attack_type=attack_type)
PadFile.__init__(self, client_id=1, path=path,
file_id=id, attack_type=attack_type)
def load(self, directory=None, extension='.hdf5'):
"""Loads the data at the specified location and using the given extension.
......@@ -57,6 +59,7 @@ class TestFile(PadFile):
path = self.make_path(directory or '', extension or '')
return dummy_data[os.path.basename(path)]
def dumplist(args):
"""Dumps lists of files based on your criteria"""
......@@ -76,6 +79,7 @@ def dumplist(args):
class Interface(BaseInterface):
def name(self):
return dummy_name
......@@ -96,11 +100,11 @@ class Interface(BaseInterface):
dumpparser = subparsers.add_parser('dumplist', help="")
dumpparser.add_argument('-d', '--directory', dest="directory", default='',
help="if given, this path will be prepended to every entry returned (defaults to '%(default)s')")
help="if given, this path will be prepended to every entry returned (defaults to '%(default)s')")
dumpparser.add_argument('-e', '--extension', dest="extension", default='',
help="if given, this extension will be appended to every entry returned (defaults to '%(default)s')")
help="if given, this extension will be appended to every entry returned (defaults to '%(default)s')")
dumpparser.add_argument('--self-test', dest="selftest", default=False,
action='store_true', help=SUPPRESS)
action='store_true', help=SUPPRESS)
dumpparser.set_defaults(func=dumplist) # action
......@@ -110,9 +114,9 @@ class TestDatabase(PadDatabase):
def __init__(self, protocol='Default', original_directory=data_dir, original_extension='', **kwargs):
# call base class constructors to open a session to the database
PadDatabase.__init__(self, name='testspoof', protocol=protocol,
original_directory=original_directory,
original_extension=original_extension, **kwargs)
super(TestDatabase, self).__init__(name='testspoof', protocol=protocol,
original_directory=original_directory,
original_extension=original_extension, **kwargs)
################################################
# Low level support methods for the database #
......@@ -168,6 +172,7 @@ class TestDatabase(PadDatabase):
# does not implement the given access protocol
return False
def get_all_data(self):
return self.all_files()
......
......@@ -45,10 +45,10 @@ def create_database():
del engine
class TestDatabaseSql (bob.pad.base.database.PadDatabase, bob.db.base.SQLiteDatabase):
class TestDatabaseSql (bob.pad.base.database.PadDatabase, bob.db.base.SQLiteBaseDatabase):
def __init__(self):
bob.pad.base.database.PadDatabase.__init__(self, 'pad_test', original_directory="original/directory", original_extension=".orig")
bob.db.base.SQLiteDatabase.__init__(self, dbfile, TestFileSql)
bob.db.base.SQLiteBaseDatabase.__init__(self, dbfile, TestFileSql)
def groups(self, protocol=None):
return ['group']
......@@ -59,4 +59,4 @@ class TestDatabaseSql (bob.pad.base.database.PadDatabase, bob.db.base.SQLiteData
def annotations(self, file):
return None
database = TestDatabaseSql()
\ No newline at end of file
database = TestDatabaseSql()
......@@ -4,18 +4,103 @@
[buildout]
parts = scripts
eggs = bob.pad.base
bob.extension
gridtk
eggs = bob.db.base
bob.db.iris
bob.db.wine
bob.db.mnist
bob.db.atnt
bob.db.arface
bob.db.asvspoof
bob.db.asvspoof2017
bob.db.atvskeystroke
bob.db.avspoof
bob.db.banca
bob.db.biosecure
bob.db.biosecurid.face
bob.db.casme2
bob.db.caspeal
bob.db.cohface
bob.db.frgc
bob.db.gbu
bob.db.hci_tagging
bob.db.ijba
bob.db.kboc16
bob.db.lfw
bob.db.livdet2013
bob.db.mobio
bob.db.msu_mfsd_mod
bob.db.multipie
bob.db.nist_sre12
bob.db.putvein
bob.db.replay
bob.db.replaymobile
bob.db.scface
bob.db.utfvp
bob.db.verafinger
bob.db.voicepa
bob.db.xm2vts
bob.db.youtube
bob.db.pericrosseye
bob.db.cuhk_cufs
bob.bio.base
bob.bio.gmm
bob.bio.face
bob.bio.spear
bob.bio.video
bob.bio.vein
bob.db.voxforge
bob.pad.base
extensions = bob.buildout
mr.developer
auto-checkout = *
develop = src/bob.db.base
src/bob.db.iris
src/bob.db.wine
src/bob.db.mnist
src/bob.db.atnt
src/bob.db.arface
src/bob.db.asvspoof
src/bob.db.asvspoof2017
src/bob.db.atvskeystroke
src/bob.db.avspoof
src/bob.db.banca
src/bob.db.biosecure
src/bob.db.biosecurid.face
src/bob.db.casme2
src/bob.db.caspeal
src/bob.db.cohface
src/bob.db.frgc
src/bob.db.gbu
src/bob.db.hci_tagging
src/bob.db.ijba
src/bob.db.kboc16
src/bob.db.lfw
src/bob.db.livdet2013
src/bob.db.mobio
src/bob.db.msu_mfsd_mod
src/bob.db.multipie
src/bob.db.nist_sre12
src/bob.db.putvein
src/bob.db.replay
src/bob.db.replaymobile
src/bob.db.scface
src/bob.db.utfvp
src/bob.db.verafinger
src/bob.db.voicepa
src/bob.db.xm2vts
src/bob.db.youtube
src/bob.db.pericrosseye
src/bob.db.cuhk_cufs
src/bob.bio.base
src/bob.extension
src/bob.bio.gmm
src/bob.bio.face
src/bob.bio.spear
src/bob.bio.video
src/bob.bio.vein
src/bob.db.voxforge
.
; options for bob.buildout
debug = true
verbose = true
......@@ -23,8 +108,50 @@ newest = false
[sources]
bob.db.base = git git@gitlab.idiap.ch:bob/bob.db.base.git
bob.db.iris = git git@gitlab.idiap.ch:bob/bob.db.iris.git
bob.db.wine = git git@gitlab.idiap.ch:bob/bob.db.wine.git
bob.db.mnist = git git@gitlab.idiap.ch:bob/bob.db.mnist.git
bob.db.atnt = git git@gitlab.idiap.ch:bob/bob.db.atnt.git
bob.db.arface = git git@gitlab.idiap.ch:bob/bob.db.arface.git
bob.db.asvspoof = git git@gitlab.idiap.ch:bob/bob.db.asvspoof.git
bob.db.asvspoof2017 = git git@gitlab.idiap.ch:bob/bob.db.asvspoof2017.git
bob.db.atvskeystroke = git git@gitlab.idiap.ch:bob/bob.db.atvskeystroke.git
bob.db.avspoof = git git@gitlab.idiap.ch:bob/bob.db.avspoof.git
bob.db.banca = git git@gitlab.idiap.ch:bob/bob.db.banca.git
bob.db.biosecure = git git@gitlab.idiap.ch:bob/bob.db.biosecure.git
bob.db.biosecurid.face = git git@gitlab.idiap.ch:bob/bob.db.biosecurid.face.git
bob.db.casme2 = git git@gitlab.idiap.ch:bob/bob.db.casme2.git
bob.db.caspeal = git git@gitlab.idiap.ch:bob/bob.db.caspeal.git
bob.db.cohface = git git@gitlab.idiap.ch:bob/bob.db.cohface.git
bob.db.frgc = git git@gitlab.idiap.ch:bob/bob.db.frgc.git
bob.db.gbu = git git@gitlab.idiap.ch:bob/bob.db.gbu.git
bob.db.hci_tagging = git git@gitlab.idiap.ch:bob/bob.db.hci_tagging.git
bob.db.ijba = git git@gitlab.idiap.ch:bob/bob.db.ijba.git
bob.db.kboc16 = git git@gitlab.idiap.ch:bob/bob.db.kboc16.git
bob.db.lfw = git git@gitlab.idiap.ch:bob/bob.db.lfw.git
bob.db.livdet2013 = git git@gitlab.idiap.ch:bob/bob.db.livdet2013.git
bob.db.mobio = git git@gitlab.idiap.ch:bob/bob.db.mobio.git
bob.db.msu_mfsd_mod = git git@gitlab.idiap.ch:bob/bob.db.msu_mfsd_mod.git
bob.db.multipie = git git@gitlab.idiap.ch:bob/bob.db.multipie.git
bob.db.nist_sre12 = git git@gitlab.idiap.ch:bob/bob.db.nist_sre12.git
bob.db.putvein = git git@gitlab.idiap.ch:bob/bob.db.putvein.git
bob.db.replay = git git@gitlab.idiap.ch:bob/bob.db.replay.git
bob.db.replaymobile = git git@gitlab.idiap.ch:bob/bob.db.replaymobile.git
bob.db.scface = git git@gitlab.idiap.ch:bob/bob.db.scface.git
bob.db.utfvp = git git@gitlab.idiap.ch:bob/bob.db.utfvp.git
bob.db.verafinger = git git@gitlab.idiap.ch:bob/bob.db.verafinger.git
bob.db.voicepa = git git@gitlab.idiap.ch:bob/bob.db.voicepa.git
bob.db.xm2vts = git git@gitlab.idiap.ch:bob/bob.db.xm2vts.git
bob.db.youtube = git git@gitlab.idiap.ch:bob/bob.db.youtube.git
bob.db.pericrosseye = git git@gitlab.idiap.ch:bob/bob.db.pericrosseye.git
bob.db.cuhk_cufs = git git@gitlab.idiap.ch:bob/bob.db.cuhk_cufs.git
bob.bio.base = git git@gitlab.idiap.ch:bob/bob.bio.base.git
bob.extension = git git@gitlab.idiap.ch:bob/bob.extension.git
bob.bio.gmm = git git@gitlab.idiap.ch:bob/bob.bio.gmm.git
bob.bio.face = git git@gitlab.idiap.ch:bob/bob.bio.face.git
bob.bio.spear = git git@gitlab.idiap.ch:bob/bob.bio.spear.git
bob.bio.video = git git@gitlab.idiap.ch:bob/bob.bio.video.git
bob.bio.vein = git git@gitlab.idiap.ch:bob/bob.bio.vein.git
bob.db.voxforge = git git@gitlab.idiap.ch:bob/bob.db.voxforge.git
[scripts]
recipe = bob.buildout:scripts
......
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