fetch_demo

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

fetch_demo(*, data_home: str | Path | None = None, force: bool = False, verbose: bool = True, url: str | None = None, sha256: str | None = None) → Path[source]

Download the official preprocessed demo pack once and return its root.

Later calls reuse the cache (or a local demo_data/preprocessed tree in the current working directory) and do not hit the network. When verbose is true the function prints the absolute path and a layout report so users can see where the files landed and how to arrange their own data.

Parameters:
  • data_home – Cache root override (default: HABIT_DATA or ~/.habit_data).

  • force – If true, download again even when a valid cache exists.

  • verbose – If true, print the path and the layout report to stdout.

  • url – Optional download URL (tests / mirrors). Default is the official GitHub Release asset.

  • sha256 – Optional lowercase hex digest of the zip. Default is the official pack checksum.

Returns:

Absolute path of the preprocessed root (contains images/ and masks/). Pass this to cohort_from_directory().

Raises:

Examples using habit.datasets.fetch_demo

Quickstart: Python API

Quickstart: Python API

Quickstart: YAML

Quickstart: YAML