Ported Youtube face database to the new interface

parent 3c6303a1
from bob.bio.base.pipelines.vanilla_biometrics.legacy import DatabaseConnector
from bob.bio.video.database import YoutubeBioDatabase
from bob.bio.video.database import YoutubeDatabase
database = YoutubeDatabase(protocol="fold0")
database = DatabaseConnector(
all_files_options={"subworld": "fivefolds"},
extractor_training_options={"subworld": "fivefolds"},
projector_training_options={"subworld": "fivefolds"},
enroller_training_options={"subworld": "fivefolds"},
from .youtube import YoutubeDatabase
from .database import VideoBioFile
from .youtube import YoutubeBioDatabase
# gets sphinx autodoc done right - don't remove it
......@@ -18,8 +18,5 @@ def __appropriate__(*args):
obj.__module__ = __name__
__all__ = [_ for _ in dir() if not _.startswith('_')]
__appropriate__(YoutubeDatabase, VideoBioFile)
__all__ = [_ for _ in dir() if not _.startswith("_")]
This diff is collapsed.
from nose.plugins.skip import SkipTest
import bob.bio.base
from bob.bio.base.test.utils import db_available
from bob.bio.base.test.test_database_implementations import check_database_zt
from bob.bio.face.test.test_databases import _check_annotations
import pkg_resources
def test_youtube():
database = bob.bio.base.load_resource(
"youtube", "database", preferred_package="bob.bio.video"
check_database_zt(database, training_depends=True, models_depend=True)
except IOError as e:
raise SkipTest(
"The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'"
% e
if database.database.original_directory is None:
raise SkipTest("The annotations cannot be queried as original_directory is None")
_check_annotations(database, limit_files=1000, topleft=True, framed=True)
except IOError as e:
raise SkipTest(
"The annotations could not be queried; probably the annotation files are missing. Here is the error: '%s'"
% e
def test_new_youtube():
from bob.bio.video.database import YoutubeDatabase
for protocol in [f"fold{i}" for i in range(10)]:
def test_youtube_load_method():
database = bob.bio.base.load_resource(
"youtube", "database", preferred_package="bob.bio.video"
database.database.original_directory = pkg_resources.resource_filename(
"bob.bio.video", "test/data"
youtube_db_sample = [
for sample_set in database.references(group="dev")
for sample in sample_set
if sample.key == "Aaron_Eckhart/0"
database = YoutubeDatabase("fold0")
references = database.references()
probes = database.probes()
frame_container = youtube_db_sample.data
assert len(references) == 500
assert len(probes) == 500
assert len(frame_container) == 2
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment