Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get bpm from a random video #75

Open
RA-DM opened this issue Mar 30, 2023 · 1 comment
Open

Get bpm from a random video #75

RA-DM opened this issue Mar 30, 2023 · 1 comment

Comments

@RA-DM
Copy link

RA-DM commented Mar 30, 2023

It seems that the code in #13 can't work now, is there any other way to get bpm from a random video?
Does the run_on_video function in readme.md take effect in a random video?

from pyVHR.signals.video import Video
Traceback (most recent call last):
File "<stdin>", line 1, in
ModuleNotFoundError: No module named 'pyVHR.signals'

@wang-tf
Copy link

wang-tf commented Apr 7, 2023

You can using pipeline like pyVHR_run_on_video.ipynb

#### TEST holistic approach
from pyVHR.analysis.pipeline import Pipeline

# params
videoFileName = "video.avi"  # your video path
roi_approach = 'holistic'   # 'holistic' or 'patches'
bpm_est = 'median'         # BPM final estimate, if patches choose 'medians' or 'clustering'
method = 'cpu_CHROM'       # one of the methods implemented in pyVHR
pipe = Pipeline()          # object to execute the pipeline

# run
bvps, timesES, bpmES = pipe.run_on_video(videoFileName,
                                        winsize=8, 
                                        roi_method='convexhull',
                                        roi_approach=roi_approach,
                                        method=method,
                                        estimate=bpm_est,
                                        patch_size=40, 
                                        RGB_LOW_HIGH_TH=(5,230),
                                        Skin_LOW_HIGH_TH=(5,230),
                                        pre_filt=True,
                                        post_filt=True,
                                        cuda=False, 
                                        verb=True
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants