An experimental repository for implementing image processing using ONNX graphs.
Each operation is exported as an ONNX file and included in the repository.
An inference demo using the exported ONNX models is available at the following page.
*See below for Python inference demo.
You can also perform image processing using onnx-cv-graph through a visual node editor available in the following repository.
An experimental feature to export the constructed graph as a single ONNX file is also implemented.
- Repository: https://github.com/Kazuhito00/onnx-cv-graph-node-editor
- Web Demo: https://kazuhito00.github.io/onnx-cv-graph-node-editor

- Image processing implemented entirely using ONNX operators
- Each operation is exported as an ONNX file and included in the repository
- Multiple operations can be chained and exported as a single ONNX file
This repository aims to explore the following:
- Validating image processing that can be implemented purely with ONNX operations
- Ensuring cross-platform and cross-language reproducibility via ONNX
- Leveraging ONNX Runtime for GPU/WebGL/TensorRT/DirectML offloading
- Combining multiple image processing operations into a single distributable ONNX model
Python 3.10 or later
numpy 2.4.2 or later
onnx 1.20.1 or later
onnxruntime 1.24.2 or later
opencv-python 4.13.0.92 or later
pyvis 0.3.2 or later
pytest 9.0.2 or later
scipy 1.17.1 or later
# Clone repository
git clone https://github.com/Kazuhito00/onnx-cv-graph
cd onnx-cv-graph
# Install Python packages
pip install -r requirements.txtRun the following script to export all ONNX files.
Pre-tested ONNX files are already included in the repository, so this step is not required if you only want to run inference.
python src/export_all.py
python -m pytest tests/ -vSee TEST_DESIGN.md for testing guidelines.
A list of implemented and planned image processing operations is available in MODELS.md.
Grayscale conversion
python example_grayscale.pyGrayscale conversion using ChainOp (single ONNX export)
python example_grayscale_chainop.pypython -m http.server 8080
# http://localhost:8080/example_app.htmlREADME.md # README (Japanese)
README_EN.md # README (English)
MODELS.md # Implemented / planned image processing list
TEST_DESIGN.md # Testing guidelines
requirements.txt # Python dependencies
example_app.html # onnxruntime-web demo
src/
base.py # OnnxGraphOp abstract class
chain.py # ChainOp (serial composition of multiple ops)
export_all.py # Batch export + models_meta.json generation
onnx_cv_graph/ # Graph implementations
models/ # ONNX file storage
tests/ # pytest test cases
assets/ # Sample images and graph visualization HTML
Kazuhito Takahashi (https://x.com/KzhtTkhs)
onnx-cv-graph is under Apache-2.0 license.