LaMa Base
Fit diagram
Read at 100%
Clear selection
Download SVG
Download PNG
Click a block to read its description, or select it with Tab and Enter.
LaMa Base
Pinned OpenCV Zoo ONNX,512 × 512 BGR image + binary fill mask. Native wrapper accepts4-channel guided input.
LibreYOLO
LaMa Base
Pinned OpenCV Zoo ONNX,512 × 512 BGR image + binary fill mask. Native wrapper accepts4-channel guided input.
Encoder and decoder
Image × (1-mask), concat mask
4 × 512 × 512
ReflectPad3; Conv7×7; ReLU
4 to64;512×512; BatchNorm fused
ReflectPad1; Conv3×3,s2; ReLU
64 to128;256×256; BatchNorm fused
ReflectPad1; Conv3×3,s2; ReLU
128 to256;128×128; BatchNorm fused
Parallel Conv3×3,s2 from256 channels
Local128 + global384, each64×64; BN fused/ReLU
FFC residual block,n=18
Local128/global384 at64×64
Concat final local and global
512 × 64 × 64
ConvTranspose3×3,s2,p1,op1; BN; ReLU
512 to256;128×128
ConvTranspose3×3,s2,p1,op1; BN; ReLU
256 to128;256×256
ConvTranspose3×3,s2,p1,op1; BN; ReLU
128 to64;512×512
ReflectPad3; Conv7×7
64 to3;512×512
Sigmoid
3-channel generated BGR in[0,1]
op:output_padding. Actual artifact uses18 residual blocks.
FFC residual block
Input pair L,G
128 and384 channels;64×64
FFC + separate BN/ReLU
Output pair L1,G1
FFC + separate BN/ReLU
Output pair L2,G2
L2
128 × 64 × 64
G2
384 × 64 × 64
+
+
L
G
L/G identity residuals remain separate; there is no cross-add.
Each residual block executes two identical-shape FFC units.
Blocks5...22 have the same graph and independent parameters.
The global spectral branch is expanded below.
Mask composite and wrapper output
Generated BGR × mask
3 × 512 × 512
Input BGR × (1-mask)
3 × 512 × 512
+
Multiply255
BGR byte-domain values
Clip[0,255]
ONNX output3 × 512 × 512
Wrapper: resize to original H×W
Bilinear; convert BGR toRGB
Clip and cast uint8
H × W × 3
Copy original RGB outside fill mask
Exact original pixels on unmasked region
The wrapper retains the original image/mask before512 resize.
Fast Fourier Convolution unit
Local L
64 × 64 grid
ReflectPad1; Conv3×3
128 to128
Global G
64 × 64 grid
ReflectPad1; Conv3×3
384 to128
Local L
64 × 64 grid
ReflectPad1; Conv3×3
128 to384
Global G
64 × 64 grid
Spectral transform
384 to384
+
+
BatchNormalization
128 channels
ReLU
128 × 64 × 64
BatchNormalization
384 channels
ReLU
384 × 64 × 64
Local output=Conv(L)+Conv(G). Global output=Conv(L)+Spectral(G).
The3×3 path convolutions are unbiased; normalization follows each sum.
Global spectral transform
Conv1×1 (BN fused); ReLU
384 to192;64×64
Real2D Fourier transform
192 complex channels;64×33 spectrum
Pack real and imaginary as channels
384 × 64 × 33
Conv1×1 (BN fused); ReLU
384 to384;spectral mixing
Unpack to192 complex channels
64×33 spectrum
Inverse real2D Fourier transform
192 × 64 × 64
+
Conv1×1, no bias
192 to384
Fourier lowering and parameter storage
Coordinate/frequency ranges and phase
Sin/Cos bases for separable64-point transforms
Real/imaginary MatMul and Einsum
Apply cosine and sine bases along width and height
Normalize by square-root transform lengths
Orthonormal transform scaling
Keep nonnegative width frequencies
33 complex coefficients along width
Inverse reconstructs conjugate-symmetric frequencies and uses inverse phase before returning real values.
Stored INT8 parameter blocks
Scale and zero-point tensors; block_size8
DequantizeLinear
(integer-zero_point) × scale
Reshape weights to convolution tensors
Float Conv/ConvTranspose operands
Artifact:18,001 primitive nodes.
222 Conv,3 ConvTranspose,299 DequantizeLinear.
Fourier paths are lowered; no opaque FFT custom operator.
Source-level grouping preserves the exported arithmetic; shape bookkeeping and repeated trig operations are summarized by the DFT definition.
Architecture extracted from the exact licensed artifact. ONNX shape inference plus kernel arithmetic; numerical inference was not executed.
Artifact revision aee6d22f0a13e5e35af1c9a1c3afd62841fc6f3f; SHA-256 7df918ac3921d3daf0aae1d219776cf0dc4e4935f035af81841b40adcf74fdf2
Source: libreyolo/models/lama/nn.py and model.py. Revision a4d0ecc9e17f.
libreyolo.com