Skip to main content

OnnxSlim: A Toolkit to Help Optimize Onnx Model

Project description

OnnxSlim Logo OnnxSlim Logo

DeepWiki

OnnxSlim can help you slim your onnx model, with less operators, but same accuracy, better inference speed.

Installation

Using Prebuilt

pip install onnxslim

Install From Source

pip install git+https://github.com/inisis/OnnxSlim@main

Install From Local

git clone https://github.com/inisis/OnnxSlim && cd OnnxSlim/
pip install .

How to use

Bash

onnxslim your_onnx_model slimmed_onnx_model

Inscript

import onnx
import onnxslim

model = onnx.load("model.onnx")
slimmed_model = onnxslim.slim(model)

if slimmed_model:
    onnx.save(slimmed_model, "slimmed_model.onnx")

For more usage, see onnxslim -h or refer to our examples

Projects using OnnxSlim

NVIDIA/TensorRT-Model-Optimizer alibaba/MNN
ultralytics/ultralytics Mozilla/smart_autofill
alibaba/MNN-LLM huggingface/transformers.js
huggingface/optimum PaddlePaddle/PaddleOCR
ModelScope/FunASR CVCUDA/CV-CUDA
THU-MIG/yolov10 sunsmarterjie/yolov12
nndeploy/nndeploy deepghs/imgutils
amd/Quark

References

Contributors

Contact

Discord: https://discord.gg/nRw2Fd3VUS QQ Group: 873569894

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onnxslim-0.1.89.tar.gz (594.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onnxslim-0.1.89-py3-none-any.whl (237.1 kB view details)

Uploaded Python 3

File details

Details for the file onnxslim-0.1.89.tar.gz.

File metadata

  • Download URL: onnxslim-0.1.89.tar.gz
  • Upload date:
  • Size: 594.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for onnxslim-0.1.89.tar.gz
Algorithm Hash digest
SHA256 d322a2ce514e2e7660e9ec9fe65bc09fc854758c6969c9e9b13937efebabf7dd
MD5 0692e37a11d793aee967232f3ea8ecd7
BLAKE2b-256 4a61d3dade8ec94bc3466c0179727a1055b00f906c8cfdf31afa72e1648c60e1

See more details on using hashes here.

File details

Details for the file onnxslim-0.1.89-py3-none-any.whl.

File metadata

  • Download URL: onnxslim-0.1.89-py3-none-any.whl
  • Upload date:
  • Size: 237.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for onnxslim-0.1.89-py3-none-any.whl
Algorithm Hash digest
SHA256 6811302043fb4ab6521031ca328a67bfe0a12ac381a3f5388acdd3247eb8e02c
MD5 a4caea1e76259528baee19ecb96759ad
BLAKE2b-256 628b25d9bce90e5c97c889e55da56f51c74bea9ca71e3c867fcb2ade576af386

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page