omniloader.transforms

Configurable, per-sample transforms: normalization and augmentation.

This subpackage groups the transform pipeline used after unification:

  • base — Transform, Compose and shared helpers;

  • normalize — Normalize, MinMaxNormalize, RobustNormalize, InstanceNormalize;

  • augment — GaussianNoise, FeatureDropout, SpanMasking, TimeWarp, FeatureMasking;

  • crop — RandomCrop, CenterCrop;

  • mix — MixupCollator (collate-time);

  • stats — statistics helpers for normalization.

Compose transforms with Compose, or build one from a list of config dicts with build_transform().

Submodules

Attributes

Functions

build_transform(→ base.Compose | None)

Build a Compose from a list of transform config dicts.

Package Contents

omniloader.transforms.TRANSFORMS: dict[str, type[base.Transform]]
omniloader.transforms.build_transform(configs: collections.abc.Sequence[collections.abc.Mapping[str, Any]], schema: omniloader.schema.spec.UnifiedSchema | None = None) → base.Compose | None[source]

Build a Compose from a list of transform config dicts.

Each config dict has a name (a key of TRANSFORMS) and the remaining keys are forwarded as keyword arguments. Schema-aware transforms receive schema automatically when they declare no explicit keys; stats-based normalizers read their stats from the config — either inline, or from a saved JSON file via stats_path (and union_stats_path for PerDatasetNormalize), loaded with load_stats(). This lets a config reference stats produced once by omniloader compute-stats instead of inlining them.

Parameters:
  • configs – A list of transform specifications.

  • schema – The unified schema, injected into schema-aware transforms.

Returns:

A Compose, or None if configs is empty.

Raises:

ValueError – If a config names an unknown transform.