A command line tool for parsing and displaying RKNN model information
Project description
RKNN CLI
A command line tool for parsing and displaying RKNN model information with FlatBuffers support.
Features
- Parse both FlatBuffers binary data and JSON metadata from RKNN files
- Extract detailed model information including format, compiler, runtime
- Display input/output tensor information with layout (NCHW) and data type
- Visualize FlatBuffers graph with Graphviz (SVG output)
- Python 3.8+ compatible
Installation
From PyPI (Recommended)
pip install rknncli
Development Installation
git clone https://github.com/your-username/rknncli.git
cd rknncli
pip install -e .
Usage
rknncli <path-to-rknn-model>
Example:
rknncli assets/base-encoder.rknn
Graph visualization:
rknncli assets/base-encoder.rknn --draw base-encoder.svg
Note: Graph visualization requires Graphviz installed and dot available in PATH.
Output Format
The tool prints comprehensive model information including FlatBuffers metadata:
Model: rknn model
Target Platform: rk3588
Format: RKNPU v2
Source: ONNX
Compiler: 2.1.0+708089d1(compiler version: 2.1.0)
Runtime: rk3588
Number of graphs: 1
Input information
--------------------------------------------------------------------------------
ValueInfo "base-mel": type FLOAT32, shape [1, 80, 3000], layout NCHW,
Output information
--------------------------------------------------------------------------------
ValueInfo "cross_k_0": type FLOAT16, shape [1, 1500, 512], layout NCHW,
ValueInfo "cross_v_0": type FLOAT16, shape [1, 1500, 512], layout NCHW,
Development
Prerequisites
- Python 3.8+
- FlatBuffers compiler (for schema updates)
Setup
# Clone the repository
git clone https://github.com/hebangwen/rknncli.git
cd rknncli
# Install in development mode
pip install -e .
# Run tests
rknncli assets/base-encoder.rknn
Updating FlatBuffers Schema
If you need to update the RKNN schema:
cd schemas
./generate_schema.sh
Publishing to PyPI
To publish a new version:
# Build the package
python -m build
# Upload to PyPI
./scripts/upload_to_pypi.sh
Changelog
See CHANGELOG.md for version history.
License
MIT License - see LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rknncli-0.3.2.tar.gz.
File metadata
- Download URL: rknncli-0.3.2.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36344ecfb567a8fe3bb38a30b9b2ddce48182502b9173f90fff9f32248f28fd9
|
|
| MD5 |
30e19a27e9335a968634cc50d89edc07
|
|
| BLAKE2b-256 |
902579414ad09ca84425b41c079f99a5ecbf501d641d14dd840224a6a6f0e15b
|
Provenance
The following attestation bundles were made for rknncli-0.3.2.tar.gz:
Publisher:
release.yml on hebangwen/rknncli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rknncli-0.3.2.tar.gz -
Subject digest:
36344ecfb567a8fe3bb38a30b9b2ddce48182502b9173f90fff9f32248f28fd9 - Sigstore transparency entry: 919575115
- Sigstore integration time:
-
Permalink:
hebangwen/rknncli@866e0ee44ab8188847cb1e4aa8668a6a3472a802 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/hebangwen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@866e0ee44ab8188847cb1e4aa8668a6a3472a802 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rknncli-0.3.2-py3-none-any.whl.
File metadata
- Download URL: rknncli-0.3.2-py3-none-any.whl
- Upload date:
- Size: 26.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ace7ed461a0ed2248211501af536991f1500d7602444f31bccbbb9ed32245a6f
|
|
| MD5 |
c1a0eeab83c8387e1bec43525d5cca46
|
|
| BLAKE2b-256 |
dce16c074adb67bde036a7e25c9898407ce23b5f93e40f7c844b42522d9b3c6e
|
Provenance
The following attestation bundles were made for rknncli-0.3.2-py3-none-any.whl:
Publisher:
release.yml on hebangwen/rknncli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rknncli-0.3.2-py3-none-any.whl -
Subject digest:
ace7ed461a0ed2248211501af536991f1500d7602444f31bccbbb9ed32245a6f - Sigstore transparency entry: 919575124
- Sigstore integration time:
-
Permalink:
hebangwen/rknncli@866e0ee44ab8188847cb1e4aa8668a6a3472a802 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/hebangwen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@866e0ee44ab8188847cb1e4aa8668a6a3472a802 -
Trigger Event:
push
-
Statement type: