Commit a9962f1a authored by Olegs NIKISINS's avatar Olegs NIKISINS

Reverted quality assessment function

parent 29636955
Pipeline #17325 passed with stage
in 16 minutes and 23 seconds
......@@ -54,8 +54,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
frame_selector=utils.FrameSelector(),
quality_function=None,
compressed_io=False,
read_original_data=None,
quality_assessment_function=None
read_original_data=None
):
def _read_video_data(biofile, directory, extension):
......@@ -79,13 +78,11 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
preprocessor=preprocessor,
frame_selector=frame_selector,
compressed_io=compressed_io,
read_original_data=read_original_data,
quality_assessment_function=quality_assessment_function
read_original_data=read_original_data
)
self.quality_function = quality_function
self.compressed_io = compressed_io
self.quality_assessment_function = quality_assessment_function
def _check_data(self, frames):
"""Checks if the given video is in the desired format."""
......@@ -121,8 +118,6 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
annots = None
fc = utils.FrameContainer()
quality_index = 0
for index, frame, _ in frames:
# if annotations are given, we take them
if annotations is not None: annots = annotations[index] if index in annotations.keys() else None
......@@ -138,15 +133,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
else:
quality = None
# 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
......@@ -190,4 +177,4 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
if self.compressed_io:
return utils.save_compressed(frames, filename, self.preprocessor.write_data)
else:
frames.save(bob.io.base.HDF5File(filename, 'w'), self.preprocessor.write_data)
frames.save(bob.io.base.HDF5File(filename, 'w'), self.preprocessor.write_data)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment