keypoint-detection + matching Β· vision Β· WASM Β· ~51 MB
A different vision task from the pose and landmark demos: local-feature matching. ALIKED detects and describes up to 1000 distinctive keypoints in each image; LightGlue, a learned attention matcher, finds the correspondences β the keypoint pairs that land on the same physical point across both photos. That's the engine behind panorama stitching, visual place recognition, duplicate detection, and AR tracking β running entirely on your device.
| Models | bukuroo/ALIKED-LightGlue-ONNX β ALIKED-N16rot (top-1000, 640px) + LightGlue |
|---|---|
| Task | keypoint-detection + learned matching (two-image correspondence) |
| Pipeline | ALIKED extracts keypoints + 128-d descriptors per image β LightGlue matches the two descriptor sets |
| Output | Per image: up to 1000 keypoints; across the pair: M matched index pairs + a confidence each |
| Quantization | fp32 (both ONNX graphs) |
| Runtime | onnxruntime-web (raw ONNX Runtime Web) β no transformers.js matcher class exists |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~51 MB total (ALIKED ~6 MB + LightGlue ~45 MB), cached after first load |
| License | ALIKED (BSD-3) Β· LightGlue (Apache-2.0) Β· ONNX exports per the repo card |
| Web APIs | WebAssembly, Web Workers, OffscreenCanvas, Canvas, FileReader β all Baseline widely available |
Pick a scene (image B is that scene rotated + scaled, so the correspondences have known ground truth), or upload two of your own photos. Then hit Match.
LightGlue assigns every correspondence a confidence in [0, 1]. Strong, repeatable structure (corners, textured edges) matches with high confidence; flat or ambiguous regions don't match at all. This is the real distribution of the current match set.
Feature matching is the geometric backbone of computer vision. Doing it on-device β no upload, no API β unlocks private, offline tools that reason about where images relate, not just what they contain.
Match a scene against a rotated/scaled copy and watch the correspondence lines track the transform.
Duplicate detector: upload two photos and get a "same scene?" verdict from the match count + inliers.
Auto-align: estimate the rotation/scale between two views from the matches and overlay B onto A.
Retrieve & verify: DINOv2 embeddings shortlist the closest gallery image, then LightGlue confirms it geometrically.
No transformers.js matcher class exists, so we run the two ONNX graphs directly with onnxruntime-web:
import * as ort from "onnxruntime-web";
const aliked = await ort.InferenceSession.create(alikedBytes); // ~6 MB
const lightglue = await ort.InferenceSession.create(lgBytes); // ~45 MB
// ALIKED: image [1,3,640,640] (RGB, /255) β keypoints [1000,2] (normalised),
// descriptors [1000,128], scores [1000]
const a = await aliked.run({ image: tensorA });
const b = await aliked.run({ image: tensorB });
// LightGlue: add a batch dim; match the two descriptor sets
const m = await lightglue.run({
kpts0: batch(a.keypoints), kpts1: batch(b.keypoints),
desc0: batch(a.descriptors), desc1: batch(b.descriptors),
});
// m.matches0 β [M, 2] index pairs Β· m.mscores0 β [M] confidences
This page runs exactly that in a Web Worker (with the resize on an OffscreenCanvas), maps the normalised keypoints back to pixels, and draws a line per correspondence.