A differentiable computer vision library for PyTorch: operators for image processing, geometric vision, data augmentation, and feature matching run in batches directly on GPU tensors, are mostly differentiable, and can be embedded directly into training pipelines.
Stars 12133 (+412 / 24h)
Reasons
- The authors claim there are over 1200 public operators, many of which are not available in torchvision: camera models and epipolar geometry, minimal solvers and RANSAC, local features and matching such as SIFT / DISK / ALIKED / XFeat / DeDoDe / LoFTR / LightGlue; different parameters can be used for each image in a single call
- The project aims to be a reference implementation for differentiable vision and geometry in the PyTorch ecosystem, emphasizing clear conventions, consistency tests, and honest benchmarks: the README documents both where it is fast (much faster than per-image CPU OpenCV on batched GPUs) and where it is slow (small operators like flip and crop are slower than torchvision; OpenCV is faster for single uint8 images)
- Most operators run under torch.compile, many can be exported to ONNX, and support status for each operator is documented publicly
Usage
- pip install kornia; example: gaussian_blur2d(x, (9, 9), sigma) where sigma can be a tensor with one value per image; AugmentationSequential applies the same random transformation synchronously to images, masks, boxes, and keypoints
Risks
- Simple operations with fixed parameters can be handled with a few lines of PyTorch or torchvision; half-precision still has known failure cases on CPU, and half-precision on CUDA / MPS is not covered by CI
- Speed comparison numbers come from the authors' benchmarks on an RTX 4090 and vary with hardware and workload; established project (founded in 2018), first appearance on this list this period; license Apache-2.0