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 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])
return fc
......@@ -24,6 +24,9 @@ import
from import db_available
from import check_database_zt
from import _check_annotations
import pkg_resources
from import YoutubeBioFile
import os
......@@ -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 ='youtube', 'database', preferred_package='')
f = database.all_files()[0]
youtube_bio_file = YoutubeBioFile(f)
test_file = pkg_resources.resource_filename('', '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