LaMa Base

Click a block to read its description, or select it with Tab and Enter.

LaMa BasePinned OpenCV Zoo ONNX,512 × 512 BGR image + binary fill mask. Native wrapper accepts4-channel guided input.LibreYOLOLaMa BasePinned OpenCV Zoo ONNX,512 × 512 BGR image + binary fill mask. Native wrapper accepts4-channel guided input.Encoder and decoderImage × (1-mask), concat mask4 × 512 × 512ReflectPad3; Conv7×7; ReLU4 to64;512×512; BatchNorm fusedReflectPad1; Conv3×3,s2; ReLU64 to128;256×256; BatchNorm fusedReflectPad1; Conv3×3,s2; ReLU128 to256;128×128; BatchNorm fusedParallel Conv3×3,s2 from256 channelsLocal128 + global384, each64×64; BN fused/ReLUFFC residual block,n=18Local128/global384 at64×64Concat final local and global512 × 64 × 64ConvTranspose3×3,s2,p1,op1; BN; ReLU512 to256;128×128ConvTranspose3×3,s2,p1,op1; BN; ReLU256 to128;256×256ConvTranspose3×3,s2,p1,op1; BN; ReLU128 to64;512×512ReflectPad3; Conv7×764 to3;512×512Sigmoid3-channel generated BGR in[0,1]op:output_padding. Actual artifact uses18 residual blocks.FFC residual blockInput pair L,G128 and384 channels;64×64FFC + separate BN/ReLUOutput pair L1,G1FFC + separate BN/ReLUOutput pair L2,G2L2128 × 64 × 64G2384 × 64 × 64++LGL/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 outputGenerated BGR × mask3 × 512 × 512Input BGR × (1-mask)3 × 512 × 512+Multiply255BGR byte-domain valuesClip[0,255]ONNX output3 × 512 × 512Wrapper: resize to original H×WBilinear; convert BGR toRGBClip and cast uint8H × W × 3Copy original RGB outside fill maskExact original pixels on unmasked regionThe wrapper retains the original image/mask before512 resize.Fast Fourier Convolution unitLocal L64 × 64 gridReflectPad1; Conv3×3128 to128Global G64 × 64 gridReflectPad1; Conv3×3384 to128Local L64 × 64 gridReflectPad1; Conv3×3128 to384Global G64 × 64 gridSpectral transform384 to384++BatchNormalization128 channelsReLU128 × 64 × 64BatchNormalization384 channelsReLU384 × 64 × 64Local output=Conv(L)+Conv(G). Global output=Conv(L)+Spectral(G).The3×3 path convolutions are unbiased; normalization follows each sum.Global spectral transformConv1×1 (BN fused); ReLU384 to192;64×64Real2D Fourier transform192 complex channels;64×33 spectrumPack real and imaginary as channels384 × 64 × 33Conv1×1 (BN fused); ReLU384 to384;spectral mixingUnpack to192 complex channels64×33 spectrumInverse real2D Fourier transform192 × 64 × 64+Conv1×1, no bias192 to384Fourier lowering and parameter storageCoordinate/frequency ranges and phaseSin/Cos bases for separable64-point transformsReal/imaginary MatMul and EinsumApply cosine and sine bases along width and heightNormalize by square-root transform lengthsOrthonormal transform scalingKeep nonnegative width frequencies33 complex coefficients along widthInverse reconstructs conjugate-symmetric frequencies and uses inverse phase before returning real values.Stored INT8 parameter blocksScale and zero-point tensors; block_size8DequantizeLinear(integer-zero_point) × scaleReshape weights to convolution tensorsFloat Conv/ConvTranspose operandsArtifact: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 7df918ac3921d3daf0aae1d219776cf0dc4e4935f035af81841b40adcf74fdf2Source: libreyolo/models/lama/nn.py and model.py. Revision a4d0ecc9e17f.libreyolo.com