Skip to content
Snippets Groups Projects
Commit a9962f1a authored by Olegs NIKISINS's avatar Olegs NIKISINS
Browse files

Reverted quality assessment function

parent 29636955
Branches
Tags
1 merge request!32Quality check on the fly
Pipeline #
...@@ -54,8 +54,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor): ...@@ -54,8 +54,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
frame_selector=utils.FrameSelector(), frame_selector=utils.FrameSelector(),
quality_function=None, quality_function=None,
compressed_io=False, compressed_io=False,
read_original_data=None, read_original_data=None
quality_assessment_function=None
): ):
def _read_video_data(biofile, directory, extension): def _read_video_data(biofile, directory, extension):
...@@ -79,13 +78,11 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor): ...@@ -79,13 +78,11 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
preprocessor=preprocessor, preprocessor=preprocessor,
frame_selector=frame_selector, frame_selector=frame_selector,
compressed_io=compressed_io, 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.quality_function = quality_function
self.compressed_io = compressed_io self.compressed_io = compressed_io
self.quality_assessment_function = quality_assessment_function
def _check_data(self, frames): def _check_data(self, frames):
"""Checks if the given video is in the desired format.""" """Checks if the given video is in the desired format."""
...@@ -121,8 +118,6 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor): ...@@ -121,8 +118,6 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
annots = None annots = None
fc = utils.FrameContainer() fc = utils.FrameContainer()
quality_index = 0
for index, frame, _ in frames: for index, frame, _ in frames:
# if annotations are given, we take them # if annotations are given, we take them
if annotations is not None: annots = annotations[index] if index in annotations.keys() else None if annotations is not None: annots = annotations[index] if index in annotations.keys() else None
...@@ -138,14 +133,6 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor): ...@@ -138,14 +133,6 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
else: else:
quality = None quality = None
# add image to frame container # add image to frame container
if self.quality_assessment_function is not None:
if self.quality_assessment_function(quality): #quality satisfies our criteria
fc.add(quality_index, preprocessed) # no need to add quality here because we already addressed it
quality_index += 1
else:
fc.add(index, preprocessed, quality) fc.add(index, preprocessed, quality)
return fc return fc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment