Skip to content
image-segmentation · multi-model 2 Web Workers · 33.36 MB Total 28.94 MB (B2) + 4.42 MB (B0) WASM q8 NVIDIA Source Code License

SegFormer-B2 vs SegFormer-B0: Per-Class Pixel IoU & Tiny-Object Gain

Stage 1 runs Xenova/segformer-b2-finetuned-ade-512-512 (MiT-B2 [3,4,6,3], 27.5M params, 28.94 MB q8 WASM). Stage 2 reuses sibling ../segformer-semantic/worker.js (Xenova/segformer-b0-finetuned-ade-512-512, MiT-B0 [2,2,2,2], 3.8M params, 4.42 MB q8 WASM). Both process the exact same bounded frame to quantify pixel agreement, per-class pixel IoU, and small/tiny-object recall gain.

1 · Workflow models (33.36 MB total)

Stage 1 · SegFormer-B2 (ADE20K · 28.94 MB)

Uses ../worker.js — MiT-B2 [3,4,6,3], 768-dim decoder, WASM q8.

Stage 2 · SegFormer-B0 (ADE20K · 4.42 MB)

Reuses ../../segformer-semantic/worker.js — MiT-B0 [2,2,2,2], 256-dim decoder, WASM q8.

2 · Side-by-side masks & per-class pixel IoU diff

Loading a curated scene…

Stage 1 · SegFormer-B2 (28.94 MB)

Awaiting Stage 1 inference…

Stage 2 · SegFormer-B0 (4.42 MB)

Awaiting Stage 2 inference…

Pixel agreement map (green = match, red = flip)

Run both stages to compute pixel agreement.

Pixel agreement–
Mean class IoU–
Classes (B2 vs B0)–
B2-only / B0-only–
Tiny (<cut-off) B2 vs B0–
Tiny-object gain–
Latency (B2 vs B0)–
Per-class pixel IoU & coverage diff (SegFormer-B2 vs SegFormer-B0)
ADE20K Class Status Pixel IoU B2 share B0 share Area Δ (B2−B0)
Run both stages to compute per-class pixel IoU.
Head-to-head comparison history across scenes
Scene Classes (B2 / B0) Pixel agree Mean IoU Tiny gain Latency
Run both stages to record head-to-head runs.

See inside the code

Show the code — decoding Stage 2 ../segformer-semantic/worker.js RGBA overlay to ADE20K IDs
Show the code — Stage 2 sibling worker adapter (../segformer-semantic/worker.js)

References