Skip to content

KLing-Video-WatermarkRemover-Enhancer is an open-source tool developed to enhance and clean up videos generated by KLing. This project is designed to automatically remove watermarks from videos and apply advanced enhancement algorithms, improving the overall visual quality.

Notifications You must be signed in to change notification settings

chenwr727/KLing-Video-WatermarkRemover-Enhancer

Repository files navigation

English | 简体中文

KLing-Video-WatermarkRemover-Enhancer

Project Overview

KLing-Video-WatermarkRemover-Enhancer is an open-source tool designed specifically for processing videos generated by KLing. This tool integrates watermark removal and video enhancement features, making videos clearer and more professional, suitable for personal video optimization and batch video processing scenarios.

Demo

Features

  • Watermark Removal: Automatically detects and removes watermarks from KLing-generated videos, ensuring the video is clean.
  • Video Enhancement: Enhances video clarity, brightness, and contrast through advanced algorithms, improving the viewing experience.
  • Batch Processing: Supports processing multiple video files at once, efficiently managing large volumes of videos.

Installation

Follow these steps to install KLing-Video-WatermarkRemover-Enhancer:

git clone https://github.com/chenwr727/KLing-Video-WatermarkRemover-Enhancer.git
cd KLing-Video-WatermarkRemover-Enhancer
pip install -r requirements.txt

Configuration

The configuration file config.yaml defines the parameters for watermark removal.

watermark

This section configures the watermark removal parameters:

  • position: [556, 1233, 701, 1267]

    • This specifies the area for watermark removal, typically defining the top-left and bottom-right coordinates of a rectangular region.
    • The values represent (x1, y1, x2, y2) where (556, 1233) is the top-left corner and (701, 1267) is the bottom-right corner of the watermark.
  • ckpt_p: "./weights/sttn.pth"

    • Path to the watermark removal model weight file.
    • sttn.pth is a model based on the Spatio-Temporal Trajectory Network (STTN), commonly used for removing objects or watermarks from dynamic videos.
  • mask_expand: 30

    • Expands the watermark area by a given number of pixels.
    • Expanding the watermark region ensures no residue or artifacts are left around the edges after removal.
  • neighbor_stride: 10

    • Controls the stride size when computing neighboring frames using the Spatio-Temporal Trajectory Network.
    • A larger stride reduces computation but may affect the watermark removal quality.

enhance

This section configures the video enhancement parameters:

  • RealESRGAN_model_path: "./weights/RealESRGAN_x2plus.pth"

    • This is the path to the Real-ESRGAN model weights, which are used to enhance the resolution and quality of the video.
    • More information about the model can be found in Real-ESRGAN/inference_realesrgan.py.
    • RealESRGAN_x2plus.pth
  • GFPGANer_model_path: "./weights/GFPGANv1.4.pth"

    • This is the path to the GFPGAN model weights, which are used for face enhancement within the video, improving clarity and detail in facial features.
    • More information about the model can be found in Real-ESRGAN/cog_predict.py.
    • GFPGANv1.4.pth

Usage

To remove watermarks and enhance videos using KLing-Video-WatermarkRemover-Enhancer, simply run the following command:

python main.py --input path/to/video.mp4 --remove-watermark --enhance-video

Parameter Description

  • --input: Path to the input video or folder.
  • --remove-watermark: Enables the watermark removal function when specified.
  • --enhance-video: Enables video enhancement when specified.

Example

python main.py --input example.mp4 --remove-watermark --enhance-video

Project Structure

  • main.py: Main program entry point, responsible for managing the entire processing workflow.
  • modules/: Contains functional modules (such as erasing watermarks, enhancing videos, and more).
  • utils/: Contains general utilities such as logging, video processing tools, etc.
  • config.yaml: Configuration file for setting watermark parameters.

References

About

KLing-Video-WatermarkRemover-Enhancer is an open-source tool developed to enhance and clean up videos generated by KLing. This project is designed to automatically remove watermarks from videos and apply advanced enhancement algorithms, improving the overall visual quality.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages