vsr is a Rust CLI for removing hardcoded subtitles from videos.
The project is still in early development, but the STTN-based subtitle removal pipeline is wired up end-to-end for the ONNX runtime.
remove-subtitlessubcommand with validated argumentsmanualandautodetection modes- rectangle parsing for
--subtitle-rect x,y,width,height - STTN ONNX pipeline for frame extraction, inpainting, and video re-encoding
- integration tests for CLI and pipeline behavior
The binary currently looks for a compatible STTN ONNX model in one of these locations:
models/sttn/infer_model.onnxVSR_STTN_MODEL=/absolute/path/to/infer_model.onnx- Hugging Face cache via
VSR_STTN_HF_REPO=<repo>andVSR_STTN_HF_FILE=<path/to/model.onnx>
The latest public STTN checkpoint that I could verify on Hugging Face on 2026-04-02 is:
- Repo:
https://huggingface.co/spaces/paulpang/video-subtitle-remover - Direct download:
https://huggingface.co/spaces/paulpang/video-subtitle-remover/resolve/main/backend/models/sttn/infer_model.pth
You can download that original checkpoint with:
mkdir -p models/sttn
curl -L https://huggingface.co/spaces/paulpang/video-subtitle-remover/resolve/main/backend/models/sttn/infer_model.pth -o models/sttn/infer_model.pthImportant:
- Hugging Face currently exposes a PyTorch checkpoint named
infer_model.pth. - This Rust CLI currently expects an ONNX artifact named
infer_model.onnx. - Downloading the
.pthfile as-is will not makevsrrunnable yet. - After you export or convert a compatible ONNX model, place it at
models/sttn/infer_model.onnxor pointVSR_STTN_MODELat the converted file. - If you host a converted ONNX artifact on Hugging Face, set both
VSR_STTN_HF_REPOandVSR_STTN_HF_FILE; the binary will download it throughhf-hubwhen no local model is present.
For the conversion flow, see docs/sttn-model-conversion.md.
src/main.rs: binary entrypointsrc/lib.rs: shared crate exportssrc/cli/: CLI parsing and validationsrc/app/: top-level application runnersrc/types/: shared domain typestests/: integration testsdocs/superpowers/: plans and design docs
Build the project:
cargo buildRun the CLI help:
cargo run -- --helpTry the current command surface:
cargo run -- remove-subtitles --input in.mp4 --output out.mp4 --detect manual --subtitle-rect 10,20,300,60Run the full pipeline with a configured ONNX model:
VSR_STTN_MODEL=/absolute/path/to/infer_model.onnx \
cargo run -- remove-subtitles \
--input in.mp4 \
--output out.mp4 \
--detect manual \
--subtitle-rect 10,20,300,60 \
--model sttn \
--runtime onnx \
--device cpuOr let the binary fetch a hosted ONNX artifact from Hugging Face:
VSR_STTN_HF_REPO=your-org/your-model-repo \
VSR_STTN_HF_FILE=models/sttn/infer_model.onnx \
cargo run -- remove-subtitles \
--input in.mp4 \
--output out.mp4 \
--detect manual \
--subtitle-rect 10,20,300,60 \
--model sttn \
--runtime onnx \
--device cpuRun tests:
cargo test