Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ The framework contains the implementation of many common methods for remote-PPG
|PCA | Lewandowska, M., Rumiński, J., Kocejko, T., & Nowak, J. (2011, September). Measuring pulse rate with a webcam—a non-contact method for evaluating cardiac activity. In 2011 federated conference on computer science and information systems (FedCSIS) (pp. 405-410). IEEE.|
|POS | Wang, W., den Brinker, A. C., Stuijk, S., & de Haan, G. (2016). Algorithmic principles of remote PPG. IEEE Transactions on Biomedical Engineering, 64(7), 1479-1491.|
|SSR | Wang, W., Stuijk, S., & De Haan, G. (2015). A novel algorithm for remote photoplethysmography: Spatial subspace rotation. IEEE transactions on biomedical engineering, 63(9), 1974-1984.|
|OMIT | Álvarez Casado, C., Bordallo López, M. (2022). Face2PPG: An unsupervised pipeline for blood volume pulse extraction from faces. arXiv (eprint 2202.04101).|
|OMIT | Álvarez Casado, C., & Bordallo López, M. (2023). Face2PPG: An unsupervised pipeline for blood volume pulse extraction from faces. IEEE Journal of Biomedical and Health Informatics, doi: 10.1109/JBHI.2023.3307942.|
|MTTS-CAN | Liu, X., Fromm, J., Patel, S., & McDuff, D. (2020). Multi-task temporal shift attention networks for on-device contactless vitals measurement. Advances in Neural Information Processing Systems, 33, 19400-19411.|
|HR-CNN | Spetlik, R., Franc, V., Cech, J. and Matas, J. (2018). Visual Heart Rate Estimation with Convolutional Neural Network. In Proceedings of British Machine Vision Conference|

Expand All @@ -157,17 +157,17 @@ Currently supported datasets are:

| Dataset name | Link |
| ------------ | ---------------------------------------------------------------------- |
| COHFACE | https://www.idiap.ch/dataset/cohface |
| LGI-PPGI | https://github.com/partofthestars/LGI-PPGI-DB |
| MAHNOB-HCI | https://mahnob-db.eu/hci-tagging/ |
| PURE | https://www.tu-ilmenau.de/neurob/data-sets-code/pulse-rate-detection-dataset-pure|
| UBFC1 | https://sites.google.com/view/ybenezeth/ubfcrppg|
|UBFC2 | https://sites.google.com/view/ybenezeth/ubfcrppg|
|UBFC-Phys | https://sites.google.com/view/ybenezeth/ubfc-phys|
|ECG-Fitness | https://cmp.felk.cvut.cz/~spetlrad/ecg-fitness/*
|Vicar-PPG-2 | https://docs.google.com/forms/d/e/1FAIpQLScwnW_D5M4JVovPzpxA0Bf1ZCTaG5vh7sYu48I0MVSpgltvdw/viewform*
|V4V | https://vision4vitals.github.io/ |
|VIPL-HR |https://arxiv.org/abs/1810.04927 |
| COHFACE | https://www.idiap.ch/dataset/cohface |
| LGI-PPGI | https://github.com/partofthestars/LGI-PPGI-DB |
| MAHNOB-HCI | https://mahnob-db.eu/hci-tagging/ |
| PURE | https://www.tu-ilmenau.de/neurob/data-sets-code/pulse-rate-detection-dataset-pure|
| UBFC1 | https://sites.google.com/view/ybenezeth/ubfcrppg|
| UBFC2 | https://sites.google.com/view/ybenezeth/ubfcrppg|
| UBFC-Phys | https://sites.google.com/view/ybenezeth/ubfc-phys|
| ECG-Fitness | https://cmp.felk.cvut.cz/~spetlrad/ecg-fitness/*
| Vicar-PPG-2 | https://docs.google.com/forms/d/e/1FAIpQLScwnW_D5M4JVovPzpxA0Bf1ZCTaG5vh7sYu48I0MVSpgltvdw/viewform*
| V4V | https://vision4vitals.github.io/ |
| VIPL-HR |https://arxiv.org/abs/1810.04927 |



