diff --git a/bob/pad/face/extractor/FrameDiffFeatures.py b/bob/pad/face/extractor/FrameDiffFeatures.py index f7b2a941f20dde2985ddbfba498d117ab8a95d98..7180b73ad46e2d1340e894393297a535c36f74b3 100644 --- a/bob/pad/face/extractor/FrameDiffFeatures.py +++ b/bob/pad/face/extractor/FrameDiffFeatures.py @@ -246,7 +246,9 @@ class FrameDiffFeatures(Extractor): d_bg = self.cluster_5quantities(data[:, 1], window_size, overlap) - features = np.hstack((d_face, d_bg)) + min_len = min(len(d_face), len(d_bg)) + + features = np.hstack((d_face[:min_len], d_bg[:min_len])) frames = self.convert_arr_to_frame_cont(features) diff --git a/bob/pad/face/preprocessor/FrameDifference.py b/bob/pad/face/preprocessor/FrameDifference.py index 62c4ae9b1133ac20586f69c3469b02b7d4529de1..8519c69d53d2352d7ea959a949ae263f31a33188 100644 --- a/bob/pad/face/preprocessor/FrameDifference.py +++ b/bob/pad/face/preprocessor/FrameDifference.py @@ -225,6 +225,9 @@ class FrameDifference(Preprocessor): # annotations for particular frame frame_annotations = annotations[str(idx)] + if not frame_annotations: + continue + # Estimate bottomright and topleft if they are not available: if 'topleft' not in frame_annotations: bbx = bob.ip.facedetect.bounding_box_from_annotation(