Skip to content

[task] TrainingDatasetMetadata: improve robustness and separation of concerns for incomplete projects #3312

Description

@deruyter92

Problem
TrainingDatasetMetadata and ShuffleMetadata in deeplabcut/generate_training_dataset/metadata.py have grown into classes with unclear contracts and conflated responsibilities. This causes several problems:

  • Inference fails on incomplete projects: For example, inference on this example project is currently not possible and this demo notebook is therefore broken.
  • Error messages can be uninformative: e.g. when seeing Could not find a shuffle with trainingset fraction 0.95 and index 0, the user has no way to know whether the metadata is empty, stale, or simply using the wrong index.
  • No documented contract in ShuffleMetadata.split: DataSplit | None for when None is valid. E.g. save() crashes on None-split entries (and load_split() on a frozen dataclass is also a bit awkward).

Acceptence criteria

  • Separate focused classes with clear contracts, separating scanning, merging and registry persistence responsibilities.
  • Engine correctly inferred from folder structure as fallback, instead of only pickle / yaml.
  • Inference works on model-only projects.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions