GithubHelp home page GithubHelp logo

byhe's Introduction

BYHE: A Simple Framework for Boosting End-to-end Video-based Heart Rate Measurement Network

PyTorch implementation for BYHE.

BYHE illustration

Preparation

  1. Please install Requirements and download the VIPL-HR datasets.

    Requirements:
    python==3.7             
    torch==1.7.1+cu110       # the later version is also OK.
    torchvision==0.8.2+cu110
    numpy==1.19.5           
    pycwt==0.3.0a22
    opencv-python==4.5.4.60  
    scipy==1.7.2
    einops==0.3.2
    dlib==19.17.99
    tqdm==4.62.3
    scikit-learn==1.0.1
    matplotlib==3.3.3
    albumentations==1.2.0
    Pillow==8.3.2

    Note: It is recommended to use python 3.7, different versions will not be able to use the libraries we provide, details in ./libs.If so, contact us!

  2. Preprocess VIPL-HR datasets. "vipl-hr-infos" can be found at ./data.

    python VIPL_preprocess.py 
        --data-path /path/to/vipl-hr/ 
        --infos-path ./data/vipl-hr-infos 
        --frame-path /path/to/save/frame_list 
        --mask-path /path/to/save/mask_list 
        --wave-path /path/to/save/wave_gt 
        --face-data-path /path/to/save/face_data 
        --face-img-path /path/to/save/face_img

    Note: If you don't need to pre-process the entire datasets, try modifying the version_typeใ€person_name in VIPL_preprocess.py.

Training

Default hyperparameter settings based on single GPU card "Tesla v100" with 16 GB memory.

python train.py 
    --frame-path /path/to/frame_list 
    --mask-path /path/to/mask_list 
    --wave-path /path/to/wave_gt 
    --GPU-id 0 
    --num-workers 4 
    --batch-size 6 
    --epochs 50 
    --log-enable True 
    --log-theme VIPL

Note: Default training fold 1, try modifying the test_set in train.py.

Evaluation

Pre-trained weights can be found at ./pretrained.

Test with your own data:

python test.py 
    --frame-path /path/to/frame_list 
    --mask-path /path/to/mask_list 
    --wave-path /path/to/wave_gt 
    --GPU-id 0 
    --num-workers 4 
    --log-enable True 
    --visual-enable True 
    --pretrained ./pretrained/VIPL_f1.pth

Note: Default testing fold 1, try modifying the test_set in test.py.

For quick testing:

python test.py 
    --frame-path ./data/vipl-frame/frame_list 
    --mask-path ./data/vipl-frame/mask_list 
    --wave-path ./data/vipl-frame/wave_gt 
    --GPU-id 0 
    --num-workers 4 
    --log-enable True 
    --visual-enable False 
    --pretrained ./pretrained/VIPL_f1.pth

License

This repository is released under the MIT license as found in the LICENSE file.

byhe's People

Contributors

linxi1c avatar swy666 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.