kornia

🐍 Geometric Computer Vision Library for Spatial AI

What is kornia?

🐍 Geometric Computer Vision Library for Spatial AI

Overview of kornia

What it is

Kornia is a differentiable computer vision library built on top of PyTorch. It provides a collection of differentiable image processing and geometric vision algorithms, designed to integrate into existing AI workflows with batch transformations, auto-differentiation, and GPU acceleration.

Key features

  • Differentiable image processing operators: filters (Gaussian, Sobel, Median), transformations (Affine, Homography, Perspective), enhancements (Histogram Equalization, CLAHE, Gamma Correction), and edge detection (Canny, Laplacian, Sobel).
  • Advanced augmentations: AugmentationSequential, PatchSequential, VideoSequential, AutoAugment, RandAugment, TrivialAugment.
  • AI models: face detection (YuNet), feature matching (LoFTR, LightGlue), feature descriptors (DISK, DeDoDe, SOLD2), segmentation (SAM), classification (MobileViT, VisionTransformer).
  • Batched minimal solvers and robust estimation: find_fundamental, find_essential, solve_pnp_dlt, RANSAC for homography, fundamental, and essential models.
  • Differentiable geometry: depth to 3D and back, warp_frame_depth, remap, camera models with Brown–Conrady and Kannala–Brandt distortion, Lie groups (So3, Se3).
  • Local features on GPU: SIFT, HardNet, DISK, ALIKED, XFeat, DeDoDe, LoFTR, LightGlue with mutual-nearest-neighbour and ratio-test matchers.

Use cases

Kornia is suited for scenarios where a hand-written implementation becomes long or fragile, or where alternatives leave the GPU unused. It is used for breadth (1,200+ public operators), per-sample parameters in one batched call, batched minimal solvers and robust estimation, differentiable geometry, annotated augmentation (2D and 3D), local feature extraction and matching on GPU, morphology with arbitrary structuring elements, and compiling/exporting to ONNX. It is designed to be fast on batched tensors on a GPU.

Getting started

See the repository README for installation and quick-start instructions.

License and pricing

License: Apache-2.0. Pricing: open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/korniakornia.svg)](https://yunodb.com/tools/korniakornia?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/korniakornia?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/korniakornia.svg" alt="Featured on YunoDB" height="20"></a>