diff --git a/bob/pad/face/extractor/LiFeatures.py b/bob/pad/face/extractor/LiSpectralFeatures.py similarity index 97% rename from bob/pad/face/extractor/LiFeatures.py rename to bob/pad/face/extractor/LiSpectralFeatures.py index 0e25a0b04bf3cc78ba3bb34ab58b25c7a88cec8c..294e0f359ab417c29ee6626fa199ea83b5e066e9 100644 --- a/bob/pad/face/extractor/LiFeatures.py +++ b/bob/pad/face/extractor/LiSpectralFeatures.py @@ -9,7 +9,7 @@ from bob.core.log import setup logger = setup("bob.pad.face") -class LiFeatures(Extractor, object): +class LiSpectralFeatures(Extractor, object): """Compute features from pulse signals in the three color channels. The features are described in the following article: @@ -41,7 +41,7 @@ class LiFeatures(Extractor, object): Plot stuff """ - super(LiFeatures, self).__init__() + super(LiSpectralFeatures, self).__init__() self.framerate = framerate self.nfft = nfft self.debug = debug diff --git a/bob/pad/face/extractor/__init__.py b/bob/pad/face/extractor/__init__.py index c5ccd9b4b7fb9ea6ea7776f18e882c7d8e6f8166..3a06acf23b98882174cfd32acad0d9932ed5dc8b 100644 --- a/bob/pad/face/extractor/__init__.py +++ b/bob/pad/face/extractor/__init__.py @@ -2,7 +2,7 @@ from .LBPHistogram import LBPHistogram from .ImageQualityMeasure import ImageQualityMeasure from .FrameDiffFeatures import FrameDiffFeatures -from .LiFeatures import LiFeatures +from .LiSpectralFeatures import LiSpectralFeatures from .LTSS import LTSS from .PPGSecure import PPGSecure @@ -28,7 +28,7 @@ __appropriate__( LBPHistogram, ImageQualityMeasure, FrameDiffFeatures, - LiFeatures, + LiSpectralFeatures, LTSS, PPGSecure, ) diff --git a/bob/pad/face/preprocessor/LiICPR2016.py b/bob/pad/face/preprocessor/LiPulseExtraction.py similarity index 98% rename from bob/pad/face/preprocessor/LiICPR2016.py rename to bob/pad/face/preprocessor/LiPulseExtraction.py index 3e946ea4a8747c4a0da133cde5a2a8db7840b55b..6a4a5899f57a26456e1ca05db0ac532a0162e428 100644 --- a/bob/pad/face/preprocessor/LiICPR2016.py +++ b/bob/pad/face/preprocessor/LiPulseExtraction.py @@ -17,7 +17,7 @@ from bob.rppg.cvpr14.filter_utils import detrend from bob.rppg.cvpr14.filter_utils import average -class LiICPR2016(Preprocessor): +class LiPulseExtraction(Preprocessor): """Extract pulse signal from a video sequence. The pulse is extracted according to a simplified version of Li's CVPR 14 algorithm. @@ -70,7 +70,7 @@ class LiICPR2016(Preprocessor): Plot some stuff """ - super(LiICPR2016, self).__init__(**kwargs) + super(LiPulseExtraction, self).__init__(**kwargs) self.indent = indent self.lambda_ = lambda_ self.window = window diff --git a/bob/pad/face/preprocessor/__init__.py b/bob/pad/face/preprocessor/__init__.py index 3a0943870fd2f296facfe6271eae7c3048ef83c7..4badf05c20a8e153516d99f8b3a89e5036bfc5b8 100644 --- a/bob/pad/face/preprocessor/__init__.py +++ b/bob/pad/face/preprocessor/__init__.py @@ -2,7 +2,7 @@ from .FaceCropAlign import FaceCropAlign from .FrameDifference import FrameDifference from .VideoSparseCoding import VideoSparseCoding -from .LiICPR2016 import LiICPR2016 +from .LiPulseExtraction import LiPulseExtraction from .Chrom import Chrom from .SSR import SSR from .PPGSecure import PPGSecure @@ -29,7 +29,7 @@ __appropriate__( FaceCropAlign, FrameDifference, VideoSparseCoding, - LiICPR2016, + LiPulseExtraction, Chrom, SSR, PPGSecure, diff --git a/bob/pad/face/test/test.py b/bob/pad/face/test/test.py index 07182ec4a5c05732f62b04203257667543b766a8..f7c7ce29622448a0b655c72e880e0ac7b7871d21 100644 --- a/bob/pad/face/test/test.py +++ b/bob/pad/face/test/test.py @@ -28,13 +28,13 @@ from ..extractor import LBPHistogram from ..extractor import ImageQualityMeasure -from ..preprocessor import LiICPR2016 +from ..preprocessor import LiPulseExtraction from ..preprocessor import Chrom from ..preprocessor import PPGSecure as PPGPreprocessor from ..preprocessor import SSR from ..extractor import LTSS -from ..extractor import LiFeatures +from ..extractor import LiSpectralFeatures from ..extractor import PPGSecure as PPGExtractor @@ -381,7 +381,7 @@ def convert_array_to_list_of_frame_cont(data): return frame_container_list -def test_preprocessor_LiICPR2016(): +def test_preprocessor_LiPulseExtraction(): """ Test the pulse extraction using Li's ICPR 2016 algorithm. """ @@ -389,7 +389,7 @@ def test_preprocessor_LiICPR2016(): annotations = {'topleft': (95, 155), 'bottomright': (215, 265)} video, annotations = convert_image_to_video_data(image, annotations, 100) - preprocessor = LiICPR2016(debug=False) + preprocessor = LiPulseExtraction(debug=False) pulse = preprocessor(video, annotations) assert pulse.shape == (100, 3) @@ -421,6 +421,8 @@ def test_preprocessor_PPGSecure(): def test_preprocessor_SSR(): + """ Test the pulse extraction using SSR algorithm. + """ image = load(datafile('test_image.png', 'bob.pad.face.test')) annotations = {'topleft': (95, 155), 'bottomright': (215, 265)} @@ -432,6 +434,8 @@ def test_preprocessor_SSR(): def test_extractor_LTSS(): + """ Test Long Term Spectrum Statistics (LTSS) Feature Extractor + """ # "pulse" in 3 color channels data = np.random.random((200, 3)) @@ -448,17 +452,21 @@ def test_extractor_LTSS(): assert features.shape[0] == 33*2 -def test_extractor_LiFeatures(): +def test_extractor_LiSpectralFeatures(): + """ Test Li's ICPR 2016 Spectral Feature Extractor + """ # "pulse" in 3 color channels data = np.random.random((200, 3)) - extractor = LiFeatures() + extractor = LiSpectralFeatures() features = extractor(data) assert features.shape[0] == 6 def test_extractor_PPGSecure(): + """ Test PPGSecure Spectral Feature Extractor + """ # 5 "pulses" data = np.random.random((200, 5))