METADATA 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. Metadata-Version: 2.4
  2. Name: kornia
  3. Version: 0.8.2
  4. Summary: Open Source Differentiable Computer Vision Library for PyTorch
  5. Author-email: Edgar Riba <edgar@kornia.org>
  6. License: Apache-2.0
  7. Project-URL: Bug Tracker, https://github.com/kornia/kornia/issues
  8. Project-URL: Documentation, https://kornia.readthedocs.io/en/latest
  9. Project-URL: Download, https://github.com/kornia/kornia
  10. Project-URL: Issues, https://github.com/kornia/kornia/issues
  11. Project-URL: Homepage, https://kornia.github.io/
  12. Project-URL: Source Code, https://github.com/kornia/kornia
  13. Keywords: computer vision,deep learning,pytorch
  14. Classifier: Development Status :: 4 - Beta
  15. Classifier: Environment :: Console
  16. Classifier: Environment :: GPU
  17. Classifier: Intended Audience :: Developers
  18. Classifier: Intended Audience :: Education
  19. Classifier: Intended Audience :: Information Technology
  20. Classifier: Intended Audience :: Science/Research
  21. Classifier: License :: OSI Approved :: Apache Software License
  22. Classifier: Natural Language :: English
  23. Classifier: Operating System :: OS Independent
  24. Classifier: Programming Language :: Python :: 3 :: Only
  25. Classifier: Programming Language :: Python :: 3.9
  26. Classifier: Programming Language :: Python :: 3.10
  27. Classifier: Programming Language :: Python :: 3.11
  28. Classifier: Programming Language :: Python :: 3.12
  29. Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
  30. Classifier: Topic :: Scientific/Engineering :: Image Processing
  31. Classifier: Topic :: Software Development :: Libraries
  32. Requires-Python: >=3.9
  33. Description-Content-Type: text/markdown
  34. License-File: LICENSE
  35. Requires-Dist: kornia_rs>=0.1.9
  36. Requires-Dist: packaging
  37. Requires-Dist: torch>=2.0.0
  38. Provides-Extra: dev
  39. Requires-Dist: accelerate; extra == "dev"
  40. Requires-Dist: coverage; extra == "dev"
  41. Requires-Dist: diffusers; extra == "dev"
  42. Requires-Dist: ivy>=1.0.0.0; extra == "dev"
  43. Requires-Dist: mypy; extra == "dev"
  44. Requires-Dist: numpy<3; extra == "dev"
  45. Requires-Dist: onnx; extra == "dev"
  46. Requires-Dist: onnxruntime; extra == "dev"
  47. Requires-Dist: pillow; extra == "dev"
  48. Requires-Dist: pre-commit>=2; extra == "dev"
  49. Requires-Dist: pytest==8.3.5; extra == "dev"
  50. Requires-Dist: pytest-cov; extra == "dev"
  51. Requires-Dist: pytest-timeout; extra == "dev"
  52. Requires-Dist: requests; extra == "dev"
  53. Requires-Dist: setuptools>=61.2; extra == "dev"
  54. Requires-Dist: transformers<4.57; extra == "dev"
  55. Requires-Dist: types-requests; extra == "dev"
  56. Provides-Extra: x
  57. Requires-Dist: accelerate; extra == "x"
  58. Requires-Dist: onnxruntime-gpu>=1.16; sys_platform != "darwin" and extra == "x"
  59. Provides-Extra: docs
  60. Requires-Dist: furo; extra == "docs"
  61. Requires-Dist: ivy>=1.0.0.0; extra == "docs"
  62. Requires-Dist: kornia_moons; extra == "docs"
  63. Requires-Dist: matplotlib; extra == "docs"
  64. Requires-Dist: onnx; extra == "docs"
  65. Requires-Dist: onnxruntime; extra == "docs"
  66. Requires-Dist: opencv-python; extra == "docs"
  67. Requires-Dist: PyYAML>=5.1; extra == "docs"
  68. Requires-Dist: sphinx; extra == "docs"
  69. Requires-Dist: sphinx-autodoc-defaultargs; extra == "docs"
  70. Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
  71. Requires-Dist: sphinx-copybutton>=0.3; extra == "docs"
  72. Requires-Dist: sphinx-design; extra == "docs"
  73. Requires-Dist: sphinx-notfound-page; extra == "docs"
  74. Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
  75. Requires-Dist: sphinxcontrib-gtagjs; extra == "docs"
  76. Requires-Dist: sphinxcontrib-youtube; extra == "docs"
  77. Dynamic: license-file
  78. <div align="center">
  79. <p align="center">
  80. <img width="55%" src="https://github.com/kornia/data/raw/main/kornia_banner_pixie.png" />
  81. </p>
  82. ---
  83. English | [简体中文](README_zh-CN.md)
  84. <!-- prettier-ignore -->
  85. <a href="https://kornia.readthedocs.io">Docs</a> •
  86. <a href="https://colab.sandbox.google.com/github/kornia/tutorials/blob/master/nbs/hello_world_tutorial.ipynb">Try it Now</a> •
  87. <a href="https://kornia.github.io/tutorials/">Tutorials</a> •
  88. <a href="https://github.com/kornia/kornia-examples">Examples</a> •
  89. <a href="https://kornia.github.io//kornia-blog">Blog</a> •
  90. <a href="https://discord.gg/HfnywwpBnD">Community</a>
  91. [![PyPI version](https://badge.fury.io/py/kornia.svg)](https://pypi.org/project/kornia)
  92. [![Downloads](https://static.pepy.tech/badge/kornia)](https://pepy.tech/project/kornia)
  93. [![star](https://gitcode.com/kornia/kornia/star/badge.svg)](https://gitcode.com/kornia/kornia)
  94. [![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/HfnywwpBnD)
  95. [![Twitter](https://img.shields.io/twitter/follow/kornia_foss?style=social)](https://twitter.com/kornia_foss)
  96. [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENCE)
  97. </p>
  98. </div>
  99. **Kornia** is a differentiable computer vision library that provides a rich set of differentiable image processing and geometric vision algorithms. Built on top of [PyTorch](https://pytorch.org), Kornia integrates seamlessly into existing AI workflows, allowing you to leverage powerful [batch transformations](), [auto-differentiation]() and [GPU acceleration](). Whether you’re working on image transformations, augmentations, or AI-driven image processing, Kornia equips you with the tools you need to bring your ideas to life.
  100. ## Key Components
  101. 1. **Differentiable Image Processing**<br>
  102. Kornia provides a comprehensive suite of image processing operators, all differentiable and ready to integrate into deep learning pipelines.
  103. - **Filters**: Gaussian, Sobel, Median, Box Blur, etc.
  104. - **Transformations**: Affine, Homography, Perspective, etc.
  105. - **Enhancements**: Histogram Equalization, CLAHE, Gamma Correction, etc.
  106. - **Edge Detection**: Canny, Laplacian, Sobel, etc.
  107. - ... check our [docs](https://kornia.readthedocs.io) for more.
  108. 2. **Advanced Augmentations**<br>
  109. Perform powerful data augmentation with Kornia’s built-in functions, ideal for training AI models with complex augmentation pipelines.
  110. - **Augmentation Pipeline**: AugmentationSequential, PatchSequential, VideoSequential, etc.
  111. - **Automatic Augmentation**: AutoAugment, RandAugment, TrivialAugment.
  112. 3. **AI Models**<br>
  113. Leverage pre-trained AI models optimized for a variety of vision tasks, all within the Kornia ecosystem.
  114. - **Face Detection**: YuNet
  115. - **Feature Matching**: LoFTR, LightGlue
  116. - **Feature Descriptor**: DISK, DeDoDe, SOLD2
  117. - **Segmentation**: SAM
  118. - **Classification**: MobileViT, VisionTransformer.
  119. <details>
  120. <summary>See here for some of the methods that we support! (>500 ops in total !)</summary>
  121. | **Category** | **Methods/Models** |
  122. |----------------------------|---------------------------------------------------------------------------------------------------------------------|
  123. | **Image Processing** | - Color conversions (RGB, Grayscale, HSV, etc.)<br>- Geometric transformations (Affine, Homography, Resizing, etc.)<br>- Filtering (Gaussian blur, Median blur, etc.)<br>- Edge detection (Sobel, Canny, etc.)<br>- Morphological operations (Erosion, Dilation, etc.) |
  124. | **Augmentation** | - Random cropping, Erasing<br> - Random geometric transformations (Affine, flipping, Fish Eye, Perspecive, Thin plate spline, Elastic)<br>- Random noises (Gaussian, Median, Motion, Box, Rain, Snow, Salt and Pepper)<br>- Random color jittering (Contrast, Brightness, CLAHE, Equalize, Gamma, Hue, Invert, JPEG, Plasma, Posterize, Saturation, Sharpness, Solarize)<br> - Random MixUp, CutMix, Mosaic, Transplantation, etc. |
  125. | **Feature Detection** | - Detector (Harris, GFTT, Hessian, DoG, KeyNet, DISK and DeDoDe)<br> - Descriptor (SIFT, HardNet, TFeat, HyNet, SOSNet, and LAFDescriptor)<br>- Matching (nearest neighbor, mutual nearest neighbor, geometrically aware matching, AdaLAM LightGlue, and LoFTR) |
  126. | **Geometry** | - Camera models and calibration<br>- Stereo vision (epipolar geometry, disparity, etc.)<br>- Homography estimation<br>- Depth estimation from disparity<br>- 3D transformations |
  127. | **Deep Learning Layers** | - Custom convolution layers<br>- Recurrent layers for vision tasks<br>- Loss functions (e.g., SSIM, PSNR, etc.)<br>- Vision-specific optimizers |
  128. | **Photometric Functions** | - Photometric loss functions<br>- Photometric augmentations |
  129. | **Filtering** | - Bilateral filtering<br>- DexiNed<br>- Dissolving<br>- Guided Blur<br>- Laplacian<br>- Gaussian<br>- Non-local means<br>- Sobel<br>- Unsharp masking |
  130. | **Color** | - Color space conversions<br>- Brightness/contrast adjustment<br>- Gamma correction |
  131. | **Stereo Vision** | - Disparity estimation<br>- Depth estimation<br>- Rectification |
  132. | **Image Registration** | - Affine and homography-based registration<br>- Image alignment using feature matching |
  133. | **Pose Estimation** | - Essential and Fundamental matrix estimation<br>- PnP problem solvers<br>- Pose refinement |
  134. | **Optical Flow** | - Farneback optical flow<br>- Dense optical flow<br>- Sparse optical flow |
  135. | **3D Vision** | - Depth estimation<br>- Point cloud operations<br>- Nerf<br> |
  136. | **Image Denoising** | - Gaussian noise removal<br>- Poisson noise removal |
  137. | **Edge Detection** | - Sobel operator<br>- Canny edge detection | |
  138. | **Transformations** | - Rotation<br>- Translation<br>- Scaling<br>- Shearing |
  139. | **Loss Functions** | - SSIM (Structural Similarity Index Measure)<br>- PSNR (Peak Signal-to-Noise Ratio)<br>- Cauchy<br>- Charbonnier<br>- Depth Smooth<br>- Dice<br>- Hausdorff<br>- Tversky<br>- Welsch<br> | |
  140. | **Morphological Operations**| - Dilation<br>- Erosion<br>- Opening<br>- Closing |
  141. </details>
  142. ## Sponsorship
  143. Kornia is an open-source project that is developed and maintained by volunteers. Whether you're using it for research or commercial purposes, consider sponsoring or collaborating with us. Your support will help ensure Kornia's growth and ongoing innovation. Reach out to us today and be a part of shaping the future of this exciting initiative!
  144. <a href="https://opencollective.com/kornia/donate" target="_blank">
  145. <img src="https://opencollective.com/webpack/donate/button@2x.png?color=blue" width=300 />
  146. </a>
  147. ## Installation
  148. [![PyPI python](https://img.shields.io/pypi/pyversions/kornia)](https://pypi.org/project/kornia)
  149. [![pytorch](https://img.shields.io/badge/PyTorch_1.9.1+-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/locally/)
  150. ### From pip
  151. ```bash
  152. pip install kornia
  153. ```
  154. <details>
  155. <summary>Other installation options</summary>
  156. #### From source with editable mode
  157. ```bash
  158. pip install -e .
  159. ```
  160. #### For development with UV (Recommended)
  161. For development, Kornia uses [uv](https://github.com/astral-sh/uv) for fast Python package management and virtual environment creation. The project includes a `uv.lock` file for reproducible dependency management.
  162. ```bash
  163. ./setup_dev_env.sh
  164. ```
  165. This will set up a complete development environment with all dependencies using the lock file for reproducibility. For more details on dependency management and lock file usage, see [CONTRIBUTING.md](CONTRIBUTING.md).
  166. #### From Github url (latest version)
  167. ```bash
  168. pip install git+https://github.com/kornia/kornia
  169. ```
  170. </details>
  171. ## Quick Start
  172. Kornia is not just another computer vision library — it's your gateway to effortless Computer Vision and AI.
  173. <details>
  174. <summary>Get started with Kornia image transformation and augmentation!</summary>
  175. ```python
  176. import numpy as np
  177. import kornia_rs as kr
  178. from kornia.augmentation import AugmentationSequential, RandomAffine, RandomBrightness
  179. from kornia.filters import StableDiffusionDissolving
  180. # Load and prepare your image
  181. img: np.ndarray = kr.read_image_any("img.jpeg")
  182. img = kr.resize(img, (256, 256), interpolation="bilinear")
  183. # alternatively, load image with PIL
  184. # img = Image.open("img.jpeg").resize((256, 256))
  185. # img = np.array(img)
  186. img = np.stack([img] * 2) # batch images
  187. # Define an augmentation pipeline
  188. augmentation_pipeline = AugmentationSequential(
  189. RandomAffine((-45., 45.), p=1.),
  190. RandomBrightness((0.,1.), p=1.)
  191. )
  192. # Leveraging StableDiffusion models
  193. dslv_op = StableDiffusionDissolving()
  194. img = augmentation_pipeline(img)
  195. dslv_op(img, step_number=500)
  196. dslv_op.save("Kornia-enhanced.jpg")
  197. ```
  198. </details>
  199. <details>
  200. <summary>Find out Kornia ONNX models with ONNXSequential!</summary>
  201. ```python
  202. import numpy as np
  203. from kornia.onnx import ONNXSequential
  204. # Chain ONNX models from HuggingFace repo and your own local model together
  205. onnx_seq = ONNXSequential(
  206. "hf://operators/kornia.geometry.transform.flips.Hflip",
  207. "hf://models/kornia.models.detection.rtdetr_r18vd_640x640", # Or you may use "YOUR_OWN_MODEL.onnx"
  208. )
  209. # Prepare some input data
  210. input_data = np.random.randn(1, 3, 384, 512).astype(np.float32)
  211. # Perform inference
  212. outputs = onnx_seq(input_data)
  213. # Print the model outputs
  214. print(outputs)
  215. # Export a new ONNX model that chains up all three models together!
  216. onnx_seq.export("chained_model.onnx")
  217. ```
  218. </details>
  219. ## Multi-framework support
  220. You can now use Kornia with [TensorFlow](https://www.tensorflow.org/), [JAX](https://jax.readthedocs.io/en/latest/index.html), and [NumPy](https://numpy.org/). See [Multi-Framework Support](docs/source/get-started/multi-framework-support.rst) for more details.
  221. ```python
  222. import kornia
  223. tf_kornia = kornia.to_tensorflow()
  224. ```
  225. <p align="center">
  226. Powered by
  227. <a href="https://github.com/ivy-llc/ivy" target="_blank">
  228. <div class="dark-light" style="display: block;" align="center">
  229. <img class="dark-light" width="15%" src="https://raw.githubusercontent.com/ivy-llc/assets/refs/heads/main/assets/logos/ivy-long.svg"/>
  230. </div>
  231. </a>
  232. </p>
  233. ## Call For Contributors
  234. Are you passionate about computer vision, AI, and open-source development? Join us in shaping the future of Kornia! We are actively seeking contributors to help expand and enhance our library, making it even more powerful, accessible, and versatile. Whether you're an experienced developer or just starting, there's a place for you in our community.
  235. ### Accessible AI Models
  236. We are excited to announce our latest advancement: a new initiative designed to seamlessly integrate lightweight AI models into Kornia.
  237. We aim to run any models as smooth as big models such as StableDiffusion, to support them well in many perspectives.
  238. We have already included a selection of lightweight AI models like [YuNet (Face Detection)](), [Loftr (Feature Matching)](), and [SAM (Segmentation)](). Now, we're looking for contributors to help us:
  239. - Expand the Model Selection: Import decent models into our library. If you are a researcher, Kornia is an excellent place for you to promote your model!
  240. - Model Optimization: Work on optimizing models to reduce their computational footprint while maintaining accuracy and performance. You may start from offering ONNX support!
  241. - Model Documentation: Create detailed guides and examples to help users get the most out of these models in their projects.
  242. ### Documentation And Tutorial Optimization
  243. Kornia's foundation lies in its extensive collection of classic computer vision operators, providing robust tools for image processing, feature extraction, and geometric transformations. We continuously seek for contributors to help us improve our documentation and present nice tutorials to our users.
  244. ## Cite
  245. If you are using kornia in your research-related documents, it is recommended that you cite the paper. See more in [CITATION](./CITATION.md).
  246. ```bibtex
  247. @inproceedings{eriba2019kornia,
  248. author = {E. Riba, D. Mishkin, D. Ponsa, E. Rublee and G. Bradski},
  249. title = {Kornia: an Open Source Differentiable Computer Vision Library for PyTorch},
  250. booktitle = {Winter Conference on Applications of Computer Vision},
  251. year = {2020},
  252. url = {https://arxiv.org/pdf/1910.02190.pdf}
  253. }
  254. ```
  255. ## Contributing
  256. We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us. Please, consider reading the [CONTRIBUTING](./CONTRIBUTING.md) notes. The participation in this open source project is subject to [Code of Conduct](./CODE_OF_CONDUCT.md).
  257. ## Community
  258. - **Discord:** Join our workspace to keep in touch with our core contributors, get latest updates on the industry and be part of our community. [JOIN HERE](https://discord.gg/HfnywwpBnD)
  259. - **GitHub Issues:** bug reports, feature requests, install issues, RFCs, thoughts, etc. [OPEN](https://github.com/kornia/kornia/issues/new/choose)
  260. - **Forums:** discuss implementations, research, etc. [GitHub Forums](https://github.com/kornia/kornia/discussions)
  261. <a href="https://github.com/Kornia/kornia/graphs/contributors">
  262. <img src="https://contrib.rocks/image?repo=Kornia/kornia" width="60%" />
  263. </a>
  264. Made with [contrib.rocks](https://contrib.rocks).
  265. ## License
  266. Kornia is released under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for more information.