SwinIR S

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

SwinIR SRGB super-resolution ×4,input3 × 64 × 64,native eval. Shapes exclude batch.LibreYOLOSwinIR SRGB super-resolution ×4,input3 × 64 × 64,native eval. Shapes exclude batch.Shallow and deep featuresInput RGB3 × 64 × 64; pad to window multiple8 (none here)Subtract RGB mean[0.4488,0.4371,0.4040]; img_range=1Conv2d3×33 to60;s1,p1Flatten + LayerNorm4096 × 60; patch_size1RSTB residual group,n=4Six Swin blocks/group; 6 heads; window8Final LayerNorm60 channels; epsilon1e-5Restore feature grid60 × 64 × 64Body convolution residual module60 to60; 1conv+Deep feature for upsampling60 × 64 × 64Residual Swin Transformer BlockToken input4096 × 60Swin transformer block,n=6Alternating shift0,4,0,4,0,4Reshape to image60 × 64 × 64Residual convolution module60 to60; 1convFlatten (no LayerNorm)4096 × 60+No spatial downsampling or patch merging inside RSTB.Initial patch embed has LayerNorm; RSTB re-embed does not.Reconstruction and outputConv2d3×360 to48;s1,p1PixelShuffle×448×64² becomes3×256²Add RGB mean backimg_range=1;3 × 256 × 256Crop to4× original input canvas3 × 256 × 256No input-image residual in these registered SR presets.Swin transformer blockToken input4096 × 60LayerNorm60 channels; epsilon1e-5Cyclic shift by(-4,-4) or identityShift4 on odd blocks;0 on even blocksPartition8×8 windows64 windows,64 tokens/window,width60Window attention6 headsReverse windows and undo cyclic shift4096 × 60+LayerNorm60 channelsLinear MLP60 to120GELULinear MLP120 to60+Dropout/DropPath are identities in eval. No absolute positions.Window attentionWindow tokens64 × 60Linear QKV60 to180; split into6 headsQ × transpose(K)Scale1/sqrt(10); 64 × 64 per headAdd relative position bias225 × 6 learned table; indexed to64²Add shifted-window mask0 within region, -100 across artificial wrap boundarySoftmax over keysAttention weights × V6 heads, width10Concat heads64 × 60Output Linear60 to60V is the value slice of the same QKV projection; it bypasses QK/bias/mask.VConvolutional residual moduleConv2d3×360 to60;s1,p1,bias=TrueSame module choice in every RSTB and after the full body.Concrete configurationsS: D60,N4,A6;24 transformer blocks.M: D180,N6,A6;36 transformer blocks.L: D240,N9,A8;54 transformer blocks.S/M use1conv residual; L uses3conv.S usesdirect PixelShuffle4.M/L use two nearest×2 resize/conv stages.All MLP hidden widths are2D:120,360,480.All windows are8×8 withshift4 in alternating blocks.Family view shows structural alternatives, not width-only scaling.Source: libreyolo/models/swinir/nn.py and model.py. Revision a4d0ecc9e17f.libreyolo.com