ONNX Runtime-based CPU/GPU inference plugin for VapourSynth
Project description
VapourSynth-MLRT-ORT
This package contains the ONNX Runtime backend implementation of the vs-mlrt plugin.
Installation
To install the standard CPU/DirectML/CoreML package:
pip install vapoursynth-mlrt-ort
To install the CUDA-enabled package:
pip install vapoursynth-mlrt-ort-cuda --extra-index-url https://jaded-encoding-thaumaturgy.github.io/vs-wheels/simple
Building from source
Requirements
- C++ Compiler: C++20 compatible (e.g. MSVC 2019+, GCC, Clang)
- Dependencies:
onnxruntime(ONNX Runtime SDK)ONNXProtobuf
- Optional Backend Dependencies:
- DirectML (Windows): Requires DirectML SDK. Define the
DML_DIRenvironment/CMake variable to point to the SDK directory. - CUDA: Requires
CUDAToolkitandcuDNNSDKs. EnsureCUDA_PATH,CUDNN_PATH/CUDNN_HOMEare set correctly.
- DirectML (Windows): Requires DirectML SDK. Define the
Compilation
By default, the package builds the CPU backend (with CoreML on macOS and optionally DirectML on Windows):
uv build --package vapoursynth-mlrt-ort
To build the CUDA-enabled version, the package definition must first be updated using the helper script:
# Update pyproject.toml package configuration to target CUDA
uv run --script scripts/cuda_pyproject.py pyproject.toml
# Compile the CUDA package
uv build --package vapoursynth-mlrt-ort-cuda
Detailed parameter information from the parent project follows.
VapourSynth ONNX Runtime
The vs-onnxruntime plugin provides optimized CPU & CUDA runtime for some popular AI filters.
Building and Installation
To build, you will need ONNX Runtime, protobuf, ONNX and their dependencies.
Please refer to ONNX Runtime Docs for installation notes. Or, you can use our prebuilt Windows binary releases from AmusementClub.
Please refer to our github actions workflow for sample building instructions.
If you only use the CPU backend, then you just need to extract binary release into your vapoursynth/plugins directory.
However, if you also use the CUDA backend, you will need to download some CUDA libraries as well, please see the release page for details. Those CUDA libraries also need to be extracted into VS vapoursynth/plugins directory. The plugin will try to load them from vapoursynth/plugins/vsort/ directory or vapoursynth/plugins/vsmlrt-cuda/ directory.
Usage
Prototype: core.ort.Model(clip[] clips, string network_path[, int[] overlap = None, int[] tilesize = None, string provider = "", int device_id = 0, int verbosity = 2, bint cudnn_benchmark = True, bint builtin = False, string builtindir="models", bint fp16 = False, bint path_is_serialization = False, bint use_cuda_graph = False])
Arguments:
clip[] clips: the input clips, only 32-bit floating point RGB or GRAY clips are supported. For model specific input requirements, please consult our wiki.string network_path: the path to the network in ONNX format.int[] overlap: some networks (e.g. CNN) support arbitrary input shape where other networks might only support fixed input shape and the input clip must be processed in tiles. Theoverlapargument specifies the overlapping (horizontal and vertical, or both, in pixels) between adjacent tiles to minimize boundary issues. Please refer to network specific docs on the recommended overlapping size.int[] tilesize: Even for CNN where arbitrary input sizes could be supported, sometimes the network does not work well for the entire range of input dimensions, and you have to limit the size of each tile. This parameter specify the tile size (horizontal and vertical, or both, including the overlapping). Please refer to network specific docs on the recommended tile size.string provider: Specifies the device to run the inference on."CPU"or"": pure CPU backend"CUDA": CUDA GPU backend, requires Nvidia Maxwell+ GPUs."DML": DirectML backend"COREML": CoreML backend
int device_id: select the GPU device for the CUDA backend.'int verbosity: specify the verbosity of logging, the default is warning.- 0: fatal error only,
ORT_LOGGING_LEVEL_FATAL - 1: also errors,
ORT_LOGGING_LEVEL_ERROR - 2: also warnings,
ORT_LOGGING_LEVEL_WARNING - 3: also info,
ORT_LOGGING_LEVEL_INFO - 4: everything,
ORT_LOGGING_LEVEL_VERBOSE
- 0: fatal error only,
bint cudnn_benchmark: whether to let cuDNN use benchmarking to search for the best convolution kernel to use. Default True. It might incur some startup latency.bint builtin: whether to load the model from the VS plugins directory, see alsobuiltindir.string builtindir: the model directory under VS plugins directory for builtin models, default "models".bint fp16: whether to quantize model to fp16 for faster and memory efficient computation.bint path_is_serialization: whether thenetwork_pathargument specifies an onnx serialization of typebytes.bint use_cuda_graph: whether to use CUDA Graphs to improve performance and reduce CPU overhead in CUDA backend. Not all models are supported.int ml_program: select CoreML provider.- 0: NeuralNetwork
- 1: MLProgram
When overlap and tilesize are not specified, the filter will internally try to resize the network to fit the input clips. This might not always work (for example, the network might require the width to be divisible by 8), and the filter will error out in this case.
The general rule is to either:
- left out
overlap,tilesizeat all and just process the input frame in one tile, or - set all three so that the frame is processed in
tilesize[0]xtilesize[1]tiles, and adjacent tiles will have an overlap ofoverlap[0]xoverlap[1]pixels on each direction. The overlapped region will be throw out so that only internal output pixels are used.
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
Built Distributions
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 vapoursynth_mlrt_ort-15.16.tar.gz.
File metadata
- Download URL: vapoursynth_mlrt_ort-15.16.tar.gz
- Upload date:
- Size: 676.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcad8b87818a46f64e3d86a599bb586356a3eede5ae8645c8cb4b7b0a4ef6d75
|
|
| MD5 |
a12fefa26f026479218a20831846b690
|
|
| BLAKE2b-256 |
681711ce373b623327dac0538894378c904fd67b256f9cbd4900faa4380d4676
|
Provenance
The following attestation bundles were made for vapoursynth_mlrt_ort-15.16.tar.gz:
Publisher:
cd-publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_mlrt_ort-15.16.tar.gz -
Subject digest:
dcad8b87818a46f64e3d86a599bb586356a3eede5ae8645c8cb4b7b0a4ef6d75 - Sigstore transparency entry: 1733697033
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish.yml@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_mlrt_ort-15.16-py3-none-win_amd64.whl.
File metadata
- Download URL: vapoursynth_mlrt_ort-15.16-py3-none-win_amd64.whl
- Upload date:
- Size: 17.2 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33768fb81eb8b9d64711b33590272fed00ef2e49968d26f5311e1eca46224161
|
|
| MD5 |
67ff55777cc5519510a65d60ae0c59ae
|
|
| BLAKE2b-256 |
295c9c3f020660b454d7607e9843711523cff71fa99ccbce621eff295f656fd0
|
Provenance
The following attestation bundles were made for vapoursynth_mlrt_ort-15.16-py3-none-win_amd64.whl:
Publisher:
cd-publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_mlrt_ort-15.16-py3-none-win_amd64.whl -
Subject digest:
33768fb81eb8b9d64711b33590272fed00ef2e49968d26f5311e1eca46224161 - Sigstore transparency entry: 1733697625
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish.yml@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 9.8 MB
- Tags: Python 3, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d431a1b7658d6b61af3cbffd126de60dcb3dde6dde9888788ba8753d8329fde
|
|
| MD5 |
5e05e25e070072cdec32ecc573e34c0a
|
|
| BLAKE2b-256 |
4b817e72fd4c7275cfae736554302222bc9fb7823c93ae6521a51d92df0c77d6
|
Provenance
The following attestation bundles were made for vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
cd-publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
0d431a1b7658d6b61af3cbffd126de60dcb3dde6dde9888788ba8753d8329fde - Sigstore transparency entry: 1733697442
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish.yml@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 8.3 MB
- Tags: Python 3, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
479c8651fa1da0ad4eb601bcd45c5e9446329ff6f3dc768443d51ac56166a134
|
|
| MD5 |
a62083accf39f1cdba789477a2f856ea
|
|
| BLAKE2b-256 |
9fc76fa3dbdb968c3970d461057433ac63ca84fffa5eb87ebc26685f33f50028
|
Provenance
The following attestation bundles were made for vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:
Publisher:
cd-publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_mlrt_ort-15.16-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl -
Subject digest:
479c8651fa1da0ad4eb601bcd45c5e9446329ff6f3dc768443d51ac56166a134 - Sigstore transparency entry: 1733697228
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish.yml@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_x86_64.whl.
File metadata
- Download URL: vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: Python 3, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cee780ea0d391a9d7922e35d929179f13e53b419f49f5c35f48a9d70a8fa9467
|
|
| MD5 |
e975f6d15e584f47b08336f1250381b0
|
|
| BLAKE2b-256 |
d1eaf675c68cf5c6ce5ac6ef72e7557c974bc230bc85f106223d253e1789c388
|
Provenance
The following attestation bundles were made for vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_x86_64.whl:
Publisher:
cd-publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_x86_64.whl -
Subject digest:
cee780ea0d391a9d7922e35d929179f13e53b419f49f5c35f48a9d70a8fa9467 - Sigstore transparency entry: 1733697815
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish.yml@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_arm64.whl.
File metadata
- Download URL: vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_arm64.whl
- Upload date:
- Size: 9.0 MB
- Tags: Python 3, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f022cb4b84f9cb79d7eeacc386cc394c0fae349b06a5a824a54e07a9010aec1
|
|
| MD5 |
ac7646ebfdf9adc8cfef454c990a39d6
|
|
| BLAKE2b-256 |
97c8022205fd01566ed733ac22fddbc4a3a843b5b86b6d8ebabc5acfb0626121
|
Provenance
The following attestation bundles were made for vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_arm64.whl:
Publisher:
cd-publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_mlrt_ort-15.16-py3-none-macosx_15_0_arm64.whl -
Subject digest:
4f022cb4b84f9cb79d7eeacc386cc394c0fae349b06a5a824a54e07a9010aec1 - Sigstore transparency entry: 1733697953
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish.yml@fab64f5a64e773acb2821f0d92c6e6a70b83afa7 -
Trigger Event:
workflow_dispatch
-
Statement type: