From a9962f1a1bea2e6874d62dca7a03635d3769c0bb Mon Sep 17 00:00:00 2001 From: Olegs NIKISINS <onikisins@italix03.idiap.ch> Date: Fri, 2 Mar 2018 15:22:33 +0100 Subject: [PATCH] Reverted quality assessment function --- bob/bio/video/preprocessor/Wrapper.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/bob/bio/video/preprocessor/Wrapper.py b/bob/bio/video/preprocessor/Wrapper.py index 2f267ac..d7fb6e4 100644 --- a/bob/bio/video/preprocessor/Wrapper.py +++ b/bob/bio/video/preprocessor/Wrapper.py @@ -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 -- GitLab