Skip to content
Snippets Groups Projects
Commit a59bf0c7 authored by Guillaume HEUSCH's avatar Guillaume HEUSCH
Browse files

[extractor] added sanity check on the input for FrequencySpectrum features

parent bdd6bf10
No related branches found
No related tags found
1 merge request!53WIP: rPPG as features for PAD
...@@ -54,6 +54,14 @@ class FrequencySpectrum(Extractor, object): ...@@ -54,6 +54,14 @@ class FrequencySpectrum(Extractor, object):
freq: numpy.array freq: numpy.array
the frequency spectrum the frequency spectrum
""" """
# sanity check
if signal.ndim == 1:
if numpy.isnan(numpy.sum(signal)):
return
if signal.ndim == 2 and (signal.shape[1] == 3):
if numpy.isnan(numpy.sum(signal[:, 1])):
return
output_dim = int((self.nfft / 2) + 1) output_dim = int((self.nfft / 2) + 1)
# we have a single pulse signal # we have a single pulse signal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment