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

Merge branch 'dev_branch' into 'master'

Fixed tuple indexing bug in youtube db load function

See merge request !22
parents 2acbfd5a c49d1e1d
Pipeline #13930 passed with stages
in 9 minutes and 21 seconds
include README.rst bootstrap-buildout.py buildout.cfg develop.cfg COPYING version.txt requirements.txt test-requirements.txt
recursive-include doc *.py *.rst
recursive-include bob/bio/video/test/data *.hdf5 *.avi
recursive-include bob/bio/video/test/data *.hdf5 *.avi *.jpg
......@@ -38,7 +38,7 @@ class YoutubeBioFile(VideoBioFile):
fc = FrameContainer()
files = self.files(directory, extension)
for f in frame_selector(files):
file_name = os.path.join(self.make_path(directory, ''), f)
file_name = os.path.join(self.make_path(directory, ''), f[0])
fc.add(os.path.basename(file_name), bob.io.base.load(file_name))
return fc
else:
......
......@@ -24,6 +24,9 @@ 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
from ..database.youtube import YoutubeBioFile
import os
@db_available('youtube')
......@@ -49,3 +52,25 @@ def test_mobio():
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)
def test_youtube_load_method():
"""
Test the load method of the YoutubeBioFile class.
"""
database = bob.bio.base.load_resource('youtube', 'database', preferred_package='bob.bio.video')
f = database.all_files()[0]
youtube_bio_file = YoutubeBioFile(f)
test_file = pkg_resources.resource_filename('bob.bio.video', 'test/data/Aaron_Eckhart/0/image_1.jpg')
directory = os.path.split(test_file)[0]
directory = os.path.join(directory, os.pardir, os.pardir)
frame_container = youtube_bio_file.load(directory=directory, extension=".jpg")
assert (len(frame_container)==2)
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