Coder Social home page Coder Social logo

yarppg's Introduction

Yet another rPPG

* This is a work in progress! *

yarppg is yet another implementation of remote photoplethysmography in Python. Remote photoplethysmography (rPPG) refers to the camera-based measurement of a (blood volume) pulse signal. It works by detecting small changes in skin color, originating from the pulsation of blood [1].

Some other open-source implementations of rPPG:

The current default implementation uses the bandpass-filtered green channel averaged across a custom ROI suggested by Li et al. [2] Other features of their algorithm are a work in progress.

docs/images/yarppg-screenshot.png

Installation and usage

In order to run this rPPG implementation, you first have to clone the repository and make sure all requirements are installed. Afterwards you can run the yarppg subfolder as a python package using the -m flag:

git clone https://github.com/SamProell/yarppg.git
cd yarppg
pip install -r requirements.txt
python -m yarppg  # from yarppg top-level directory

Alternatively, install the package using pip (from the top-level directory). After installing, you can simply call the provided entry point run-yarppg.

pip install -e .
run-yarppg

Command line options

There are a number of options available, when running yarppg:

Option Default Description
--detector facemesh ROI (face) detector - choices: {facemesh,caffe-dnn,haar,full}
--processor LiCvpr Processor translating ROI to pulse signal. LiCvpr currently only returns mean green value - choices: {LiCvpr,Pos,Chrom}
--winsize 32 Window sized used in some processors (in frames)
--bandpass 0.5,2 bandpass frequencies for processor output
--blobsize 150 quadratic blob size of DNN Face Detector
--draw-facemark False draw landmarks when using facemesh detector
--blur -1 pixelation size of detected ROI
--video 0 video input device number
--savepath '' store generated signals as data frame to disk

Camera setup

For rPPG to work as intended it might be required to tweak the camera settings. For example auto white-balancing and auto-exposure could be disabled, to avoid small adjustments in RGB values. One possibility to change the camera settings is via the ffmpeg commandline tool. See the discussion here: https://superuser.com/questions/1287366/open-webcam-settings-dialog-in-windows/1511657


[1]W Verkruysse, L O Svaasand and J S Nelson. Remote plethysmographic imaging using ambient light. Optics Express. 2008;16(26):21434โ€“21445. doi:10.1364/oe.16.021434
[2]Li, X., Chen, J., Zhao, G., & Pietikainen, M. (2014). Remote Heart Rate Measurement From Face Videos Under Realistic Situations. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 4264-4271.

yarppg's People

Contributors

samproell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.