Skip to content

Commit 4181da1

Browse files
authored
Add external Vision Transformer sample (#570)
Adds an external sample that runs DeiT-Tiny Vision Transformer inference in WebGPU compute shaders and visualizes attention maps as interactive heatmap overlays. This follows the external sample path suggested in #569, and is related to #350. External sample: https://lyonsno.github.io/webgpu-vit-attention/ Repository: https://github.com/lyonsno/webgpu-vit-attention I'm happy to make any changes that may be needed. Please let me know whether this sample is appropriate for inclusion.
1 parent 904fe34 commit 4181da1

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎sample/visionTransformer/meta.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default {
2+
name: 'Vision Transformer',
3+
description: `Runs DeiT-Tiny Vision Transformer inference in WebGPU compute shaders and visualizes attention maps as interactive heatmap overlays.`,
4+
filename: __DIRNAME__,
5+
external: {
6+
url: 'https://lyonsno.github.io/webgpu-vit-attention/',
7+
sourceURL: 'https://github.com/lyonsno/webgpu-vit-attention',
8+
},
9+
sources: [],
10+
};

‎src/samples.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import timestampQuery from '../sample/timestampQuery/meta';
4343
import transparentCanvas from '../sample/transparentCanvas/meta';
4444
import twoCubes from '../sample/twoCubes/meta';
4545
import videoUploading from '../sample/videoUploading/meta';
46+
import visionTransformer from '../sample/visionTransformer/meta';
4647
import volumeRenderingTexture3D from '../sample/volumeRenderingTexture3D/meta';
4748
import wireframe from '../sample/wireframe/meta';
4849
import worker from '../sample/worker/meta';
@@ -173,6 +174,7 @@ export const pageCategories: PageCategory[] = [
173174
marchingCubes,
174175
alphaToCoverageEmulator,
175176
particleLife,
177+
visionTransformer,
176178
},
177179
},
178180

0 commit comments

Comments
 (0)