API Reference

import envodat as ed

All functions are available at the top level of this package. Heavy dependencies are imported lazily, so import envodat stays fast and only the feature you use needs its extra (see Installation).

Initialization

envodat.init(root_path)[source]

Sets the local folder where EnvoDat data is stored and read.

Parameters:

root_path – Data folder, created if missing. ENVODAT_ROOT sets the default.

Returns:

The resolved folder path.

envodat.root()[source]

Return the current data root (see init()).

Scene Catalog

envodat.catalog.SCENES

{scene_id: {name, title, environment, sequences, description}}.

Type:

Scene catalog

envodat.scene_ids(environment=None)[source]

Return the catalog scene ids.

envodat.info(scene)[source]

Catalog entry of a scene (name, environment, sequences, description).

Download

envodat.list_scenes(format='yolo', revision=None, repo_id=None)[source]

Lists the scenes published on the Hugging Face Hub.

Parameters:
  • format – Annotation format (default "yolo").

  • revision – Branch, tag or commit.

  • repo_id – Dataset repository; defaults to Linpen/EnvoDat.

Returns:

Sorted scene ids, e.g. ["leo-for", "mu-hall", ...].

envodat.download(scene=None, format='yolo', revision=None, config=None, repo_id=None, force=False)[source]

Downloads annotated scenes from the Hugging Face Hub into the data root.

Each scene is a single zip, unpacked into <root>/yolo/<scene>/ with a data.yaml that uses absolute paths. Complete scenes are skipped; incomplete ones are downloaded again.

Parameters:
  • scene – Scene id ("mu-hall"), list of ids, or "all".

  • format – Annotation format (default "yolo").

  • revision – Branch, tag or commit to pin.

  • config – YAML file with root, scenes, format and revision; replaces the other arguments.

  • repo_id – Dataset repository; defaults to Linpen/EnvoDat.

  • force – Downloads and unpacks again even if the scene is complete.

Returns:

A dict mapping each scene id to its local folder.

envodat.download_raw(include, exclude=None, out=None, dry_run=False, share_url=None, password='')[source]

Downloads raw files (ROS bags, LiDAR, RGB-D, IMU, poses) from the CPS server.

The share’s folder structure is kept, and interrupted downloads resume.

Parameters:
  • include – Glob pattern(s) on the share path, e.g. "*mu-hall*seq01*.bag".

  • exclude – Glob pattern(s) to skip.

  • out – Target folder; defaults to <root>/raw.

  • dry_run – Only lists the matching files and their total size.

Returns:

Local paths, or the matching RemoteFile entries for a dry run.

envodat.cps_list(include=None, exclude=None, path='', share_url=None, password='')[source]

Lists files on the CPS share that match glob patterns.

Patterns match the share-relative path and ignore case, e.g. "*mu-hall*/*.bag".

Returns:

A list of RemoteFile.

Loading Data

envodat.load(scene, split=None, repo_id=None, revision=None, **kwargs)[source]

Loads a scene as a πŸ€— datasets object.

The local copy is used when the scene has been downloaded; otherwise the scene is read from the Hub. Each example holds image, width, height and objects (COCO-style pixel boxes, class ids and class names).

Parameters:
  • scene – Scene id, e.g. "mu-hall".

  • split – "train", "validation" or "test"; None gives all splits.

  • **kwargs – Passed to datasets.load_dataset().

Returns:

A DatasetDict, or a Dataset when split is given.

envodat.dataloader(scene, split='train', batch_size=8, image_size=640, shuffle=None, num_workers=0, transform=None, **kwargs)[source]

Returns a torch.utils.data.DataLoader over a downloaded scene.

Parameters:
  • scene – Scene id, e.g. "mu-hall".

  • split – "train", "validation" or "test".

  • batch_size – Images per batch.

  • image_size – Resize target (int or (h, w)); None keeps the original size.

  • shuffle – Defaults to True for the train split.

  • num_workers – Worker processes for loading.

  • transform – Optional (image, target) -> (image, target) callable.

  • **kwargs – Passed to DataLoader.

