scc4onnx
Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel order of RGB and BGR. Simple Channel Converter for ONNX. Simple Channel Conversion for ONNX.
What it is and what it does
scc4onnx is a command-line and Python library tool for modifying ONNX model input specifications. It rewrites the dimension order of named input operations and optionally swaps RGB/BGR channel ordering, then inserts Transpose operations after the input to preserve downstream model behavior. The tool works by accepting a source ONNX file, applying the specified transformations, and writing a modified model file—or by accepting an in-memory ONNX graph object for programmatic use.
The package supports arbitrary tensor dimensions (not limited to 4D), allowing flexible reordering of any axis. It is typically used when adapting pre-trained models to different input conventions—for example, converting a model trained on NCHW-format images to accept NHWC input, or swapping color channel order to match a different preprocessing pipeline. The transformations are non-destructive: the model's internal computation graph remains unchanged, with the transpose operations ensuring outputs remain semantically identical.
Use it for:
- Convert a computer vision model from NCHW to NHWC format to match a different inference framework's input convention.
- Swap RGB to BGR channel ordering on model inputs to align with preprocessing pipelines that use different color spaces.
- Adapt stereo or multi-input models by reordering dimensions on multiple named inputs simultaneously.
- Prepare ONNX models for deployment on hardware or frameworks that expect specific tensor layouts.
- Batch-process multiple ONNX models via CLI to standardize input formats across a model zoo.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts ONNX model input tensor dimensions and channel ordering (NCHW ↔ NHWC, RGB ↔ BGR) by rewriting input operations and inserting compensating transposes.
Yes, if you work with ONNX models and need to adapt input tensor layouts or channel ordering. The package is lightweight, has no runtime dependencies, and carries permissive licensing. The aging maintenance status (last release 487 days ago) is a minor concern for a stable utility tool, but check whether your ONNX and onnx_graphsurgeon versions are compatible before relying on it in production.
Install
scc4onnx on PyPI
pip
pip install scc4onnxuv
uv add scc4onnxpoetry
poetry add scc4onnxInstalling scc4onnx
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging (487 days since last release), though the repository remains active and the package has been stable since its 2022 release.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for most commercial and open-source projects.
Quickstart
# CLI usage
$ pip install scc4onnx
$ scc4onnx --input_onnx_file_path model.onnx --output_onnx_file_path model_converted.onnx --input_op_names_and_order_dims input_op [0,2,3,1]
# Python usage
from scc4onnx import order_conversion
converted = order_conversion(
input_onnx_file_path='model.onnx',
output_onnx_file_path='model_converted.onnx',
input_op_names_and_order_dims={'input_op': [0,2,3,1]}
)
Requires onnx and onnx_graphsurgeon to be installed separately (not listed as package dependencies but referenced in setup documentation).
Verify before relying
- Whether onnx and onnx_graphsurgeon are truly optional or required at runtime despite not appearing in the dependency list.
- Scope of tensor dimension support beyond the documented NCHW/NHWC examples.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 487 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,968/month — #14,114 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scc4onnx-1.0.7-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
sng4onnxAutomatically generates and assigns operation…
permissive · top 15,000 on PyPI
sbi4onnxModifies ONNX model files to initialize or…
permissive · top 15,000 on PyPI
sio4onnxModifies the input and output shapes of ONNX…
permissive · top 15,000 on PyPI
scs4onnxCompresses ONNX model files by deduplicating…
permissive · top 15,000 on PyPI
svs4onnxSwaps connections between output and input…
permissive · top 15,000 on PyPI
soc4onnxChanges the opset version of an ONNX model…
permissive · top 15,000 on PyPI
ssi4onnxInfers and fills missing tensor shape…
permissive · top 15,000 on PyPI
snc4onnxMerges multiple ONNX neural network models into…
permissive · top 15,000 on PyPI
sor4onnxRenames input, output, and operator nodes in…
permissive · top 15,000 on PyPI
snd4onnxRemoves specified nodes from ONNX model graphs…
permissive · top 15,000 on PyPI