# Kornia ONNX Repository Welcome to the **Kornia ONNX Repository**! This repository hosts ONNX files for models and operators related to the Kornia computer vision library. Here, you'll find pre-trained models, custom operators, and resources to accelerate your machine learning and computer vision workflows using ONNX format. ![Kornia ONNX](./banner.jpeg) ## Repository Structure By default, we include ONNX models with dynamic shapes. If the model is exported with a specific input shape, it would be noted in the filename such as `XXX_512x512.onnx`. The repository is organized into two main folders: ### 1. **Operators** This folder contains various ONNX operators used within the Kornia library. These operators are designed to be modular and can be integrated into different models or workflows. Each operator comes with a brief description and example usage. ### 2. **Models** This folder contains complete models built with Kornia and exported to ONNX format. These models are designed for various computer vision tasks such as image processing, stereo vision, and more. Each model is accompanied by a detailed description of its purpose and how to use it. ## Getting Started Install Kornia library: ```shell pip install -U kornia ``` To chain many operators or models into one graph, follow these steps: ```python import numpy as np from kornia.onnx import ONNXSequential # Initialize ONNXSequential with two models onnx_seq = ONNXSequential("kornia.color.gray.RgbToGrayscale.onnx", "kornia.geometry.transform.flips.Hflip.onnx") # Prepare some input data input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) # Perform inference outputs = onnx_seq(input_data) # Print the model outputs print(outputs) ``` ## Contribution We welcome contributions! If you'd like to add your own ONNX operators or models, feel free to open a pull request. Please ensure that you include relevant documentation and example usage for any new additions. Thank you for using the Kornia ONNX Repository! Feel free to explore and contribute to the growing collection of operators and models.