Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Kim2091/TSPAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TSPANv2 is Released!

Check it out here: https://github.com/Kim2091/TSPANv2 It's a massive improvement in temporal quality and reconstruction ability!


TSPANv1

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.

Getting Started

  1. Clone the repository:

    git clone https://github.com/Kim2091/TSPAN
  2. Install PyTorch with CUDA: Follow the instructions at pytorch.org.

  3. Install required packages:

    pip install -r requirements.txt

Usage

You can use TSPAN through the graphical user interface (GUI) or the command line.

TensorRT

For high-performance inference, refer to the TensorRT guide.

GUI Usage

For an easy-to-use experience with PyTorch or ONNX models, launch the GUI:

python vsr_gui.py
image

Command-Line Usage

For 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.mp4

ONNX Video upscaling:

python test_onnx.py --model_path model.onnx --input path/to/video.mp4 --output path/to/output.mp4

Key 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 (for libx264/libx265).
  • --providers: (ONNX only) Set ONNX Runtime execution providers.

Tools

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.

Credits (thanks all!)

  • Uses SCUNet's respository as a base
  • Uses a modified version of SPAN's architecture
  • Uses the additions made in both TSCUNet repositories

About

A temporal video upscaler based on SPAN

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages