Commit d41de6b0 authored by Manuel Günther's avatar Manuel Günther

Added script to test video extensions on AT&T

parent d66176e9
......@@ -47,7 +47,7 @@ class Extractor (bob.bio.base.extractor.Extractor):
if self.compressed_io:
return utils.save_compressed(frame_container, filename, self.extractor.write_feature)
else:
frame_container.save(bob.io.base.HDF5File(filename, 'w'), self.extractor.save_feature)
frame_container.save(bob.io.base.HDF5File(filename, 'w'), self.extractor.write_feature)
def train(self, data_list, extractor_file):
......
import bob.db.atnt
import os
from bob.bio.base.database import DatabaseBob, DatabaseBobZT
from bob.bio.base.test.utils import atnt_database_directory
class DummyDatabase (DatabaseBobZT):
def __init__(self):
# call base class constructor with useful parameters
DatabaseBobZT.__init__(
self,
database = bob.db.atnt.Database(
original_directory = atnt_database_directory()
),
name = 'test',
check_original_files_for_existence = True,
training_depends_on_protocol = False,
models_depend_on_protocol = False
)
def all_files(self, groups = ['dev']):
return DatabaseBob.all_files(self, groups)
def t_model_ids(self, group = 'dev'):
return self.model_ids(group)
def t_enroll_files(self, model_id, group = 'dev'):
return self.enroll_files(model_id, group)
def z_probe_files(self, group = 'dev'):
return self.probe_files(None, group)
# override the original file names to return a one-element lists of file names
def original_file_names(self, files):
return [[n] for n in self.database.original_file_names(files, self.check_existence)]
database = DummyDatabase()
from __future__ import print_function
import bob.bio.base
import tempfile
from bob.bio.base.test.test_scripts import _verify
def test_verify_video():
test_dir = tempfile.mkdtemp(prefix='bobtest_')
# define dummy parameters
parameters = [
'-d', 'dummy-video',
'-p', 'bob.bio.video.preprocessor.Preprocessor("dummy")',
'-e', 'bob.bio.video.extractor.Extractor("dummy")',
'-a', 'bob.bio.video.algorithm.Algorithm("dummy")',
'--zt-norm',
'-s', 'test_video',
'--temp-directory', test_dir,
'--result-directory', test_dir,
'--imports', 'bob.bio.video'
]
print (bob.bio.base.tools.command_line(parameters))
_verify(parameters, test_dir, 'test_video')
......@@ -104,6 +104,7 @@ setup(
'bob.bio.database': [
'mobio-video = bob.bio.video.config.database.mobio:database',
'youtube = bob.bio.video.config.database.youtube:database',
'dummy-video = bob.bio.video.test.dummy.database:database', # for test purposes only
],
},
......
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