A Vision Transformer (DeiT-Tiny: 12 layers, 3 heads, 5.7 M parameters) runs in your browser in plain JavaScript. The weights are 23 MB, downloaded once. Your photo is never uploaded.
The 224 × 224 centre crop the model sees, cut into 14 × 14 patches of 16 × 16 pixels.
Show
Layer12
Head
Querythe [CLS] token
Click a patch on the image to see what that patch attends to instead.
Top-5 predictions
Press the button to load the model.
How far does each head look? Mean attention distance, this image
head 1head 2head 3dashed line: a head that attended uniformly to all patches
For every patch, the distance in pixels to every other patch, weighted by how much it attends to it (the [CLS] key left out), averaged over all 196 patches. Small = local, like a small convolution; large = global. Click a dot to show that head above.