diff --git a/bob/pad/face/preprocessor/LiPulseExtraction.py b/bob/pad/face/preprocessor/LiPulseExtraction.py index 6a4a5899f57a26456e1ca05db0ac532a0162e428..3f7f2eec26c3ea9725adefcb747c7750f1944408 100644 --- a/bob/pad/face/preprocessor/LiPulseExtraction.py +++ b/bob/pad/face/preprocessor/LiPulseExtraction.py @@ -134,7 +134,7 @@ class LiPulseExtraction(Preprocessor): ldms = previous_ldms # so do nothing ... logger.warning("No mask detected in frame {}".format(i)) - face_color[i] = 0 + face_color[i] = [0, 0, 0] continue frame = frame_rotated @@ -144,6 +144,7 @@ class LiPulseExtraction(Preprocessor): logger.warning("Frame {}: no landmarks detected, using the ones from previous frame".format(i)) if self.debug: + if False: from matplotlib import pyplot display = numpy.copy(frame) for p in ldms: @@ -152,10 +153,12 @@ class LiPulseExtraction(Preprocessor): pyplot.show() ldms = numpy.array(ldms) - mask_points, mask = kp66_to_mask(frame, ldms, self.indent, self.debug) + #mask_points, mask = kp66_to_mask(frame, ldms, self.indent, self.debug) + mask_points, mask = kp66_to_mask(frame, ldms, self.indent, False) - #XXX : be sure that the 3 colors are returned !! - face_color[i] = compute_average_colors_mask(frame, mask, self.debug) + #face_color[i] = compute_average_colors_mask(frame, mask, self.debug) + face_color[i] = compute_average_colors_mask(frame, mask, False) + logger.debug("Face color in frame {} = {}".format(i, face_color[i]) previous_ldms = ldms counter += 1 diff --git a/bob/pad/face/preprocessor/PPGSecure.py b/bob/pad/face/preprocessor/PPGSecure.py index 33a944bd192c11fae2ac2c25cabe31f4ec01f526..36b201d1554368f9911a27f96776d88a067015b0 100644 --- a/bob/pad/face/preprocessor/PPGSecure.py +++ b/bob/pad/face/preprocessor/PPGSecure.py @@ -130,7 +130,7 @@ class PPGSecure(Preprocessor): # get the mask and the green value in the different ROIs masks = self._get_masks(frame, ldms) for k in range(5): - green_mean[i, k] = compute_average_colors_mask(frame, masks[k], self.debug) + green_mean[i, k] = compute_average_colors_mask(frame, masks[k], self.debug)[1] previous_ldms = ldms