--- id: scc4onnx version: "1.0.7" license: MIT License license_treatment: permissive maintenance: aging --- # 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. License: permissive · Maintenance: aging · Downloads: 83.0K/mo ## 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 above — 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 pip install scc4onnx uv add scc4onnx poetry add scc4onnx ## Installing 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_current - Install friction: low - Maintenance: aging - Downloads: 83.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ONNX tensor dimension conversion, NCHW NHWC converter, ONNX channel order conversion, RGB BGR swap ONNX, ONNX input transpose tool, ONNX model dimension reorder, ONNX input format converter, onnx-tools, model-conversion, tensor-layout [View on SkillFed](https://skillfed.io/packages/scc4onnx) · [View on PyPI](https://pypi.org/project/scc4onnx/)