torchfont.transforms.transformsΒΆ

Composable transforms for preprocessing tensor glyph sequences.

Examples

Compose multiple operations to normalize glyph tensors:

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

The transforms aim to cover the common preprocessing steps for vectorized glyph data while still integrating cleanly with PyTorch Dataset instances.

Classes

Compose(transforms)

Apply a sequence of transform callables to each sample.

LimitSequenceLength(max_len)

Trim glyph sequences to a fixed maximum length.

Patchify(patch_size)

Pad glyph sequences and reshape them into equal-sized patches.