talira

Accelerated features for lightweight image matching

open sourceApache-2.0self-hostablefree

XFeat is a fast, lightweight learned keypoint detector and descriptor (CVPR 2024) from VeRLab at UFMG. A small convolutional network outputs keypoints, compact 64-dimensional descriptors and a reliability map, and it supports both sparse matching and a semi-dense mode with match refinement. It runs in real time on a laptop CPU at VGA resolution with plain PyTorch, aims at embedded devices such as Jetson and Raspberry Pi, and is more robust to viewpoint and lighting changes than ORB or SIFT. The repository includes pretrained weights, a torch.hub entry point, training code, a real-time homography demo, and LighterGlue, a smaller LightGlue trained on XFeat; everything is Apache-2.0.

Problems it solves

  • need a learned keypoint detector that runs in real time on a CPU without a GPU
  • ORB and SIFT lose track when the camera moves fast or the scene has little texture
  • match features between images on a Raspberry Pi or Jetson for a robot or AR app
  • drop-in faster replacement for SuperPoint with a permissive licence for commercial use
  • extract compact descriptors for thousands of images quickly in batches
  • register a live camera view to a reference image with a homography at video frame rate
  • semi-dense matching for image pairs where sparse keypoints aren't enough
  • lightweight local features to train my own matcher on top of

Features

  • real-time sparse inference on CPU for VGA images with vanilla PyTorch
  • compact 64-dimensional descriptors
  • sparse and semi-dense (XFeat*) matching with match refinement
  • batched inference: about 1,400 FPS on an RTX 4090 for VGA sparse extraction, per the README
  • only depends on PyTorch
  • pretrained weights in the repository and a torch.hub entry point
  • LighterGlue: a LightGlue variant trained on XFeat, about three times faster than LightGlue
  • training code with MegaDepth and synthetic COCO pairs
  • real-time webcam demo comparing XFeat, ORB and SIFT with homography registration
  • MegaDepth-1500 and ScanNet-1500 evaluation scripts

Alternatives

The same job

These do what XFeat does.

  1. LightGlue Local feature matching at light speed
  2. RoMa Robust dense feature matching
  3. OpenCV Open Source Computer Vision Library

Compare XFeat with the top 3