MoGe-2 S
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.
MoGe-2 S
Surface-normal prediction, input3 × 518 × 518 RGB,native eval. Shapes exclude batch.
LibreYOLO
MoGe-2 S
Surface-normal prediction, input3 × 518 × 518 RGB,native eval. Shapes exclude batch.
DINOv2 feature encoder
Resize and ImageNet normalization
518 × 518;bilinear,antialias=True
Conv patch14,stride14
3 to384;37 × 37 patches
Prepend CLS + learned positions
1370 × 384; no registers
Transformer blocks,n=12
6 heads; taps every6 completed blocks
Take2 taps; LayerNorm; discard CLS
S/B:[5,11]; L:[5,11,17,23]; 384×37²
Independent Conv1×1 per tap
384 to384; each projection has own parameters
Stack projected maps along tap dimension
2 × 384 × 37 × 37
Sum over tap dimension
Feature F: 384 × 37 × 37
The normal-only graph omits points,mask andmetric-scale heads.
Last CLS token is returned by encoder, then ignored by this head.
UV-conditioned neck ConvStack
F concat UV0
386channels
Input Conv1×1
386 to384;37 × 37
ResidualConvBlock,n=0
384 × 37 × 37; N0
Resampler×2
384 to256; output74²
UV1
2channels
Input Conv1×1
2 to256;74 × 74
+
ResidualConvBlock,n=1
256 × 74 × 74; N1
Resampler×2
256 to128; output148²
UV2
2channels
Input Conv1×1
2 to128;148 × 148
+
ResidualConvBlock,n=1
128 × 148 × 148; N2
Resampler×2
128 to64; output296²
UV3
2channels
Input Conv1×1
2 to64;296 × 296
+
ResidualConvBlock,n=1
64 × 296 × 296; N3
Resampler×2
64 to32; output592²
UV4
2channels
Input Conv1×1
2 to32;592 × 592
+
ResidualConvBlock,n=0
32 × 592 × 592; N4
Every Ni is retained as an independent normal-head input.
Normal head ConvStack
N0
384channels
Input Conv1×1
384 to384;37 × 37
ResidualConvBlock,n=0
384 × 37 × 37; H0
Resampler×2
384 to256; output74²
N1
256channels
Input Conv1×1
256 to256;74 × 74
+
ResidualConvBlock,n=1
256 × 74 × 74; H1
Resampler×2
256 to128; output148²
N2
128channels
Input Conv1×1
128 to128;148 × 148
+
ResidualConvBlock,n=1
128 × 148 × 148; H2
Resampler×2
128 to64; output296²
N3
64channels
Input Conv1×1
64 to64;296 × 296
+
ResidualConvBlock,n=1
64 × 296 × 296; H3
Resampler×2
64 to32; output592²
N4
32channels
Input Conv1×1
32 to32;592 × 592
+
ResidualConvBlock,n=0
32 × 592 × 592; H4
Output Conv1×1
32 to3;592 × 592
Bilinear resize to518 × 518
align_corners=False,antialias=False
Normalize3-channel vectors
3 × 518 × 518 unit normals
Transformer block
Input tokens
1370 × 384
LayerNorm
384 channels; epsilon1e-6
Multihead self-attention
6 heads; head width64
LayerScale
384 learned channel scalars
+
LayerNorm
384 channels; epsilon1e-6
Linear
384 to 1536
GELU
Linear
1536 to 384
LayerScale
384 learned channel scalars
+
Output tokens
1370 × 384
Self-attention primitives
Fused QKV linear
384 to 1152; biases enabled
Split Q, K and V
6 heads; 1370 tokens;64 channels/head
Q × transpose(K) / 8
1370 × 1370 per head
Values V
64/head
Softmax over keys
Attention weights × V
6 heads;64 output channels/head
Concat heads
1370 × 384
Output linear
384 to 384
No causal mask. Dropout and stochastic depth are inactive in eval.
Resampler and UV geometry
First3 transitions:ConvTranspose2×2
D to256,256to128,128to64;stride2
Conv3×3,replicate padding1
Output channels256,128,64 respectively
Last transition:bilinear resize×2
64 channels;align_corners=False
Conv3×3,replicate padding1
64 to32
Both ConvStacks use these exact four resamplers.
UV levels:37²,74²,148²,296²,592²;2 coordinate channels.
For square input, horizontal/vertical span is1/sqrt(2).
Endpoints are ±span×(resolution-1)/resolution.
UV0 concatenates with image features; later neck levels
receive coordinates alone before learned projection.
All ConvStack input blocks are Conv1×1, even when Cin=Co.
ResidualConvBlock 256 channels
Input
256 channels
ReLU
Conv3×3
256 to256;replicate padding1
ReLU
Conv3×3
256 to256;replicate padding1
+
No normalization in the configured neck/head residual blocks.
ResidualConvBlock 128 channels
Input
128 channels
ReLU
Conv3×3
128 to128;replicate padding1
ReLU
Conv3×3
128 to128;replicate padding1
+
No normalization in the configured neck/head residual blocks.
ResidualConvBlock 64 channels
Input
64 channels
ReLU
Conv3×3
64 to64;replicate padding1
ReLU
Conv3×3
64 to64;replicate padding1
+
No normalization in the configured neck/head residual blocks.
Source: libreyolo/models/moge2/nn.py and model.py. Revision a4d0ecc9e17f.
libreyolo.com