Skip to content
GitLab
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
ae32f073
Commit
ae32f073
authored
Mar 01, 2018
by
Olegs Nikisins
Browse files
Added quality_assessment_function to preprocessor Wrapper
parent
e9660045
Pipeline
#17302
failed with stage
in 12 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/video/preprocessor/Wrapper.py
View file @
ae32f073
...
...
@@ -54,7 +54,8 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
frame_selector
=
utils
.
FrameSelector
(),
quality_function
=
None
,
compressed_io
=
False
,
read_original_data
=
None
read_original_data
=
None
,
quality_assessment_function
=
None
):
def
_read_video_data
(
biofile
,
directory
,
extension
):
...
...
@@ -78,11 +79,13 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
preprocessor
=
preprocessor
,
frame_selector
=
frame_selector
,
compressed_io
=
compressed_io
,
read_original_data
=
read_original_data
read_original_data
=
read_original_data
,
quality_assessment_function
=
quality_assessment_function
)
self
.
quality_function
=
quality_function
self
.
compressed_io
=
compressed_io
sels
.
quality_assessment_function
=
quality_assessment_function
def
_check_data
(
self
,
frames
):
"""Checks if the given video is in the desired format."""
...
...
@@ -133,7 +136,14 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
else
:
quality
=
None
# add image to frame container
fc
.
add
(
index
,
preprocessed
,
quality
)
if
self
.
quality_assessment_function
is
not
None
:
if
self
.
quality_assessment_function
(
quality
):
#quality satisfies our criteria
fc
.
add
(
index
,
preprocessed
,
quality
)
else
:
fc
.
add
(
index
,
preprocessed
,
quality
)
return
fc
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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