Returns:

A loader that yields (images, targets) as described in EnvoDatDetection.

class envodat.EnvoDatDetection(scene, split='train', image_size=640, transform=None)[source]

Detection dataset over one split of a downloaded scene.

Each item is (image, target): a [3, H, W] float tensor in [0, 1] and a dict with boxes (normalised cx, cy, w, h), labels, image_id and path. Polygon labels are converted to their bounding boxes.

Parameters:
  • scene – Scene id, e.g. "mu-hall".

  • split – "train", "validation" (or "val") or "test".

  • image_size – Int or (h, w) to resize to; None keeps the original size.

  • transform – Optional (image, target) -> (image, target) callable.

envodat.data_yaml(scene)[source]

Returns the path of a downloaded scene’s Ultralytics data.yaml.

Raises:

FileNotFoundError – If the scene has not been downloaded.

envodat.class_names(scene)[source]

Class names of a downloaded scene, in label-id order.

envodat.scene_dir(scene, format='yolo')[source]

Local folder of a downloaded scene (it may not exist yet).

Training

envodat.train_yolo(scene, model='yolo11n.pt', epochs=100, imgsz=640, batch=16, download_missing=True, evaluate_test=True, **kwargs)[source]

Trains an Ultralytics YOLO detector (YOLOv8 to YOLO11) on a scene.

The scene is downloaded first if it is not present.

Parameters:
  • scene – Scene id, e.g. "mu-hall".

  • model – Weights or model config, e.g. "yolo11n.pt".

  • epochs – Main training settings.

  • imgsz – Main training settings.

  • batch – Main training settings.

  • download_missing – Downloads the scene if it is not present.

  • evaluate_test – Also validates on the test split.

  • **kwargs – Further Ultralytics training arguments (lr0, device, …).

Returns:

A dict with the trained model and the val (and test) metrics.

Evaluation

envodat.evaluate_traj(est_traj, gt_traj, align='se3', delta=1, max_diff=0.02, sd_form='ratio')[source]

Evaluates a trajectory against ground truth with the EnvoDat benchmark metrics.

Parameters:
  • est_traj – Estimated trajectory: TUM or EnvoDat CSV path, or [N, 8] array.

  • gt_traj – Ground truth: gt-poses-*.csv or TUM path, or [N, 8] array.

  • align – "none", "se3" or "sim3".

  • delta – Frame offset for RPE and scale drift.

  • max_diff – Maximum timestamp difference for association, in seconds.

  • sd_form – Scale drift as "ratio" (optimum 1) or "abs" (optimum 0).

Returns:

A dict with ate, rpe and sd, each a (mean, std) tuple.

envodat.get_traj_np(path)[source]

Loads a trajectory as an [N, 8] array: t, x, y, z, qx, qy, qz, qw.

Reads the EnvoDat ground-truth CSV (gt-poses-*.csv) and TUM files.

envodat.to_tum(path, out=None)[source]

Converts an EnvoDat ground-truth CSV to a TUM file and returns its path.

Command Line

Installing the package also installs the envodat command. Run envodat <command> --help for every option.

Command

Does

envodat scenes

Print the scene catalog

envodat list

List the scenes on the Hugging Face Hub

envodat download <scene>... [--all] [--revision R] [--config F]

Download annotated scenes

envodat raw <glob>... [--dry-run]

Download raw data from the CPS server

envodat train <scene> [--model M] [--epochs N] [key=value ...]

Train a YOLO detector

envodat eval <est> <gt> [--align se3|sim3|none]

ATE / RPE / scale drift

The global option --root (or ENVODAT_ROOT) sets the data folder. Two more environment variables override the defaults: ENVODAT_HF_REPO (Hub repository) and ENVODAT_CPS_SHARE (CPS share link), with ENVODAT_CPS_PASSWORD for a protected share.