EdgeTAM edge

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

EdgeTAM edgeImage segmentation, 1024 × 1024 input, one box, multimask output. RepViT backend boundary; verified prompt and decoder internals.LibreYOLOEdgeTAM edgeImage segmentation, 1024 × 1024 input, one box, multimask output. RepViT backend boundary; verified prompt and decoder internals.Image encoder interfaceRGB input3 × 1,024 × 1,024Bilinear square resize1,024 × 1,024, ImageNet normalizationRepViT-m1 backendExternal timm feature extractorFour backbone feature maps48, 96, 192, 384 channelsImage feature pyramidThree independent image-head feature outputsHigh-res s0 projection32 × 256 × 256High-res s1 projection64 × 128 × 128Main image embedding256 × 64 × 64, add no-memory vectorRepViT internal operators are not presentin this source checkout or installed runtime.Box prompt encoderOne box2 corner coordinates × 2Shift pixel centersAdd 0.5 to x and yNormalize coordinatesDivide by 1024, map to [-1,1]MatMul random Fourier matrix2 coords to 128 frequenciesMultiply by 2 pi2 × 128Sin2 × 128Cos2 × 128Concat sin and cos2 × 256Corner type2 learned × 256+Sparse prompt embeddings2 × 256Learned no-mask embeddingBroadcast to 256 × 64 × 64Selected input: one box, no mask prompt.Points use the same Fourier encoding, pluspositive/negative or not-a-point embeddings.Dense image position: this encoding evaluatedon the centers of the 64 × 64 feature grid.Mask decoder inputsImage embedding256 × 64 × 64Dense prompt256 × 64 × 64+Flatten image features4,096 × 256Learned output tokensObject + IoU + 4 mask = 6 × 256Sparse prompts2 × 256Concat output and prompt tokens8 × 256Two-way block 18 queries, 4,096 image tokensTwo-way block 28 queries, 4,096 image tokensFinal token-to-image attentionQ+Q0, K+P, V=updated image+Final LayerNorm on queries8 × 256Q0 is the original token sequence.P is fixed Fourier image position.4,096 image tokens feed block 1 keys/values.Masks and quality outputsUpdated query tokens1 IoU + 4 mask tokens + 1 object tokenUpdated image tokens4,096 × 256Reshape to image256 × 64 × 64ConvTranspose2d 2×2 / 2256 to 64; 64 × 128 × 128Channel LayerNorm64 × 128 × 128GELU64 × 128 × 128ConvTranspose2d 2×2 / 264 to 32; 32 × 256 × 256GELU32 × 256 × 256Select four mask tokens4 × 256Four independent Linear layersEach 256 to 256ReLU4 × 256Four independent Linear layersEach 256 to 256ReLU4 × 256Four independent Linear layersEach 256 to 32MatMul mask coefficients × upscaled image4 × 32 times 32 × 65,536; reshape to 4 × 256 × 256Select masks 1 to 33 × 256 × 256Mask logits are resized to the input canvas,then unpadded/resized to the original image.multimask_output=True is drawn.False selects mask/score 0 instead.Object token: Linear 256, ReLU, Linear 256,ReLU, Linear 1 produces object-score logit.+High-res feature s164 × 128 × 128+High-res feature s032 × 256 × 256Select IoU token 1256Linear256 to 256ReLU256Linear256 to 256ReLU256Linear256 to 4Sigmoid4 mask-quality scoresSelect scores 1 to 33 quality scoresSelect object token 0256Linear256 to 256ReLU256Linear256 to 256ReLU256Linear256 to 1 object-score logitTwo-way block 1Query state8 × 256Image state4,096 × 256Token self-attention8 heads, 32 channels per headFirst self-attention has no PE or residual.LayerNorm8 × 256Original tokens Q08 × 256+Image position P4,096 × 256+Token-to-image attentionQ=8, K/V=4,096; 8 heads × 16+LayerNorm8 × 256Linear256 to 2,048ReLU8 × 2,048Linear2,048 to 256+LayerNorm8 × 256Original tokens Q08 × 256+Image-to-token attentionQ=4,096, K/V=8; 8 heads × 16+LayerNorm on image state4,096 × 256Updated queries: 8 × 256Two-way block 2Query state8 × 256Image state4,096 × 256Token self-attention8 heads, 32 channels per headOriginal tokens Q08 × 256+Self-attention Q/K include Q0.+LayerNorm8 × 256Original tokens Q08 × 256+Image position P4,096 × 256+Token-to-image attentionQ=8, K/V=4,096; 8 heads × 16+LayerNorm8 × 256Linear256 to 2,048ReLU8 × 2,048Linear2,048 to 256+LayerNorm8 × 256Original tokens Q08 × 256+Image-to-token attentionQ=4,096, K/V=8; 8 heads × 16+LayerNorm on image state4,096 × 256Updated queries: 8 × 256Token self-attentionQuery input8 × 256Key/value input8 × 256Linear Q256 to 256Reshape heads8 × 8 × 32Linear K256 to 256Reshape heads8 × 8 × 32Linear V256 to 256Reshape heads8 × 8 × 32MatMul Q K-transpose8 × 8 × 8ScaleDivide by sqrt(32)Softmax over keys8 × 8 × 8MatMul attention × V8 × 8 × 32Merge heads8 × 256Linear output256 to 256Token-to-image attentionQuery input8 × 256Key/value input4096 × 256Linear Q256 to 128Reshape heads8 × 8 × 16Linear K256 to 128Reshape heads8 × 4096 × 16Linear V256 to 128Reshape heads8 × 4096 × 16MatMul Q K-transpose8 × 8 × 4096ScaleDivide by sqrt(16)Softmax over keys8 × 8 × 4096MatMul attention × V8 × 8 × 16Merge heads8 × 128Linear output128 to 256Image-to-token attentionQuery input4096 × 256Key/value input8 × 256Linear Q256 to 128Reshape heads8 × 4096 × 16Linear K256 to 128Reshape heads8 × 8 × 16Linear V256 to 128Reshape heads8 × 8 × 16MatMul Q K-transpose8 × 4096 × 8ScaleDivide by sqrt(16)Softmax over keys8 × 4096 × 8MatMul attention × V8 × 4096 × 16Merge heads4096 × 128Linear output128 to 256Image-mode decoderQ0: original eight output/prompt tokens; P: Fourier image position.Final cross-attention uses the token-to-image equation, with residual and LayerNorm.Features s0 and s1 are computed once, then added at the two upscaling steps.The no-memory embedding is added to the 64×64 image feature.This is image inference. Video memory attention and memory encoder do not run.multimask_output=True selects mask/IoU slots 1, 2 and 3.Single-mask eval can fall back to the best multimask using stability thresholds.Image feature pyramidStage 1 map48 × 256 × 256Lateral Conv2d 1×148 to 256, bias=TrueHigh-res Conv2d 1×1256 to 32s0: 32 × 256 × 256Stage 2 map96 × 128 × 128Lateral Conv2d 1×196 to 256, bias=TrueHigh-res Conv2d 1×1256 to 64s1: 64 × 128 × 128Stage 3 map192 × 64 × 64Lateral Conv2d 1×1192 to 256, bias=True+Add no-memory embedding256 × 64 × 64Main image embedding: 256 × 64 × 64Stage 4 map384 × 32 × 32Lateral Conv2d 1×1384 to 256, bias=TrueNearest upsample ×2256 × 64 × 64Only the 32×32 to 64×64 top-down addition runs for fpn_top_down_levels=[2,3].The 128×128 and 256×256 lateral outputs remain independent. The 32×32 output is not passed to the mask decoder.Backend verification boundaryThe library selects repvit_m1 through an embedded TimmWrapperConfig.Its configured backbone widths are 48, 96, 192 and 384.The RepViT architecture is not inferred from those four numbers.Prompt encoder, two-way decoder, output MLPs and high-resolution additions are fully drawn.The installed Apache-2.0 EdgeTamMaskDecoder passed a no-weight meta forward.Image mode does not run the video memory encoder, memory attention or perceiver resampler.Configuration source: LibreYOLO/LibreEdgeTAM, revision c81728930ecc.Source: libreyolo/models/sam/edgetam.py. Revision a4d0ecc9e17f.libreyolo.com