Skip to content
Snippets Groups Projects
Commit 29e03aa4 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Improve error handling in frame-diff

parent 30677812
No related branches found
No related tags found
1 merge request!68Improve load_utils.py
...@@ -246,7 +246,9 @@ class FrameDiffFeatures(Extractor): ...@@ -246,7 +246,9 @@ class FrameDiffFeatures(Extractor):
d_bg = self.cluster_5quantities(data[:, 1], window_size, overlap) 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) frames = self.convert_arr_to_frame_cont(features)
......
...@@ -225,6 +225,9 @@ class FrameDifference(Preprocessor): ...@@ -225,6 +225,9 @@ class FrameDifference(Preprocessor):
# annotations for particular frame # annotations for particular frame
frame_annotations = annotations[str(idx)] frame_annotations = annotations[str(idx)]
if not frame_annotations:
continue
# Estimate bottomright and topleft if they are not available: # Estimate bottomright and topleft if they are not available:
if 'topleft' not in frame_annotations: if 'topleft' not in frame_annotations:
bbx = bob.ip.facedetect.bounding_box_from_annotation( bbx = bob.ip.facedetect.bounding_box_from_annotation(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment