Installation¶
Install from PyPI¶
Or with uv:
Development Install¶
Clone the repository and install with development dependencies:
Or, without uv:
This installs the package in editable mode along with testing and linting tools (pytest, ruff).
Building Documentation Locally¶
To build and preview the documentation site:
This starts a local server at http://127.0.0.1:8000 with live-reloading.
Where Data Is Stored¶
Datasets are downloaded on first use into ~/.deepecgkit/datasets, one folder per dataset.
deepecg list-datasets shows each dataset's download size and whether a local copy exists.
To keep them elsewhere — a scratch disk, a shared project folder on a cluster — set
DEEPECGKIT_HOME:
Datasets then live in $DEEPECGKIT_HOME/datasets and cached weights in
$DEEPECGKIT_HOME/weights. A single dataset can also be pointed at a specific folder with
--data-dir (CLI) or data_dir= (Python).
Downloads are fetched from PhysioNet's open-data mirror, fall back to physionet.org when the mirror cannot be reached, and resume from where they stopped if interrupted.
Hardware¶
DeepECG-Kit automatically detects available hardware:
| Device | Detection |
|---|---|
| CUDA GPU | Used automatically if torch.cuda.is_available() |
| Apple MPS | Used automatically if torch.backends.mps.is_available() |
| CPU | Fallback when no GPU is available. On Apple Silicon, PyTorch's NNPACK backend is switched off for CPU runs, where it makes convolutions many times slower |
You can override device selection with --accelerator cpu|gpu|mps (CLI) or device="cpu" (Python API).
Requirements¶
- Python >= 3.10
- PyTorch >= 2.1.0
- See pyproject.toml for the full dependency list