{"slug": "onnx-css-neural-network-inference-using-stylesheets", "title": "ONNX.css – Neural network inference using stylesheets", "summary": "ONNX.css, a new open-source tool, compiles ONNX neural network models into CSS stylesheets, enabling browsers to run inference via the style engine. It demonstrates three models: a LeNet-style CNN for MNIST digit classification (12 ONNX nodes, 30,852 CSS properties), a VAE decoder for image generation (6 nodes, 3,170 CSS properties), and Silero VAD v6.2.1 for speech detection (48 primitive nodes, 8,188 CSS properties). The project highlights the browser's style engine as a novel inference runtime.", "body_md": "ONNX model → CSS stylesheet\n\n# ONNX.css\n\nChoose an ONNX model, compile it into a CSS stylesheet, then let the browser style engine run inference.\n\nCompiled successfully\n\n## Draw a digit.\n\nYour browser's style engine will infer the result using a neural network expressed in CSS.\n\n**Model compiled to CSS** Official ONNX Model Zoo / opset 8\n\n## Input canvas\n\n28×28 tensor\n\nDraw with mouse, trackpad, or touch.\n\n## CSS prediction\n\nArgmax of ten computed logits\n\n**—** Waiting for a stroke\n\n`—`\n\n`—`\n\n`—`\n\n`—`\n\n`—`\n\n`—`\n\n`—`\n\n`—`\n\n`—`\n\n`—`\n\n**→** CSS variables\n\n**→** getComputedStyle()\n\n**LeNet-style CNN**\n\n**12 ONNX nodes**\n\n**30,852 CSS properties**\n\n**10 raw logits**\n\nGenerated artifact\n\n## Raw compiled CSS\n\n**Preview truncated** Only the beginning of the stylesheet is shown. Copy or download to inspect the complete file.\n\nModel source: [ONNX Model Zoo / MNIST](https://github.com/onnx/models/tree/main/validated/vision/classification/mnist). Official validated `mnist-8.onnx`\n\nmodel using ONNX opset 8.\n\nCompiled successfully\n\n## Explore latent space.\n\nYour browser's style engine generates images using a neural network expressed in CSS.\n\n**VAE decoder compiled to CSS** 6 nodes · 3 dense layers\n\n## Latent position\n\nTwo model inputs\n\nThe controls bind directly to two CSS custom properties.\n\n## CSS-generated image\n\n784 computed pixel values\n\n`(0.00, 0.00)`\n\nWaiting for CSS output**→** CSS decoder\n\n**→** 784 pixels\n\n**Variational Autoencoder (VAE)**\n\n**6 ONNX nodes**\n\n**3,170 CSS properties**\n\n**28×28 generated image**\n\nGenerated artifact\n\n## Raw decoder CSS\n\n**Preview truncated** Only the beginning of the stylesheet is shown. Copy or download to inspect the complete file.\n\nPretrained checkpoint: [pszmk/mnist-vae-latent2](https://huggingface.co/pszmk/mnist-vae-latent2). Decoder-only fixed-shape ONNX export generated by this project.\n\nCompiled successfully\n\n## Listen for speech.\n\nLoad audio, choose a fixed 32 ms window, and estimate its speech probability using a neural network in CSS.\n\n**Silero VAD v6.2.1 compiled to CSS** Fixed 8 kHz · recurrent state\n\n## Audio window\n\n256 samples at 8 kHz\n\nAudio decoding and resampling happen in JavaScript.\n\n## CSS speech estimate\n\nSilero probability output\n\n**—**\n\n`—`\n\n`0.50`\n\nLoad an audio file to begin**→** CSS STFT + VAD\n\n**→** Speech probability\n\n**Silero VAD v6.2.1**\n\n**48 primitive nodes**\n\n**8,188 CSS properties**\n\n**32 ms fixed window**\n\nGenerated artifact\n\n## Raw VAD CSS\n\n**Preview truncated** Only the beginning of the stylesheet is shown. Copy or download to inspect the complete file.\n\nModel source: [Silero VAD v6.2.1](https://github.com/snakers4/silero-vad/releases/tag/v6.2.1). With minor model surgery to remove dynamic shapes: fixed 8 kHz branch with prior-audio context and the LSTM lowered to primitive operators.", "url": "https://wpnews.pro/news/onnx-css-neural-network-inference-using-stylesheets", "canonical_source": "https://onnx.css.evanking.io/", "published_at": "2026-08-20 14:26:08+00:00", "updated_at": "2026-08-20 14:46:09.523120+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "neural-networks", "developer-tools"], "entities": ["ONNX Model Zoo", "LeNet", "Silero VAD v6.2.1", "MNIST", "Hugging Face"], "alternates": {"html": "https://wpnews.pro/news/onnx-css-neural-network-inference-using-stylesheets", "markdown": "https://wpnews.pro/news/onnx-css-neural-network-inference-using-stylesheets.md", "text": "https://wpnews.pro/news/onnx-css-neural-network-inference-using-stylesheets.txt", "jsonld": "https://wpnews.pro/news/onnx-css-neural-network-inference-using-stylesheets.jsonld"}}