Skip to content

Download Datasets

Introduction

The download command is used to download specified datasets. Please refer to Datasets for details on the available datasets. Additional datasets can be added by creating a new dataset class and registering it with HeartKit dataset factory, DatasetFactory.

Usage

CLI

Using the CLI, the download command can be used to download specified datasets in the configuration file or directly in the command line.

heartkit -m download -c '{"datasets": [{"name": "ptbxl", "parameters": {"path": ".datatasets/ptbxl"}}]}'

Python

In code, the download method of a dataset can be used to download the dataset.

1
2
3
4
import heartkit as hk

ds = hk.DatasetFactory.get("ptbxl")(path="./datasets/ptbxl")
ds.download()

Similarly, to download multiple datasets, the download method of a task can be used.

import heartkit as hk

task = hk.TaskFactory.get("rhythm")

params = hk.HKTaskParams(
    datasets=[hk.NamedParams(
        name="ptbxl",
        parameters={"path": "./datasets/ptbxl"}
    ), hk.NamedParams(
        name="lsad",
        parameters={"path": "./datasets/lsad"}
    )],
    force_download=False
)

task.download(params)

Arguments

Please refer to HKTaskParams for the available configuration options for the download command.