torchfont.transforms.transformsΒΆ

Composable transforms for polishing tensor glyph sequences before training.

Notes

Each transform is intentionally small and deterministic, allowing you to mix and match them in torch.utils.data.Dataset pipelines without losing track of where normalization occurs.

Examples

Normalize and patch glyph tensors in a single pipeline:

pipeline = Compose([LimitSequenceLength(256), Patchify(32)])

Classes

Compose(transforms)

Apply a curated list of transform callables to every sample.

LimitSequenceLength(max_len)

Trim glyph sequences to a predictable maximum length.

Patchify(patch_size)

Pad glyph sequences and reshape them into uniform, model-friendly patches.