← All models

keypoint-detection + matching Β· vision Β· WASM Β· ~51 MB

ALIKED + LightGlue β€” match two images by their features

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.

At a glance

Modelsbukuroo/ALIKED-LightGlue-ONNX β€” ALIKED-N16rot (top-1000, 640px) + LightGlue
Taskkeypoint-detection + learned matching (two-image correspondence)
PipelineALIKED extracts keypoints + 128-d descriptors per image β†’ LightGlue matches the two descriptor sets
OutputPer image: up to 1000 keypoints; across the pair: M matched index pairs + a confidence each
Quantizationfp32 (both ONNX graphs)
Runtimeonnxruntime-web (raw ONNX Runtime Web) β€” no transformers.js matcher class exists
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~51 MB total (ALIKED ~6 MB + LightGlue ~45 MB), cached after first load
LicenseALIKED (BSD-3) Β· LightGlue (Apache-2.0) Β· ONNX exports per the repo card
Web APIsWebAssembly, Web Workers, OffscreenCanvas, Canvas, FileReader β€” all Baseline widely available

Run it

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.

Image A

Image B

12Β°
0.90Γ—
0.00

See inside β€” match confidence

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.

Match a pair to see the confidence histogram.

Why it matters

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.

Use cases

Basics

Match a scene against a rotated/scaled copy and watch the correspondence lines track the transform.

Practical

Duplicate detector: upload two photos and get a "same scene?" verdict from the match count + inliers.

Wild

Auto-align: estimate the rotation/scale between two views from the matches and overlay B onto A.

Multi-model

Retrieve & verify: DINOv2 embeddings shortlist the closest gallery image, then LightGlue confirms it geometrically.

How the API works

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.

References