Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.video
Commits
501faca4
Commit
501faca4
authored
Nov 09, 2017
by
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
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
MANIFEST.in
View file @
501faca4
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
bob/bio/video/database/youtube.py
View file @
501faca4
...
...
@@ -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
:
...
...
bob/bio/video/test/data/Aaron_Eckhart/0/image_1.jpg
0 → 100644
View file @
501faca4
32.1 KB
bob/bio/video/test/data/Aaron_Eckhart/0/image_2.jpg
0 → 100644
View file @
501faca4
32.1 KB
bob/bio/video/test/test_databases.py
View file @
501faca4
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment