Skip to content

Latest commit

Β 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HD Video Generator πŸš€ β€” AI Video Upscaler & Super-Resolution CLI

HD Video Generator Banner

Awesome Discord License: MIT Python Version ONNX Runtime Model PRs Welcome GitHub followers

🌟 HD Video Generator is an open-source, lightweight, and high-performance command-line (CLI) tool to upscale Standard Definition (SD) videos to High Definition (HD/4K) using state-of-the-art Real-ESRGAN deep learning super-resolution models with ONNX Runtime and OpenCV.


πŸ“Œ Table of Contents πŸ“‘


πŸ“– Overview πŸ”

Are your vintage home videos, old animations, or low-resolution clips blurry and pixelated? πŸ“½οΈ HD Video Generator uses cutting-edge artificial intelligence and computer vision to restore, enhance, and upscale video frames to crystal-clear high definition. Powered by the optimized RealESR_Gx4_fp16 ONNX model, it delivers 4x spatial resolution improvements with sharp edges, rich colors, and reduced compression artifacts. 🎨✨


✨ Key Features πŸ’‘

  • πŸ€– AI-Powered 4x Video Upscaling: Harnesses the deep learning power of Real-ESRGAN (RealESR_Gx4_fp16) to reconstruct fine textures and realistic details.
  • ⚑ High-Performance ONNX Inference: Utilizes onnxruntime for blazing-fast, cross-platform, hardware-accelerated model execution.
  • πŸŽ₯ Robust Frame Processing: Leverages opencv-python for accurate frame-by-frame decoding, high-quality transformation, and seamless re-encoding.
  • πŸ’» Intuitive CLI Interface: Simple, developer-friendly command-line options with smart default output handling.
  • πŸ”’ 100% Local & Privacy-Friendly: All video processing runs locally on your machineβ€”no cloud uploads, subscriptions, or API rate limits! πŸ›‘οΈ
  • πŸ“¦ Lightweight & Extensible: Minimal dependencies and modular code structure for easy customization and pipeline integration. 🧩

🏷️ Keywords / Tags πŸ”–

video-upscaling Β· real-esrgan Β· super-resolution Β· ai-video-enhancer Β· onnxruntime Β· opencv Β· python Β· sd-to-hd Β· video-enhancement Β· deep-learning Β· computer-vision Β· image-restoration Β· video-processing


πŸ“‹ Prerequisites πŸ› οΈ

  • 🐍 Python: Version 3.8 or higher
  • πŸ™ Git: For cloning the repository
  • πŸ’» OS: Windows, macOS, or Linux

βš™οΈ Setup & Installation πŸš€

1. πŸ“₯ Clone the Repository

git clone https://github.com/ishandutta2007/HDGenerator.git
cd HDGenerator

2. 🌐 Create and Activate a Virtual Environment

  • Windows (PowerShell / Command Prompt): πŸͺŸ

    python -m venv venv
    .\venv\Scripts\activate
  • macOS / Linux: 🍎🐧

    python3 -m venv venv
    source venv/bin/activate

3. πŸ“¦ Install Dependencies

pip install -r requirements.txt

🧠 Model Download πŸ’Ύ

This project requires the Real-ESRGAN ONNX model weights (RealESR_Gx4_fp16.onnx):

  1. πŸ“₯ Download RealESR_Gx4_fp16.onnx directly from the ONNX Model Zoo on Hugging Face (ai-forever/Real-ESRGAN).
  2. πŸ“ Create a models/ directory in the project root (if not already present):
    mkdir models
  3. πŸ’Ύ Place RealESR_Gx4_fp16.onnx inside the models/ folder.

πŸ“ Project Structure πŸ—‚οΈ

HDGenerator/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ banner.svg              # Dynamic SVG header banner
β”‚   └── social-preview.gif      # Social preview animated GIF (640x320)
β”œβ”€β”€ models/
β”‚   └── RealESR_Gx4_fp16.onnx   # ONNX super-resolution model weights
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.py                 # CLI entry point & argument parser
β”‚   └── upscaler.py             # Video decoding, inference, & encoding pipeline
β”œβ”€β”€ videos/
β”‚   └── sample.mp4              # Sample input / demo video
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
└── requirements.txt

πŸš€ Usage & CLI Examples 🎬

Run the pipeline from the project root directory using Python:

🌟 Basic Upscaling

Upscale a video using default output naming (<original_name>_upscaled.mp4):

python src/main.py --input "videos/sample.mp4"

🎯 Custom Output Destination

Specify an exact path for the enhanced video output:

python src/main.py --input "videos/sample.mp4" --output "videos/sample_4k_enhanced.mp4"

🧠 Custom Model Path

Specify a different ONNX model variant if needed:

python src/main.py --input "videos/sample.mp4" --model_path "models/RealESR_Gx4_fp16.onnx"

πŸŽ›οΈ CLI Command Options

Argument Type Default Description
--input str (Required) Filepath to the input SD video to upscale.
--output str <input_dir>/<name>_upscaled.mp4 Destination filepath for the upscaled HD video.
--model_path str models/RealESR_Gx4_fp16.onnx Filepath to the .onnx super-resolution model.

🎬 Supported Formats & Capabilities 🎞️

  • πŸ“Ή Input Formats: MP4, AVI, MOV, MKV, and other standard formats supported by OpenCV.
  • πŸ“ Upscaling Factor: 4x spatial scaling (e.g., 480p SD $\rightarrow$ 1080p/4K HD).
  • πŸš€ Execution Providers: CPU and GPU (CUDA/DirectML) inference via onnxruntime / onnxruntime-gpu.

❓ Troubleshooting & FAQ πŸ’‘

⚑ Q: How do I enable GPU acceleration with ONNX Runtime?
To use NVIDIA CUDA acceleration, install onnxruntime-gpu instead of standard onnxruntime:
pip uninstall onnxruntime
pip install onnxruntime-gpu

Ensure compatible CUDA and cuDNN libraries are configured on your system.

πŸ“¦ Q: Where can I find more Real-ESRGAN ONNX weights?
Alternative checkpoints and specialized anime/photo enhancement models can be downloaded from Hugging Face or converted from PyTorch weights to ONNX format.

🀝 Contributing 🌟

Contributions, issues, and feature requests are welcome! πŸ’–

  1. 🍴 Fork the repository
  2. 🌿 Create your feature branch (git checkout -b feature/AmazingFeature)
  3. πŸ’Ύ Commit your changes (git commit -m 'feat: Add AmazingFeature')
  4. πŸ“€ Push to the branch (git push origin feature/AmazingFeature)
  5. πŸš€ Open a Pull Request

⭐ Star History

Star History Chart


πŸ“„ License πŸ“œ

Distributed under the MIT License. See LICENSE for more information. βš–οΈ

About

HD video Generator 🌟 Star if you like it! 🌟

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages