PIDNet 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.
PIDNet S
Cityscapes semantic segmentation,19 classes,input3 × 1024 × 1024, native eval. Shapes exclude batch.
LibreYOLO
PIDNet S
Cityscapes semantic segmentation,19 classes,input3 × 1024 × 1024, native eval. Shapes exclude batch.
Shared stem and integral stream I
RGB + ImageNet normalization
3 × 1024 × 1024
Two Conv3×3/BN/ReLU operations
3 to32 to32; bothstride2; 32 × 256 × 256
BasicBlock stage1,n=2
32 to32; stride1;256 × 256
ReLU; BasicBlock stage2,n=2; ReLU
32 to64; firststride2;128 × 128
BasicBlock stage3,n=3; ReLU
64 to128; firststride2;64 × 64
BasicBlock stage4,n=3; ReLU
128 to256; firststride2;32 × 32
Bottleneck stage5,n=2
256 to512; inner256; firststride2;16²
PAPPM
512 to128; branchwidth96;16 × 16
Bilinear resize to128 × 128
I: 128 × 128 × 128
Stage2 output fans into P, I and D streams.
Proportional stream P
BasicBlock layer3_,n=2
From sharedstage2; 64 to64;128²
PagFM3 with compressed I3
I3 Conv1×1+BN: 128 to64
ReLU; BasicBlock layer4_,n=2
64 to64;128²
PagFM4 with compressed I4
I4 Conv1×1+BN: 256 to64
ReLU; Bottleneck layer5_,n=1
64 to128; inner64;128²
P: 128 × 128 × 128.
Derivative stream D
BasicBlock layer3_d,n=1
From sharedstage2; 64 to32; nofinalReLU
Add resized diff3(I3)
Conv3×3+BN: 128 to32; thenresize128²
ReLU; Bottleneck layer4_d,n=1
32 to64; inner32;128²
Add resized diff4(I4)
Conv3×3+BN: 256 to64; thenresize128²
ReLU; Bottleneck layer5_d,n=1
64 to128; inner64;128²
D: 128 × 128 × 128.
PagFM (used twice)
P input
64 channels
Conv1×1 + BatchNorm
64 to32
Y input
64 channels
Conv1×1 + BatchNorm
64 to32
Bilinear resize projectedY
Match P grid128×128
×
Sum channels then sigmoid
Similarity S:1 × 128 × 128
Multiply (1-S) × P
64 channels
Multiply S × resize(Y)
64 channels
+
P/Y in the weighted mix are unprojected feature tensors.
LightBag
Sigmoid(D)
Edge gate E: 128 channels
Multiply (1-E) × I
128 channels
Multiply E × P
128 channels
+
+
P
I
Conv1×1 + BatchNorm
128 to128
Conv1×1 + BatchNorm
128 to128
+
P, I and D are the final128×128 stream outputs.
Large uses Bag; S/M use LightBag with two learned paths.
SegmentHead and native output
Fused feature
128 × 128 × 128
BatchNorm2d
128 channels
ReLU
Conv2d3×3
128 to128;s1,p1,bias=False
BatchNorm2d
128 channels
ReLU
Conv2d1×1
128 to19;bias=True
Semantic logits
19 × 128 × 128
Full-canvas resizing belongs to public postprocessing.
PAPPM
Identity
Input 512 × 16 × 16
BatchNorm; ReLU; Conv1×1
512 to96; noConv bias
Z0
96ch
AvgPool5,s2,p2
Input 512 × 16 × 16
BatchNorm; ReLU; Conv1×1
512 to96; noConv bias
Bilinear resize16×16
96 channels
+
Z0
AvgPool9,s4,p4
Input 512 × 16 × 16
BatchNorm; ReLU; Conv1×1
512 to96; noConv bias
Bilinear resize16×16
96 channels
+
Z0
AvgPool17,s8,p8
Input 512 × 16 × 16
BatchNorm; ReLU; Conv1×1
512 to96; noConv bias
Bilinear resize16×16
96 channels
+
Z0
AdaptiveAvgPool1
Input 512 × 16 × 16
BatchNorm; ReLU; Conv1×1
512 to96; noConv bias
Bilinear resize16×16
96 channels
+
Z0
U1
96ch
U2
96ch
U3
96ch
U4
96ch
U1
U2
U3
U4
Concat U1,U2,U3,U4
384 channels
BN; ReLU; groupedConv3×3 (groups4)
384 to384;s1,p1
Z0
Concat Z0 and grouped scale output
480 channels
Input shortcut: BN; ReLU; Conv1×1
512 to128
BN; ReLU; Conv1×1 compression
480 to128
+
All pool branches consume the same input. Each scale independently adds the same Z0 before grouped processing.
Residual block and composite-convolution definitions
Ci/Co are the explicit input/output channel numbers printed at each occurrence; s is its printed stride.
BasicBlock
Conv3×3 Ci toCo,s,p1
BN
ReLU
Conv3×3 Co toCo,s1,p1
BN
+
Identity or1×1+BN
Project when Ci!=Co or s!=1
Bottleneck
Conv1×1 Ci toinner
BN
ReLU
Conv3×3 inner toinner,s,p1
BN
ReLU
Conv1×1 inner to2inner
BN
+
Identity or1×1+BN
Project when Ci!=Co or s!=1
Last BasicBlock in a multi-block stage omits final ReLU. Bottlenecks and single D blocks omit it; main graph marks later ReLUs.
Source: libreyolo/models/pidnet/nn.py and model.py. Revision a4d0ecc9e17f.
libreyolo.com