Skip to main content

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
microsoft/olive-recipes quic/cloud-ai-sdk
open-edge-platform/geti NVIDIA-TAO/tao-pytorch
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

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.95.tar.gz (598.4 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.95-py3-none-any.whl (238.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onnxslim-0.1.95.tar.gz
  • Upload date:
  • Size: 598.4 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.95.tar.gz
Algorithm Hash digest
SHA256 f3acc3aeadae7581920fde47a31a64c7fad8e825db41d3826487414d21c086e3
MD5 a84ae8b0000a4fed7eab847fb01acaa8
BLAKE2b-256 8a8be938222650599e46cbec718b520fc269929cece7f4bbc8ddcf0d9678c469

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onnxslim-0.1.95-py3-none-any.whl
  • Upload date:
  • Size: 238.7 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.95-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b6a5cffab038f3fc15f4695a6648eee85b9791f61fa934eb90aaa5c385a61c
MD5 ec1c8495d8ad6ad9a5553e4920e35d2e
BLAKE2b-256 64f65e1d940c8c3f25a0904b1188b095a82d99808339fe347f977996f2cc2c7d

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

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