Commit 29e03aa4 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Improve error handling in frame-diff

parent 30677812
......@@ -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)
......
......@@ -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(
......
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