python video hard subtitle removal embedded subtitle removal tool vsr

Project Description

Open source address:https://github.com/YaoFANGUK/video-subtitle-remover

Video-subtitle-remover (VSR) is a software based on AI technology that removes hard subtitles from videos.
Mainly implements the following functions:

  • Lossless resolutionRemove hard subtitles from the video and generate a file with subtitles removed
  • Through the super powerful AI algorithm model, the area where the subtitle text is removed is filled (non-adjacent pixel filling and mosaic removal)
  • Support custom subtitle position, only remove subtitles in the defined position (incoming position)
  • Supports automatic removal of all text from the entire video (no location is passed in)

vsr

Directly download the compressed package, decompress it and run it. If it cannot run, follow the tutorial below and try to install the conda environment from the source code and run it.

download link:

Windows GPU version book v1.0.0 (GPU):

Only for users with Nvidia graphics cards (AMD graphics cards will not work)

Demo

Source code usage instructions

Do not use this project without Nvidia graphics card, minimum configuration:

GPU: GTX 1060 or above

CPU: Supports AVX instruction set

1. Download and install Miniconda
2. Create and activate the virtual machine environment

(1) Switch to the directory where the source code is located:

cd <源码所在目录>

For example: If your source code is placed under the tools file on drive D, and the source code folder is named video-subtitle-remover, entercd D:/tools/video-subtitle-remover-main

(2) Create and activate conda environment

conda create -n videoEnv python=3.8
conda activate videoEnv
3. Install dependency files

Please make sure you have installed python 3.8+, use conda to create a project virtual environment and activate the environment (it is recommended to create a virtual environment to run to avoid subsequent problems)

  • Install CUDA and cuDNN

    Linux users
    (1) Download CUDA 11.7
    wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run
    (2) Install CUDA 11.7
    sudo sh cuda_11.7.0_515.43.04_linux.run

    1. Enter accept

    2. Select CUDA Toolkit 11.7 (if you have not installed the nvidia driver, select Driver. If you have installed the nvidia driver, please do not select driver), then select install and press Enter.

    3. Add environment variables

    Add the following content to ~/.bashrc

    # CUDA
    export PATH=/usr/local/cuda-11.7/bin${PATH:+:${PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

    make it effective

    source ~/.bashrc
    (3) Download cuDNN 8.4.1

    Domestic:cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz Delivery: 57mg

    国外:cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz

    (4) Install cuDNN 8.4.1
     tar -xf cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz
     mv cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive cuda
     sudo cp ./cuda/include/* /usr/local/cuda-11.7/include/
     sudo cp ./cuda/lib/* /usr/local/cuda-11.7/lib64/
     sudo chmod a+r /usr/local/cuda-11.7/lib64/*
     sudo chmod a+r /usr/local/cuda-11.7/include/*
    Windows users
    (1) Download CUDA 11.7
    cuda_11.7.0_516.01_windows.exe
    (2) Install CUDA 11.7
    (3) Download cuDNN 8.2.4

    cudnn-windows-x64-v8.2.4.15.zip

    (4) Install cuDNN 8.2.4

    Copy the files in the bin, include, and lib directories in the cuda folder decompressed by cuDNN to the corresponding directory in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\

  • Install the GPU version of Paddlepaddle:

    • windows:

      python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
      
    • Linux:

      python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
      
  • Install the GPU version of Pytorch:

    conda install pytorch==2.0.1 torchvision==0.15.2 pytorch-cuda=11.7 -c pytorch -c nvidia
    

    Or use

    pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu117
    
  • Install other dependencies:

    pip install -r requirements.txt
    
4. Run the program
  • Run the graphical interface
python gui.py
  • Run the command line version (CLI)
python ./backend/main.py

common problem

  1. CondaHTTPError

Place the .condarc in the project in the user directory (C:/Users/<your username>). If the file already exists in the user directory, overwrite it.

Solution: https://zhuanlan.zhihu.com/p/260034241

  1. 7z file decompression error

Solution: Upgrade the 7-zip decompressor to the latest version

Guess you like

Origin blog.csdn.net/flavioy/article/details/134260677