Kornia — Differentiable Computer Vision Library
Kornia is an open-source, PyTorch-centric library that exposes a large set of differentiable computer-vision operators and utilities suitable for research and production workflows. It aims to make classic image processing, geometric vision and modern vision models first-class citizens in end-to-end differentiable pipelines.
Key features
- Differentiable image processing: filters (Gaussian, Sobel, median), edge detectors (Canny, Laplacian), morphological ops, color transforms, photometric adjustments — all implemented to support autograd and batched GPU execution.
- Geometric vision: affine / homography / perspective transforms, camera models, pose estimation (PnP), epipolar geometry, stereo/disparity tools and 3D transformations.
- Advanced augmentations: AugmentationSequential, PatchSequential, VideoSequential, AutoAugment/RandAugment/TrivialAugment and many randomized geometric/photometric transforms designed for training robust vision models.
- Feature and matching stack: detectors and descriptors (SIFT, DISK, DeDoDe, SOLD2, HardNet, etc.), and matching solutions (LoFTR, LightGlue, AdaLAM integrations) for robust image registration and correspondence.
- Prebuilt models: integrations or wrappers for common vision models (e.g., YuNet for face detection, SAM for segmentation, LoFTR for matching, MobileViT/VisionTransformer for classification) and tools to run/chain ONNX models via ONNXSequential.
- Multi-framework support: utilities to interoperate with TensorFlow, JAX and NumPy environments and to export or compose ONNX operators.
- Performance & dev ergonomics: batch-first APIs, GPU acceleration, utilities for exporting/chaining ONNX models, and recommended developer tooling (pixi) for reproducible dev environments.
Usage & install
- Typical install:
pip install korniaorpip install git+https://github.com/kornia/korniafor latest source. - Designed to be embedded in PyTorch training/inference loops so you can use Kornia ops inside nn.Module and rely on autograd.
Community, license & impact
- Open-source project maintained by contributors; licensed under Apache 2.0.
- Active repository with a large number of stars (~10k+) and community resources: docs, tutorials, examples repo, Discord and GitHub discussions/issues.
- The project provides a CITATION entry (Riba et al., WACV 2020) for academic use.
Direction & extensibility
Kornia emphasizes end-to-end vision model support and has signaled a focus on integrating Vision-Language Models (VLMs) and Vision-Language Agents (VLAs) for composable end-to-end vision pipelines. It is modular and welcoming to contributors who want to add operators, optimized model integrations, ONNX support or documentation/tutorial enhancements.
Who should use it
Researchers and engineers who need differentiable, GPU-accelerated image/geometry primitives inside PyTorch training or inference code — e.g., for data augmentation, image registration, geometric vision tasks, lightweight model integration, or building custom end-to-end vision pipelines.
