Video Distortion Removal for VapourSynth
Also known as dewobble, warp stabilization, film or VHS distortion fix, atmospheric turbulence mitigation, or heat haze removal.
This is a partial implementation of the Turbulence Mitigation Transformer (only distortion removal, no deblurring). It does not do general video stabilization for shaky footage, only removes distortions within the frames. It is recommented to stabilize first if needed. Thanks to stinkybread for the comparison clips.
Installation
pip install -U vs_undistort --extra-index-url https://pypi.nvidia.com/
To enable the CPU/CUDA backends, install PyTorch with CUDA. (optional)
Usage
from vs_undistort import vs_undistort
clip = vs_undistort(clip, temp_window=10, window_overlap=0, interpolation="bicubic", backend="tensorrt", tiles=1, overlap=8, engine_folder=None)
clip
Distorted clip. Must be in RGBH format.
temp_window
Temporal window length. How many frames are grouped together and processed as a single chunk. Larger means higher VRAM requirements, but better temporal averaging and slower distortions can be removed. If this is too small, some distortions may not get removed, small jumps/hitches may be visible between windows and seams from tiling may become more obvious.
window_overlap (optional)
Overlap between temporal windows. Larger is slower. Increase if jumps/hitches between windows are noticeable.
interpolation (optional)
The interpolation mode used to warp the frames:
bilinearMore blurry.bicubicNo blur, but may oversharpen slightly.
backend (optional)
The backend used to run the model:
cpuCPU mode (very slow).cudaGPU mode using CUDA. Requires any Nvidia GPU (fast).tensorrtGPU mode using TensorRT. Requires an Nvidia RTX GPU. On the first run, this mode will automatically build an engine, which may take a few minutes. Changing interpolation, temp_window, or input dimensions will trigger rebuilding, but previously build engines are stored (very fast, low vram).
tiles (optional)
Amount of tiles to split the frames into. A higher amount reduces VRAM requirements, but also worsens spatial averaging. Default tiles=1 uses the full frame.
overlap (optional)
Overlap from one tile to the next. Increase if seams between tiles are visible. Does nothing when tiles=1.
engine_folder (optional)
Optional path to the TensorRT engine storage location. By default engines are stored in vs_undistort/engines. Only affects the TensorRT backend.
Benchmarks
| Hardware | Resolution | TensorRT | CUDA |
|---|---|---|---|
| RTX 4090 | 720x480 | ~35 fps | ~6.5 fps |
| RTX 4090 | 1440x1080 | ~7.5 fps | ~1.5 fps |
| RTX 4090 | 2880x2160 | ~2 fps | ~0.5 fps |
Metadata
Release files for vs-undistort 2.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vs_undistort-2.3.1.tar.gz | 16.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vs_undistort-2.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.8 MB
Release files / vs_undistort-2.3.1.tar.gz
| Download URL | vs_undistort-2.3.1.tar.gz |
|---|---|
| Size | 16.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f34288942b5dd295c856b781ba94ebf7a65f9263b61bef48b392f920aea923c
|
|
BLAKE2b-256 checksum How to use checksums |
c0fc704d4d0dd5fa82013f84757b1e59ea9b107b61425f4978b475201d6cc08b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / vs_undistort-2.3.1-py3-none-any.whl
| Download URL | vs_undistort-2.3.1-py3-none-any.whl |
|---|---|
| Size | 16.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d21ed10b3f6c131ab11dfc41724ad59cc38cd8f4fb54b3acc0dba76c306bdea5
|
|
BLAKE2b-256 checksum How to use checksums |
e5da48ec38d0c6fd110d48a71c71fd4b0b6595411da7898b9b6e224bb7fce8a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency log