ECG2HRV

---
language:
- en
pipeline_tag: feature-extraction
tags:
- biology
- electrocardiogram
---

# ECG2HRV
Pipeline for the processing of heart rate data from raw ECG signals towards HRV features. For more details see [HUBII](https://hubii.world/)

## How to use
For importing the model in your project, you can use the following code:
```python
# Imports
from huggingface_hub import hf_hub_download
import joblib

# Define parameters
REPO_ID = "hubii-world/ECG2HRV"
FILENAME = "ECG2HRV.joblib"

# Load the model
model = joblib.load(
    hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
)
```
Example usage of the model:
```python
# ecg should be a 1D numpy array with the ECG signal
hrv_features = model(input_data=ecg, frequency=100.0)
# returns hrv_features in a dictionary with the feature names as keys
```