mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-02-04 04:34:41 +08:00
更新README
This commit is contained in:
169
README.md
169
README.md
@@ -3,7 +3,7 @@
|
||||
## 项目简介
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Video-subtitle-remover (VSR) 是一款基于AI技术,将视频中的硬字幕去除的软件。
|
||||
@@ -29,7 +29,15 @@ Windows GPU版本v1.1.0(GPU):
|
||||
|
||||
- Google Drive: <a href="https://drive.google.com/drive/folders/1NRgLNoHHOmdO4GxLhkPbHsYfMOB_3Elr?usp=sharing">vsr_windows_gpu_v1.1.0.zip</a>
|
||||
|
||||
> 仅供具有Nvidia显卡的用户使用(AMD的显卡不行)
|
||||
**预构建包对比说明**:
|
||||
| 预构建包名 | Python | Paddle | Torch | 环境 | 支持的计算能力范围|
|
||||
|---------------|------------|--------------|--------------|-----------------------------|----------|
|
||||
| `vsr-windows-directml.7z` | 3.12 | 3.0.0 | 2.4.1 | Windows 非Nvidia显卡 | 通用 |
|
||||
| `vsr-windows-nvidia-cuda-11.8.7z` | 3.12 | 3.0.0 | 2.7.0 | CUDA 11.8 | 3.5 – 8.9 |
|
||||
| `vsr-windows-nvidia-cuda-12.6.7z` | 3.12 | 3.0.0 | 2.7.0 | CUDA 12.6 | 5.0 – 8.9 |
|
||||
| `vsr-windows-nvidia-cuda-12.8.7z` | 3.12 | 3.0.0 | 2.7.0 | CUDA 12.8 | 5.0 – 9.0+ |
|
||||
|
||||
> NVIDIA官方提供了各GPU型号的计算能力列表,您可以参考链接: [CUDA GPUs](https://developer.nvidia.com/cuda-gpus) 查看你的GPU适合哪个CUDA版本
|
||||
|
||||
**Docker版本:**
|
||||
```shell
|
||||
@@ -62,114 +70,98 @@ Windows GPU版本v1.1.0(GPU):
|
||||
|
||||
## 源码使用说明
|
||||
|
||||
> **无Nvidia显卡请勿使用本项目**,最低配置:
|
||||
>
|
||||
> **GPU**:GTX 1060或以上显卡
|
||||
>
|
||||
> CPU: 支持AVX指令集
|
||||
|
||||
#### 1. 下载安装Miniconda
|
||||
#### 1. 安装 Python
|
||||
|
||||
- Windows: <a href="https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Windows-x86_64.exe">Miniconda3-py38_4.11.0-Windows-x86_64.exe</a>
|
||||
请确保您已经安装了 Python 3.12+。
|
||||
|
||||
- Linux: <a href="https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Linux-x86_64.sh">Miniconda3-py38_4.11.0-Linux-x86_64.sh</a>
|
||||
- Windows 用户可以前往 [Python 官网](https://www.python.org/downloads/windows/) 下载并安装 Python。
|
||||
- MacOS 用户可以使用 Homebrew 安装:
|
||||
```shell
|
||||
brew install python@3.12
|
||||
```
|
||||
- Linux 用户可以使用包管理器安装,例如 Ubuntu/Debian:
|
||||
```shell
|
||||
sudo apt update && sudo apt install python3.12 python3.12-venv python3.12-dev
|
||||
```
|
||||
|
||||
#### 2. 创建并激活虚机环境
|
||||
#### 2. 安装依赖文件
|
||||
|
||||
(1)切换到源码所在目录:
|
||||
请使用虚拟环境来管理项目依赖,避免与系统环境冲突。
|
||||
|
||||
(1)创建虚拟环境并激活
|
||||
```shell
|
||||
python -m venv videoEnv
|
||||
```
|
||||
|
||||
- Windows:
|
||||
```shell
|
||||
videoEnv\\Scripts\\activate
|
||||
```
|
||||
- MacOS/Linux:
|
||||
```shell
|
||||
source videoEnv/bin/activate
|
||||
```
|
||||
|
||||
#### 3. 创建并激活项目目录
|
||||
|
||||
切换到源码所在目录:
|
||||
```shell
|
||||
cd <源码所在目录>
|
||||
```
|
||||
> 例如:如果你的源代码放在D盘的tools文件下,并且源代码的文件夹名为video-subtitle-remover,就输入 ```cd D:/tools/video-subtitle-remover-main```
|
||||
> 例如:如果您的源代码放在 D 盘的 tools 文件夹下,并且源代码的文件夹名为 video-subtitle-remover,则输入:
|
||||
> ```shell
|
||||
> cd D:/tools/video-subtitle-remover-main
|
||||
> ```
|
||||
|
||||
(2)创建激活conda环境
|
||||
```shell
|
||||
conda create -n videoEnv python=3.8
|
||||
```
|
||||
#### 4. 安装合适的运行环境
|
||||
|
||||
```shell
|
||||
conda activate videoEnv
|
||||
```
|
||||
本项目支持 CUDA(NVIDIA显卡加速)和 DirectML(AMD、Intel等GPU/APU加速)两种运行模式。
|
||||
|
||||
#### 3. 安装依赖文件
|
||||
##### (1) CUDA(NVIDIA 显卡用户)
|
||||
|
||||
请确保你已经安装 python 3.8+,使用conda创建项目虚拟环境并激活环境 (建议创建虚拟环境运行,以免后续出现问题)
|
||||
> 请确保您的 NVIDIA 显卡驱动支持所选 CUDA 版本。
|
||||
|
||||
- 安装CUDA和cuDNN
|
||||
- 推荐 CUDA 11.8,对应 cuDNN 8.6.0。
|
||||
|
||||
<details>
|
||||
<summary>Linux用户</summary>
|
||||
<h5>(1) 下载CUDA 11.7</h5>
|
||||
<pre><code>wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run</code></pre>
|
||||
<h5>(2) 安装CUDA 11.7</h5>
|
||||
<pre><code>sudo sh cuda_11.7.0_515.43.04_linux.run</code></pre>
|
||||
<p>1. 输入accept</p>
|
||||
<img src="https://i.328888.xyz/2023/03/31/iwVoeH.png" width="500" alt="">
|
||||
<p>2. 选中CUDA Toolkit 11.7(如果你没有安装nvidia驱动则选中Driver,如果你已经安装了nvidia驱动请不要选中driver),之后选中install,回车</p>
|
||||
<img src="https://i.328888.xyz/2023/03/31/iwVThJ.png" width="500" alt="">
|
||||
<p>3. 添加环境变量</p>
|
||||
<p>在 ~/.bashrc 加入以下内容</p>
|
||||
<pre><code># 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}}</code></pre>
|
||||
<p>使其生效</p>
|
||||
<pre><code>source ~/.bashrc</code></pre>
|
||||
<h5>(3) 下载cuDNN 8.4.1</h5>
|
||||
<p>国内:<a href="https://pan.baidu.com/s/1Gd_pSVzWfX1G7zCuqz6YYA">cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz</a> 提取码:57mg</p>
|
||||
<p>国外:<a href="https://github.com/YaoFANGUK/video-subtitle-extractor/releases/download/1.0.0/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz">cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz</a></p>
|
||||
<h5>(4) 安装cuDNN 8.4.1</h5>
|
||||
<pre><code> 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/*</code></pre>
|
||||
</details>
|
||||
- 安装 CUDA:
|
||||
- Windows:[CUDA 11.8 下载](https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_522.06_windows.exe)
|
||||
- Linux:
|
||||
```shell
|
||||
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
|
||||
sudo sh cuda_11.8.0_520.61.05_linux.run
|
||||
```
|
||||
- MacOS 不支持 CUDA。
|
||||
|
||||
<details>
|
||||
<summary>Windows用户</summary>
|
||||
<h5>(1) 下载CUDA 11.7</h5>
|
||||
<a href="https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_516.01_windows.exe">cuda_11.7.0_516.01_windows.exe</a>
|
||||
<h5>(2) 安装CUDA 11.7</h5>
|
||||
<h5>(3) 下载cuDNN v8.4.0 (April 1st, 2022), for CUDA 11.x</h5>
|
||||
<p><a href="https://github.com/YaoFANGUK/video-subtitle-extractor/releases/download/1.0.0/cudnn-windows-x86_64-8.4.0.27_cuda11.6-archive.zip">cudnn-windows-x86_64-8.4.0.27_cuda11.6-archive.zip</a></p>
|
||||
<h5>(4) 安装cuDNN 8.4.0</h5>
|
||||
<p>
|
||||
将cuDNN解压后的cuda文件夹中的bin, include, lib目录下的文件复制到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\对应目录下
|
||||
</p>
|
||||
</details>
|
||||
- 安装 cuDNN(CUDA 11.8 对应 cuDNN 8.6.0):
|
||||
- [Windows cuDNN 8.6.0 下载](https://developer.download.nvidia.cn/compute/redist/cudnn/v8.6.0/local_installers/11.8/cudnn-windows-x86_64-8.6.0.163_cuda11-archive.zip)
|
||||
- [Linux cuDNN 8.6.0 下载](https://developer.download.nvidia.cn/compute/redist/cudnn/v8.6.0/local_installers/11.8/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz)
|
||||
- 安装方法请参考 NVIDIA 官方文档。
|
||||
|
||||
|
||||
- 安装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:
|
||||
|
||||
- 安装 PaddlePaddle GPU 版本(CUDA 11.8):
|
||||
```shell
|
||||
conda install pytorch==2.0.1 torchvision==0.15.2 pytorch-cuda=11.8 -c pytorch -c nvidia
|
||||
pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
|
||||
```
|
||||
或者使用
|
||||
- 安装 Torch GPU 版本(CUDA 11.8):
|
||||
```shell
|
||||
pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118
|
||||
pip install torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu118
|
||||
```
|
||||
|
||||
- 安装其他依赖:
|
||||
|
||||
- 安装其他依赖
|
||||
```shell
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
##### (2) DirectML(AMD、Intel等GPU/APU加速卡用户)
|
||||
|
||||
- 适用于 Windows 设备的 AMD/NVIDIA/Intel GPU。
|
||||
- 安装 ONNX Runtime DirectML 版本:
|
||||
```shell
|
||||
pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
|
||||
pip install -r requirements.txt
|
||||
pip install torch_directml==0.2.5.dev240914
|
||||
```
|
||||
|
||||
|
||||
#### 4. 运行程序
|
||||
|
||||
@@ -232,13 +224,6 @@ LAMA_SUPER_FAST = False # 保证效果
|
||||
|
||||
解决方案:升级7-zip解压程序到最新版本
|
||||
|
||||
5. 4090使用cuda 11.7跑不起来
|
||||
|
||||
解决方案:改用cuda 11.8
|
||||
|
||||
```shell
|
||||
pip install torch==2.1.0 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118
|
||||
```
|
||||
|
||||
## 赞助
|
||||
|
||||
|
||||
Reference in New Issue
Block a user