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ο
Scene Catalogο
- envodat.catalog.SCENESο
{scene_id: {name, title, environment, sequences, description}}.- Type:
Scene catalog
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 adata.yamlthat 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,formatandrevision; 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
RemoteFileentries for a dry run.
Loading Dataο
- envodat.load(scene, split=None, repo_id=None, revision=None, **kwargs)[source]ο
Loads a scene as a π€
datasetsobject.The local copy is used when the scene has been downloaded; otherwise the scene is read from the Hub. Each example holds
image,width,heightandobjects(COCO-style pixel boxes, class ids and class names).- Parameters:
scene β Scene id, e.g.
"mu-hall".split β
"train","validation"or"test";Nonegives all splits.**kwargs β Passed to
datasets.load_dataset().
- Returns:
A
DatasetDict, or aDatasetwhensplitis 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.DataLoaderover 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));Nonekeeps the original size.shuffle β Defaults to
Truefor 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 inEnvoDatDetection.
- 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 withboxes(normalisedcx, cy, w, h),labels,image_idandpath. 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;Nonekeeps the original size.transform β Optional
(image, target) -> (image, target)callable.
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
modeland theval(andtest) 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-*.csvor 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,rpeandsd, each a(mean, std)tuple.
Command Lineο
Installing the package also installs the envodat command. Run envodat <command> --help for every option.
Command |
Does |
|---|---|
|
Print the scene catalog |
|
List the scenes on the Hugging Face Hub |
|
Download annotated scenes |
|
Download raw data from the CPS server |
|
Train a YOLO detector |
|
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.