## 项目简介 ![License](https://img.shields.io/badge/License-Apache%202-red.svg) ![python version](https://img.shields.io/badge/Python-3.8+-blue.svg) ![support os](https://img.shields.io/badge/OS-Windows/macOS/Linux-green.svg) Video-subtitle-remover (vsr) 是一款基于AI技术,将视频中的硬字幕去除的软件。 主要实现了以下功能: - **无损分辨率**将视频中的硬字幕去除,生成去除字幕后的文件 - 通过超强AI算法模型,对去除字幕文本的区域进行填充(非相邻像素填充与马赛克去除) - 支持自定义字幕位置,仅去除定义位置中的字幕(传入位置) - 支持全视频自动去除所有文本(不传入位置) **程序界面:** demo.png **效果演示:** demo.jpg ## 视频演示 点击查看演示视频👇

demo.gif

## 源码使用说明 > **无Nvidia显卡请勿使用本项目**,最低配置: > > **GPU**:GTX 1060或以上显卡 > > CPU: 支持AVX指令集 #### 1. 下载安装Miniconda - Windows: Miniconda3-py38_4.11.0-Windows-x86_64.exe - Linux: Miniconda3-py38_4.11.0-Linux-x86_64.sh #### 2. 创建并激活虚机环境 (1)切换到源码所在目录: ```shell cd <源码所在目录> ``` > 例如:如果你的源代码放在D盘的tools文件下,并且源代码的文件夹名为video-subtitle-remover,就输入 ```cd D:/tools/video-subtitle-remover-main``` (2)创建激活conda环境 ```shell conda create -n videoEnv python=3.8 ``` ```shell conda activate videoEnv ``` #### 3. 安装依赖文件 请确保你已经安装 python 3.8+,使用conda创建项目虚拟环境并激活环境 (建议创建虚拟环境运行,以免后续出现问题) - 安装CUDA和cuDNN
Linux用户
(1) 下载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) 安装CUDA 11.7
sudo sh cuda_11.7.0_515.43.04_linux.run

1. 输入accept

2. 选中CUDA Toolkit 11.7(如果你没有安装nvidia驱动则选中Driver,如果你已经安装了nvidia驱动请不要选中driver),之后选中install,回车

3. 添加环境变量

在 ~/.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}}

使其生效

source ~/.bashrc
(3) 下载cuDNN 8.4.1

国内:cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz 提取码:57mg

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

(4) 安装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用户
(1) 下载CUDA 11.7
cuda_11.7.0_516.01_windows.exe
(2) 安装CUDA 11.7
(3) 下载cuDNN 8.2.4

cudnn-windows-x64-v8.2.4.15.zip

(4) 安装cuDNN 8.2.4

将cuDNN解压后的cuda文件夹中的bin, include, lib目录下的文件复制到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\对应目录下

- 安装GPU版本Paddlepaddle: - windows: ```shell python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html ``` - Linux: ```shell python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html ``` - 安装GPU版本Pytorch: ```shell conda install pytorch==2.0.1 torchvision==0.15.2 pytorch-cuda=11.7 -c pytorch -c nvidia ``` 或者使用 ```shell pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu117 ``` - 安装其他依赖: ```shell pip install -r requirements.txt ``` #### 4. 运行程序 - 运行图形化界面 ```shell python gui.py ``` - 运行命令行版本(CLI) ```shell python ./backend/main.py ``` ## 常见问题 1. CondaHTTPError 将项目中的.condarc放在用户目录下(C:/Users/<你的用户名>),如果用户目录已经存在该文件则覆盖 解决方案:https://zhuanlan.zhihu.com/p/260034241