Skip to content
heliaEDGE
Reference
HELIA

patching

Portable image patch extraction and masked patch embeddings.

Machine-readable model

class

helia_edge/layers/patching.py:17

PatchLayer2D(height: int, width: int, ch: int, patch_height: int, patch_width: int, **kwargs={})

Extract flattened patches from images shaped (batch, height, width, ch).

method

Plot one image and its reconstructed patches; return its batch index.

helia_edge/layers/patching.py:59

show_patched_image(images: keras.KerasTensor, patches: keras.KerasTensor) -> int

Plot one image and its reconstructed patches; return its batch index.

method

Reconstruct one image from non-overlapping patches in row-major order.

helia_edge/layers/patching.py:83

reconstruct_from_patch(patch: keras.KerasTensor) -> keras.KerasTensor

Reconstruct one image from non-overlapping patches in row-major order.

class

helia_edge/layers/patching.py:95

MaskedPatchEncoder2D(
patch_height: int,
patch_width: int,
ch_size: int,
projection_dim: int,
mask_proportion: float,
downstream: bool = False,
seed: int | None = None,
**kwargs={},
)

Project patches with position embeddings and sample masks from a seeded stream.