Check it out here: https://github.com/Kim2091/TSPANv2 It's a massive improvement in temporal quality and reconstruction ability!
TSPAN (Temporal SPAN) is a custom VSR architecture based on the original SPAN architecture. This modification aims to provide efficient and accessible temporal video upscaling. It supports PyTorch, ONNX, and TensorRT!
This is the inference code. To train a model, you'll want to use traiNNer-redux with the TSPAN config and a video dataset. To make a video dataset, try my other tool, video destroyer.
-
Clone the repository:
git clone https://github.com/Kim2091/TSPAN
-
Install PyTorch with CUDA: Follow the instructions at pytorch.org.
-
Install required packages:
pip install -r requirements.txt
You can use TSPAN through the graphical user interface (GUI) or the command line.
For high-performance inference, refer to the TensorRT guide.
For an easy-to-use experience with PyTorch or ONNX models, launch the GUI:
python vsr_gui.pyFor more advanced control, you can use the command-line scripts.
Video upscaling (PyTorch):
python test_vsr.py --model_path pretrained_models/tspan.pth --input path/to/video.mp4 --output path/to/output.mp4ONNX Video upscaling:
python test_onnx.py --model_path model.onnx --input path/to/video.mp4 --output path/to/output.mp4Key arguments for test_vsr.py and test_onnx.py:
--video_codec: Specify the video codec (e.g.,libx264,libx265).--crf: Set the Constant Rate Factor for quality (forlibx264/libx265).--providers: (ONNX only) Set ONNX Runtime execution providers.
Utility scripts are located in the tools/ directory.
Convert PyTorch model to ONNX:
python tools/convert_to_onnx.py --model pretrained_models/model.pth --output model.onnx--dynamic: Create a model that supports various input sizes.--fp16: Convert the model to FP16 for a speed boost.