From c4c17163abcaf57fef978856376edfc766450e89 Mon Sep 17 00:00:00 2001 From: Olegs NIKISINS <onikisins@italix03.idiap.ch> Date: Tue, 16 May 2017 09:30:07 +0200 Subject: [PATCH] Fixed the write/read functions in the VideoFaceCrop preprocessor --- bob/pad/face/preprocessor/VideoFaceCrop.py | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/bob/pad/face/preprocessor/VideoFaceCrop.py b/bob/pad/face/preprocessor/VideoFaceCrop.py index 0c7aa5ef..421b6dde 100644 --- a/bob/pad/face/preprocessor/VideoFaceCrop.py +++ b/bob/pad/face/preprocessor/VideoFaceCrop.py @@ -88,13 +88,16 @@ class VideoFaceCrop(Preprocessor, object): for (k, v) in kwargs.items(): setattr(self, k, v) - self.preprocessor = FaceCrop(cropped_image_size = cropped_image_size, - cropped_positions = cropped_positions, - fixed_positions = fixed_positions, - mask_sigma = mask_sigma, - mask_neighbors = mask_neighbors, - mask_seed = mask_seed, - **kwargs) + preprocessor = FaceCrop(cropped_image_size = cropped_image_size, + cropped_positions = cropped_positions, + fixed_positions = fixed_positions, + mask_sigma = mask_sigma, + mask_neighbors = mask_neighbors, + mask_seed = mask_seed, + **kwargs) + + self.video_preprocessor = bob.bio.video.preprocessor.Wrapper(preprocessor) + #========================================================================== def __call__(self, frames, annotations): @@ -119,12 +122,11 @@ class VideoFaceCrop(Preprocessor, object): Cropped faces stored in the FrameContainer. """ - video_preprocessor = bob.bio.video.preprocessor.Wrapper(self.preprocessor) - - preprocessed_video = video_preprocessor(frames = frames, annotations = annotations) + preprocessed_video = self.video_preprocessor(frames = frames, annotations = annotations) return preprocessed_video + #========================================================================== def write_data( self, frames, file_name ): """ @@ -140,7 +142,8 @@ class VideoFaceCrop(Preprocessor, object): name of the file. """ - bob.bio.video.preprocessor.Wrapper.write_data(frames, file_name) + self.video_preprocessor.write_data(frames, file_name) + #========================================================================== def read_data( self, file_name ): @@ -159,7 +162,7 @@ class VideoFaceCrop(Preprocessor, object): Frames stored in the frame container. """ - frames = bob.bio.video.preprocessor.Wrapper.read_data(file_name) + frames = self.video_preprocessor.read_data(file_name) return frames -- GitLab