Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.video
Commits
e5f90639
Commit
e5f90639
authored
Feb 22, 2017
by
Manuel Günther
Browse files
Implemented proper load function of YoutubeBioFile
parent
4f7b5f04
Pipeline
#7465
passed with stages
in 37 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/video/database/youtube.py
View file @
e5f90639
...
...
@@ -12,7 +12,7 @@
from
.database
import
VideoBioFile
from
bob.bio.base.database
import
ZTBioDatabase
from
bob.bio.video.utils
import
FrameContainer
from
bob.bio.video.utils
import
FrameContainer
,
FrameSelector
import
os
import
bob.io.base
...
...
@@ -23,12 +23,13 @@ class YoutubeBioFile(VideoBioFile):
super
(
YoutubeBioFile
,
self
).
__init__
(
client_id
=
f
.
client_id
,
path
=
f
.
path
,
file_id
=
f
.
id
)
self
.
_f
=
f
def
load
(
self
,
directory
=
None
,
extension
=
'.jpg'
):
def
load
(
self
,
directory
=
None
,
extension
=
'.jpg'
,
frame_selector
=
FrameSelector
()
):
if
extension
in
(
None
,
'.jpg'
,
'/*.jpg'
):
files
=
sorted
(
os
.
listdir
(
self
.
make_path
(
directory
,
''
)))
base_dir
=
self
.
make_path
(
directory
,
''
)
files
=
[
os
.
path
.
join
(
base_dir
,
f
)
for
f
in
sorted
(
os
.
listdir
(
base_dir
))]
fc
=
FrameContainer
()
for
f
in
files
:
for
f
in
frame_selector
(
files
)
:
if
extension
==
os
.
path
.
splitext
(
f
)[
1
]:
file_name
=
os
.
path
.
join
(
self
.
make_path
(
directory
,
''
),
f
)
fc
.
add
(
os
.
path
.
basename
(
file_name
),
bob
.
io
.
base
.
load
(
file_name
))
...
...
Write
Preview
Supports
Markdown
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