Skip to content

Fixed tuple indexing bug in youtube db load function

Olegs NIKISINS requested to merge dev_branch into master

There is a bug in the youtube database interface. In particular, running this simple script:

import bob.db.youtube
from bob.bio.video.database.youtube import YoutubeBioFile

youtube_directory = '/idiap/resource/database/YouTubeFaces/aligned_images_DB/'
youtube_extension = ".jpg"

youtube = bob.db.youtube.Database()

files = youtube.objects()
file_num = 0
f = files[file_num]

youtube_bio_file = YoutubeBioFile(f)
frame_container = youtube_bio_file.load(directory=youtube_directory, extension=youtube_extension)
print ( len(frame_container) )

Gives the following error (for the master branch):

Traceback (most recent call last):
  File "/idiap/user/onikisins/Projects/ODIN/Python/scripts/youtube_db/youtube_db_test_script.py", line 40, in <module>
    youtube_bio_file.load(directory=youtube_directory, extension=youtube_extension)
  File "/remote/idiap.svm/user.active/onikisins/Projects/ODIN/Python/experiment_packages/pad_using_local_conda_env_bob27/src/bob.bio.video/bob/bio/video/database/youtube.py", line 41, in load
    file_name = os.path.join(self.make_path(directory, ''), f)
  File "/idiap/user/onikisins/Python/miniconda2/envs/bob-2.7.0-py27_pad_spyder_0/lib/python2.7/posixpath.py", line 68, in join
    if b.startswith('/'):
AttributeError: 'tuple' object has no attribute 'startswith'

This merge request fixes it. The output of the above code is 20, as expected. Can someone, please, review and merge it if OK? Thanks!

Edited by Olegs NIKISINS

Merge request reports

Loading