Implementation:Kornia Kornia IO Maps Configuration
| Knowledge Sources | |
|---|---|
| Domains | ONNX, Pipeline_Design |
| Last Updated | 2026-02-09 15:00 GMT |
Overview
Pattern for configuring input-output tensor name mappings between chained ONNX models in Kornia's ONNXSequential.
Description
This is a configuration pattern, not a library API. The io_maps parameter of ONNXSequential is a list of (output_name, input_name) tuples that specify how to connect consecutive models. Users must inspect each model's graph to determine the correct tensor names. The mapping is applied when combining ONNX graphs into a single sequential pipeline.
Usage
Define io_maps when creating ONNXSequential with models whose output/input names do not automatically align.
Code Reference
| Repository | https://github.com/kornia/kornia |
|---|---|
| File | kornia/onnx/sequential.py
|
| Lines | L52–70 |
| Interface | io_maps: list[tuple[str, str]] parameter for ONNXSequential constructor
|
| Import | N/A (configuration parameter, not standalone import) |
I/O Contract
Inputs
| Parameter | Type | Description |
|---|---|---|
io_maps |
list[tuple[str, str]] |
Defines (output_name, input_name) pairs between consecutive models
|
Outputs
Configured routing for the sequential pipeline.
Usage Examples
Mapping resize output to classifier input
from kornia.onnx import ONNXSequential
# Connect the "resized" output of the resize model
# to the "input_image" input of the classifier model
pipeline = ONNXSequential(
"hf://operators/resize",
"hf://operators/classifier",
io_maps=[("resized", "input_image")],
)