Expand Down
2 changes: 1 addition & 1 deletion pyVHR/datasets/cohface.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class COHFACE(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 40 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 20 # vieo frame rate
frameRate = 20 # video frame rate
VIDEO_SUBSTRING = 'data' # substring contained in the filename
SIG_EXT = 'hdf5' # extension of the BVP files
SIG_SUBSTRING = 'data' # substring contained in the filename
Expand Down
4 changes: 2 additions & 2 deletions pyVHR/datasets/ecg_fitness.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class ECG_FITNESS(Dataset):
frameRate = 20 # video frame rate
VIDEO_SUBSTRING = '' # substring contained in the filename
SIG_EXT = 'csv' # extension of the ECG files
SIG_SUBSTRING = 'viatom' # substring contained in the filename
SIG_SampleRate = 120 # sample rate of the ECG files
SIG_SUBSTRING = 'viatom' # substring contained in the filename
SIG_SampleRate = 120 # sample rate of the ECG files

def readSigfile(self, filename):
""" Load ECG signal.
Expand Down
2 changes: 1 addition & 1 deletion pyVHR/datasets/lgi_ppgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class LGI_PPGI(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 4 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 25 # vieo frame rate
frameRate = 25 # video frame rate
VIDEO_SUBSTRING = 'cv_camera' # substring contained in the filename
SIG_EXT = 'xml' # extension of the BVP files
SIG_SUBSTRING = 'cms50' # substring contained in the filename
Expand Down
18 changes: 9 additions & 9 deletions pyVHR/datasets/mahnob.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

"""


class MAHNOB(Dataset):
"""
Mahnob Dataset
Expand All @@ -27,15 +28,15 @@ class MAHNOB(Dataset):
.. |...
"""
name = 'MAHNOB'
signalGT = 'ECG' # GT signal type
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 40 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 20 # video frame rate
signalGT = 'ECG' # GT signal type
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 40 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 61 # video frame rate
VIDEO_SUBSTRING = 'Section' # substring contained in the filename
SIG_EXT = 'bdf' # extension of the ECG files
SIG_SUBSTRING = 'emotion' # substring contained in the filename
SIG_SampleRate = 256 # sample rate of the ECG files
SIG_EXT = 'bdf' # extension of the ECG files
SIG_SUBSTRING = 'emotion' # substring contained in the filename
SIG_SampleRate = 256 # sample rate of the ECG files

def readSigfile(self, filename):
""" Load ECG signal.
Expand All @@ -49,4 +50,3 @@ def readSigfile(self, filename):
self.SIG_SampleRate = bdfRec.sampRate[33]
data = np.array(rec['data'][0])[rec['eventTable']['idx'][2]:]
return ECGsignal(data, self.SIG_SampleRate)

39 changes: 20 additions & 19 deletions pyVHR/datasets/pure.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
import cv2


class PURE(Dataset):
"""
PURE Dataset
Expand All @@ -30,15 +31,15 @@ class PURE(Dataset):
.. |...
"""
name = 'PURE'
signalGT = 'BVP' # GT signal type
numLevels = 1 # depth of the filesystem collecting video and BVP files
numSubjects = 10 # number of subjects
video_EXT = 'avi' # extension of the video files ### IMPORTANT NOTE: pure datasets consists of a sequence of png files, we converted them in a video avi files
frameRate = 30.0 # vieo frame rate
signalGT = 'BVP' # GT signal type
numLevels = 1 # depth of the filesystem collecting video and BVP files
numSubjects = 10 # number of subjects
video_EXT = 'avi' # extension of the video files ### IMPORTANT NOTE: pure datasets consists of a sequence of png files, we converted them in a video avi files
frameRate = 30.0 # video frame rate
VIDEO_SUBSTRING = '-' # substring contained in the filename
SIG_EXT = 'json' # extension of the BVP files
SIG_SUBSTRING = '-' # substring contained in the filename
SIG_SampleRate = 60 # sample rate of the BVP files
SIG_EXT = 'json' # extension of the BVP files
SIG_SUBSTRING = '-' # substring contained in the filename
SIG_SampleRate = 60 # sample rate of the BVP files
skinThresh = [40, 60] # thresholds for skin detection

def readSigfile(self, filename):
Expand All @@ -65,23 +66,23 @@ def loadFilenames(self):
"""

if self.name not in self.videodataDIR:
if self.videodataDIR[-1]=='/':
if self.videodataDIR[-1] == '/':
self.videodataDIR += self.name
else:
self.videodataDIR = self.videodataDIR + '/' + self.name

print(self.videodataDIR)
#check if video files exist or create them from images
# check if video files exist or create them from images
for root, dirs, files in os.walk(self.videodataDIR):
for d in dirs:
dirname = os.path.join(root, d)
if not glob.glob(dirname +'/*.avi'):
#create videofile from images
if not glob.glob(dirname + '/*.avi'):
# create videofile from images
frames = self.__loadFrames(dirname)
fps = self.frameRate
width = frames[0].shape[1]
height = frames[0].shape[0]
#fourcc = cv2.VideoWriter_fourcc(*'MPNG')
# fourcc = cv2.VideoWriter_fourcc(*'MPNG')
writer = cv2.VideoWriter(dirname + '/' + d + '.avi', 0, fps, (width, height))
for frame in frames:
writer.write(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
Expand All @@ -101,12 +102,12 @@ def loadFilenames(self):
# -- number of videos
self.numVideos = len(self.videoFilenames)

def __sort_nicely(self, l):
def __sort_nicely(self, l):
""" Sort the given list in the way that humans expect.
"""
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
l.sort( key=alphanum_key )
"""
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]
l.sort(key=alphanum_key)
return l

def __loadFrames(self, directorypath):
Expand All @@ -116,6 +117,6 @@ def __loadFrames(self, directorypath):
for n in range(len(f_names)):
filename = os.path.join(directorypath, f_names[n])
frames.append(cv2.imread(filename)[:, :, ::-1])

frames = np.array(frames)
return frames
2 changes: 1 addition & 1 deletion pyVHR/datasets/ubfc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UBFC1(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 8 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 30 # vieo frame rate
frameRate = 30 # video frame rate
VIDEO_SUBSTRING = '' # substring contained in the filename
SIG_EXT = 'xmp' # extension of the BVP files
SIG_SUBSTRING = '' # substring contained in the filename
Expand Down
2 changes: 1 addition & 1 deletion pyVHR/datasets/ubfc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UBFC2(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 26 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 30 # vieo frame rate
frameRate = 30 # video frame rate
VIDEO_SUBSTRING = 'vid' # substring contained in the filename
SIG_EXT = 'txt' # extension of the BVP files
SIG_SUBSTRING = '' # substring contained in the filename
Expand Down
2 changes: 1 addition & 1 deletion pyVHR/datasets/ubfc_phys.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UBFC_PHYS(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 56 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 35 # vieo frame rate
frameRate = 35 # video frame rate
VIDEO_SUBSTRING = '' # substring contained in the filename
SIG_EXT = 'csv' # extension of the BVP files
SIG_SUBSTRING = 'bvp' # substring contained in the filename
Expand Down
2 changes: 1 addition & 1 deletion pyVHR/datasets/v4v.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class V4V(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 56 # number of subjects
video_EXT = 'mkv' # extension of the video files
frameRate = 25 # vieo frame rate
frameRate = 25 # video frame rate
VIDEO_SUBSTRING = '' # substring contained in the filename
SIG_EXT = 'txt' # extension of the BVP files
SIG_SUBSTRING = 'BP' # substring contained in the filename
Expand Down
2 changes: 1 addition & 1 deletion pyVHR/datasets/vicar_ppg.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class VICAR_PPG(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 40 # number of subjects
video_EXT = 'mp4' # extension of the video files
frameRate = 60 # vieo frame rate
frameRate = 60 # video frame rate
VIDEO_SUBSTRING = '' # substring contained in the filename
SIG_EXT = 'csv' # extension of the BVP files
SIG_SUBSTRING = '' # substring contained in the filename
Expand Down
2 changes: 1 addition & 1 deletion pyVHR/datasets/vipl_hr_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class VIPL_HR_V1(Dataset):
numLevels = 2 # depth of the filesystem collecting video and BVP files
numSubjects = 107 # number of subjects
video_EXT = 'avi' # extension of the video files
frameRate = 30 # vieo frame rate
frameRate = 30 # video frame rate
VIDEO_SUBSTRING = 'video' # substring contained in the filename
SIG_EXT = 'csv' # extension of the BVP files
SIG_SUBSTRING = 'wave' # substring contained in the filename
Expand Down