Skip to content

ishandutta2007/HDGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HD Video Generator πŸš€

License: MIT

A command-line tool to upscale standard definition (SD) videos to high definition (HD) using the powerful Real-ESRGAN AI model.

Features ✨

  • AI-Powered Upscaling: Utilizes the RealESR_Gx4_fp16 model to intelligently increase video resolution.
  • Simple CLI: Easy-to-use command-line interface for quick video processing.
  • Efficient Processing: Uses opencv-python for frame-by-frame video manipulation and onnxruntime for fast model inference.

Prerequisites

  • Python 3.8+
  • Git

βš™οΈ Setup & Installation

  1. Clone the repository:

    git clone https://github.com/your-username/HDGenerator.git
    cd HDGenerator
  2. Create and activate a virtual environment:

    • On Windows:
      python -m venv venv
      .\venv\Scripts\activate
    • On macOS/Linux:
      python3 -m venv venv
      source venv/bin/activate
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Download the AI Model: You need to download the RealESR_Gx4_fp16.onnx model.

    • Download Link: You can find the model on the ONNX Model Zoo on Hugging Face. Look for the RealESR_Gx4_fp16.onnx file.
    • Placement: Create a models directory in the root of the project (if it doesn't exist) and place the downloaded .onnx file inside it.

    Your project structure should look like this:

    HDGenerator/
    β”œβ”€β”€ models/
    β”‚   └── RealESR_Gx4_fp16.onnx
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ main.py
    β”‚   └── upscaler.py
    β”œβ”€β”€ videos/
    β”‚   └── sample.mp4
    β”œβ”€β”€ .gitignore
    β”œβ”€β”€ README.md
    └── requirements.txt
    

πŸš€ Usage

Run the script from the root directory of the project. For example, to upscale the sample video provided in the videos folder, use the following command:

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

This will save the upscaled video in the videos directory with a _upscaled suffix.

Arguments:

  • --input (Required): The path to the SD video file you want to upscale.
  • --output (Optional): The path where the upscaled HD video will be saved. If not provided, it will be saved in the same directory as the input file with an _upscaled suffix.
  • --model_path (Optional): The path to the .onnx model file. Defaults to models/RealESR_Gx4_fp16.onnx.

Contributing 🀝

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License πŸ“„

This project is licensed under the MIT License.

About

HD video Generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages