# Ecgmentations
![Python version support](https://img.shields.io/pypi/pyversions/ecgmentations)
[![PyPI version](https://badge.fury.io/py/ecgmentations.svg)](https://badge.fury.io/py/ecgmentations)
[![Downloads](https://pepy.tech/badge/ecgmentations/month)](https://pepy.tech/project/ecgmentations?versions=0.0.*)
Ecgmentations is a Python library for ecg augmentation. Ecg augmentation is used in deep learning to increase the quality of trained models. The purpose of ecg augmentation is to create new training samples from the existing data.
Here is an example of how you can apply some augmentations from Ecgmentations to create new ecgs from the original one:
![preview](https://raw.githubusercontent.com/rostepifanov/ecgmentations/main/images/preview.png)
## Table of contents
- [Authors](#authors)
- [Installation](#installation)
- [A simple example](#a-simple-example)
- [List of augmentations](#list-of-augmentations)
- [Citing](#citing)
## Authors
[**Rostislav Epifanov** — Researcher in Novosibirsk]()
## Installation
Installation from PyPI:
```
pip install ecgmentations
```
Installation from GitHub:
```
pip install git+https://github.com/rostepifanov/ecgmentations
```
## A simple example
```python
import numpy as np
import ecgmentations as E
# Declare an augmentation pipeline
transform = E.Sequential([
E.TimeReverse(p=0.5),
E.ChannelShuffle(p=0.06),
])
# Create example ecg (length, nchannels)
ecg = np.ones((12, 5000)).T
# Augment an ecg
transformed = transform(ecg=ecg)
transformed_ecg = transformed['ecg']
```
## List of augmentations
The list of time axis transforms:
- [TimeReverse]()
- [TimeShift]()
- [TimeSegmentShuffle]()
- [RandomTimeWrap]()
- [TimeCutout]()
- [Blur]()
- [Pooling]()
- [TimeCrop]()
- [CenterTimeCrop]()
- [RandomTimeCrop]()
- [TimePadIfNeeded]()
The list of pulse transforms:
- [SinePulse]()
- [SquarePulse]()
- [PowerlineNoise]()
- [RespirationNoise]()
The list of other transforms:
- [AmplitudeInvert]()
- [ChannelShuffle]()
- [ChannelDropout]()
- [GaussNoise]()
- [GaussBlur]()
- [AmplitudeScale]()
## Citing
If you find this library useful for your research, please consider citing:
```
@misc{epifanov2023ecgmentations,
Author = {Rostislav Epifanov},
Title = {Ecgmentations},
Year = {2023},
Publisher = {GitHub},
Journal = {GitHub repository},
Howpublished = {\url{https://github.com/rostepifanov/ecgmentations}}
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/rostepifanov/ecgmentations",
"name": "ecgmentations",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Rostislav Epifanov",
"author_email": "rostepifanov@gmail.com",
"download_url": null,
"platform": null,
"description": "# Ecgmentations\n\n![Python version support](https://img.shields.io/pypi/pyversions/ecgmentations)\n[![PyPI version](https://badge.fury.io/py/ecgmentations.svg)](https://badge.fury.io/py/ecgmentations)\n[![Downloads](https://pepy.tech/badge/ecgmentations/month)](https://pepy.tech/project/ecgmentations?versions=0.0.*)\n\nEcgmentations is a Python library for ecg augmentation. Ecg augmentation is used in deep learning to increase the quality of trained models. The purpose of ecg augmentation is to create new training samples from the existing data.\n\nHere is an example of how you can apply some augmentations from Ecgmentations to create new ecgs from the original one:\n\n![preview](https://raw.githubusercontent.com/rostepifanov/ecgmentations/main/images/preview.png)\n\n## Table of contents\n- [Authors](#authors)\n- [Installation](#installation)\n- [A simple example](#a-simple-example)\n- [List of augmentations](#list-of-augmentations)\n- [Citing](#citing)\n\n## Authors\n[**Rostislav Epifanov** \u2014 Researcher in Novosibirsk]()\n\n## Installation\nInstallation from PyPI:\n\n```\npip install ecgmentations\n```\n\nInstallation from GitHub:\n\n```\npip install git+https://github.com/rostepifanov/ecgmentations\n```\n\n## A simple example\n```python\nimport numpy as np\nimport ecgmentations as E\n\n# Declare an augmentation pipeline\ntransform = E.Sequential([\n E.TimeReverse(p=0.5),\n E.ChannelShuffle(p=0.06),\n])\n\n# Create example ecg (length, nchannels)\necg = np.ones((12, 5000)).T\n\n# Augment an ecg\ntransformed = transform(ecg=ecg)\ntransformed_ecg = transformed['ecg']\n```\n\n## List of augmentations\n\nThe list of time axis transforms:\n\n- [TimeReverse]()\n- [TimeShift]()\n- [TimeSegmentShuffle]()\n- [RandomTimeWrap]()\n- [TimeCutout]()\n- [Blur]()\n- [Pooling]()\n- [TimeCrop]()\n- [CenterTimeCrop]()\n- [RandomTimeCrop]()\n- [TimePadIfNeeded]()\n\nThe list of pulse transforms:\n\n- [SinePulse]()\n- [SquarePulse]()\n- [PowerlineNoise]()\n- [RespirationNoise]()\n\nThe list of other transforms:\n\n- [AmplitudeInvert]()\n- [ChannelShuffle]()\n- [ChannelDropout]()\n- [GaussNoise]()\n- [GaussBlur]()\n- [AmplitudeScale]()\n\n\n## Citing\n\nIf you find this library useful for your research, please consider citing:\n\n```\n@misc{epifanov2023ecgmentations,\n Author = {Rostislav Epifanov},\n Title = {Ecgmentations},\n Year = {2023},\n Publisher = {GitHub},\n Journal = {GitHub repository},\n Howpublished = {\\url{https://github.com/rostepifanov/ecgmentations}}\n}\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Ecg augmentation library and easy to use wrapper around other libraries",
"version": "0.0.8",
"project_urls": {
"Homepage": "https://github.com/rostepifanov/ecgmentations"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c6d547443d412744994c23f2715bbac14d57fa50b7e6b56080e2d1b1fa9f1bdb",
"md5": "2615dc6810fcd654825c07f22381f2bc",
"sha256": "6a8caed3af9fc89b79fb751dde94ce46277a761ac3da470517c0bbee60a97271"
},
"downloads": -1,
"filename": "ecgmentations-0.0.8-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2615dc6810fcd654825c07f22381f2bc",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 27549,
"upload_time": "2024-05-17T13:27:07",
"upload_time_iso_8601": "2024-05-17T13:27:07.831953Z",
"url": "https://files.pythonhosted.org/packages/c6/d5/47443d412744994c23f2715bbac14d57fa50b7e6b56080e2d1b1fa9f1bdb/ecgmentations-0.0.8-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-17 13:27:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rostepifanov",
"github_project": "ecgmentations",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ecgmentations"
}