mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-02-10 17:44:46 +08:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a577efd3e1 | ||
|
|
2bb2d54314 | ||
|
|
7049a24883 | ||
|
|
7e0ed62b9e | ||
|
|
7a5384ad95 | ||
|
|
b40ab7d921 | ||
|
|
7304905a84 | ||
|
|
150923b409 | ||
|
|
746db4bced | ||
|
|
30e7913981 | ||
|
|
6fc6d35584 | ||
|
|
87d8d9d3d7 | ||
|
|
3770ccdcfd | ||
|
|
29873c33ea | ||
|
|
196a1a8e7b | ||
|
|
53baf28326 |
36
.github/workflows/build-docker.yml
vendored
36
.github/workflows/build-docker.yml
vendored
@@ -7,7 +7,23 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check-secrets:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
has_secrets: ${{ steps.check.outputs.has_secrets }}
|
||||
steps:
|
||||
- id: check
|
||||
run: |
|
||||
if [[ -n "${{ secrets.DOCKERHUB_USERNAME }}" && -n "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
|
||||
echo "has_secrets=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_secrets=false" >> $GITHUB_OUTPUT
|
||||
echo "未设置 Docker Hub 凭据,将跳过整个 Action"
|
||||
fi
|
||||
|
||||
build-and-push:
|
||||
needs: check-secrets
|
||||
if: needs.check-secrets.outputs.has_secrets == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -29,17 +45,11 @@ jobs:
|
||||
cat /proc/cpuinfo | grep 'model name'
|
||||
ulimit -a
|
||||
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@master
|
||||
with:
|
||||
swap-size-mb: 512
|
||||
temp-reserve-mb: 1024
|
||||
root-reserve-mb: 2048
|
||||
remove-dotnet: 'true'
|
||||
remove-android: 'true'
|
||||
remove-haskell: 'true'
|
||||
remove-codeql: 'true'
|
||||
|
||||
- name: Free disk space
|
||||
run: |
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android
|
||||
df -h
|
||||
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -64,7 +74,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: eritpchy/video-subtitle-remover
|
||||
images: ${{ secrets.DOCKERHUB_USERNAME }}/video-subtitle-remover
|
||||
tags: |
|
||||
type=raw,value=${{ env.VERSION }}-${{ matrix.type }}${{ matrix.type == 'cuda' && matrix.version || '' }}
|
||||
|
||||
@@ -84,4 +94,4 @@ jobs:
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
repository: eritpchy/video-subtitle-remover
|
||||
repository: ${{ secrets.DOCKERHUB_USERNAME }}/video-subtitle-remover
|
||||
@@ -60,7 +60,8 @@ jobs:
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
- run: |
|
||||
python backend/tools/makedist.py --cuda 11.8 && \
|
||||
mv ../vsr_out ./vsr_out
|
||||
mv ../vsr_out ./vsr_out && \
|
||||
cp ./vsr_out/Debug/Debug-进入虚拟环境.cmd ./vsr_out/Release/
|
||||
env:
|
||||
QPT_Action: "True"
|
||||
shell: bash
|
||||
@@ -88,6 +89,6 @@ jobs:
|
||||
prerelease: true
|
||||
tag_name: ${{ env.VERSION }}
|
||||
target_commitish: ${{ github.sha }}
|
||||
name: 硬字幕提取器 ${{ env.VERSION }}
|
||||
name: 硬字幕去除器 v${{ env.VERSION }}
|
||||
files: |
|
||||
vsr_out/Release/vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z*
|
||||
@@ -60,7 +60,8 @@ jobs:
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
- run: |
|
||||
python backend/tools/makedist.py --cuda 12.6 && \
|
||||
mv ../vsr_out ./vsr_out
|
||||
mv ../vsr_out ./vsr_out && \
|
||||
cp ./vsr_out/Debug/Debug-进入虚拟环境.cmd ./vsr_out/Release/
|
||||
env:
|
||||
QPT_Action: "True"
|
||||
shell: bash
|
||||
@@ -88,6 +89,6 @@ jobs:
|
||||
prerelease: true
|
||||
tag_name: ${{ env.VERSION }}
|
||||
target_commitish: ${{ github.sha }}
|
||||
name: 硬字幕提取器 ${{ env.VERSION }}
|
||||
name: 硬字幕去除器 v${{ env.VERSION }}
|
||||
files: |
|
||||
vsr_out/Release/vsr-v${{ env.VERSION }}-windows-nvidia-cuda-12.6.7z*
|
||||
@@ -60,7 +60,8 @@ jobs:
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
- run: |
|
||||
python backend/tools/makedist.py --cuda 12.8 && \
|
||||
mv ../vsr_out ./vsr_out
|
||||
mv ../vsr_out ./vsr_out && \
|
||||
cp ./vsr_out/Debug/Debug-进入虚拟环境.cmd ./vsr_out/Release/
|
||||
env:
|
||||
QPT_Action: "True"
|
||||
shell: bash
|
||||
@@ -88,6 +89,6 @@ jobs:
|
||||
prerelease: true
|
||||
tag_name: ${{ env.VERSION }}
|
||||
target_commitish: ${{ github.sha }}
|
||||
name: 硬字幕提取器 ${{ env.VERSION }}
|
||||
name: 硬字幕去除器 v${{ env.VERSION }}
|
||||
files: |
|
||||
vsr_out/Release/vsr-v${{ env.VERSION }}-windows-nvidia-cuda-12.8.7z*
|
||||
5
.github/workflows/build-windows-directml.yml
vendored
5
.github/workflows/build-windows-directml.yml
vendored
@@ -60,7 +60,8 @@ jobs:
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
- run: |
|
||||
python backend/tools/makedist.py --directml && \
|
||||
mv ../vsr_out ./vsr_out
|
||||
mv ../vsr_out ./vsr_out && \
|
||||
cp ./vsr_out/Debug/Debug-进入虚拟环境.cmd ./vsr_out/Release/
|
||||
env:
|
||||
QPT_Action: "True"
|
||||
shell: bash
|
||||
@@ -88,6 +89,6 @@ jobs:
|
||||
prerelease: true
|
||||
tag_name: ${{ env.VERSION }}
|
||||
target_commitish: ${{ github.sha }}
|
||||
name: 硬字幕提取器 ${{ env.VERSION }}
|
||||
name: 硬字幕去除器 v${{ env.VERSION }}
|
||||
files: |
|
||||
vsr_out/Release/vsr-v${{ env.VERSION }}-windows-directml.7z*
|
||||
189
README.md
189
README.md
@@ -3,7 +3,7 @@
|
||||
## 项目简介
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Video-subtitle-remover (VSR) 是一款基于AI技术,将视频中的硬字幕去除的软件。
|
||||
@@ -18,8 +18,8 @@ Video-subtitle-remover (VSR) 是一款基于AI技术,将视频中的硬字幕
|
||||
|
||||
**使用说明:**
|
||||
|
||||
- 有使用问题请加群讨论,QQ群:806152575(已满)、816881808
|
||||
- 直接下载压缩包解压运行,如果不能运行再按照下面的教程,尝试源码安装conda环境运行
|
||||
- 有使用问题请加群讨论,QQ群:210150985(已满)、806152575(已满)、816881808(已满)、295894827
|
||||
- 直接下载压缩包解压运行,如果不能运行再按照下面的教程,尝试源码安装conda环境运行
|
||||
|
||||
**下载地址:**
|
||||
|
||||
@@ -27,23 +27,35 @@ Windows GPU版本v1.1.0(GPU):
|
||||
|
||||
- 百度网盘: <a href="https://pan.baidu.com/s/1zR6CjRztmOGBbOkqK8R1Ng?pwd=vsr1">vsr_windows_gpu_v1.1.0.zip</a> 提取码:**vsr1**
|
||||
|
||||
- Google Drive: <a href="https://drive.google.com/drive/folders/1NRgLNoHHOmdO4GxLhkPbHsYfMOB_3Elr?usp=sharing">vsr_windows_gpu_v1.1.0.zip</a>
|
||||
- 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
|
||||
# Nvidia 10 20 30系显卡
|
||||
docker run -it --rm --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda11.8
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda11.8
|
||||
|
||||
# Nvidia 40系显卡
|
||||
docker run -it --rm --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda12.6
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda12.6
|
||||
|
||||
# Nvidia 50系显卡
|
||||
docker run -it --rm --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda12.8
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda12.8
|
||||
|
||||
# AMD / Intel 独显 集显
|
||||
docker run -it --rm --gpus all eritpchy/video-subtitle-remover:1.1.1-directml
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-directml
|
||||
|
||||
# 演示视频, 输入
|
||||
/vsr/test/test.mp4
|
||||
docker cp vsr:/vsr/test/test_no_sub.mp4 ./
|
||||
```
|
||||
|
||||
## 演示
|
||||
@@ -58,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. 运行程序
|
||||
|
||||
@@ -228,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
|
||||
```
|
||||
|
||||
## 赞助
|
||||
|
||||
@@ -251,8 +240,10 @@ pip install torch==2.1.0 torchvision==0.15.2 --index-url https://download.pytorc
|
||||
| 无痕 | 100.00 RMB | 金牌赞助席位 |
|
||||
| wr | 100.00 RMB | 金牌赞助席位 |
|
||||
| 陈 | 100.00 RMB | 金牌赞助席位 |
|
||||
| lyons | 100.00 RMB | 金牌赞助席位 |
|
||||
| TalkLuv | 50.00 RMB | 银牌赞助席位 |
|
||||
| 陈凯 | 50.00 RMB | 银牌赞助席位 |
|
||||
| Freeman | 30.00 RMB | 银牌赞助席位 |
|
||||
| Tshuang | 20.00 RMB | 银牌赞助席位 |
|
||||
| 很奇异 | 15.00 RMB | 银牌赞助席位 |
|
||||
| 郭鑫 | 12.00 RMB | 银牌赞助席位 |
|
||||
|
||||
188
README_en.md
188
README_en.md
@@ -3,7 +3,7 @@
|
||||
## Project Introduction
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Video-subtitle-remover (VSR) is an AI-based software that removes hardcoded subtitles from videos. It mainly implements the following functionalities:
|
||||
@@ -26,7 +26,36 @@ Windows GPU Version 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>
|
||||
|
||||
> For use only by users with Nvidia graphics cards (AMD graphics cards are not supported).
|
||||
|
||||
**Pre-built Package Comparison**:
|
||||
|
||||
| Pre-built Package Name | Python | Paddle | Torch | Environment | Supported Compute Capability Range |
|
||||
|----------------------------------|--------|--------|--------|-----------------------------------|------------------------------------|
|
||||
| `vse-windows-directml.7z` | 3.12 | 3.0.0 | 2.4.1 | Windows without Nvidia GPU | Universal |
|
||||
| `vse-windows-nvidia-cuda-11.8.7z`| 3.12 | 3.0.0 | 2.7.0 | CUDA 11.8 | 3.5 – 8.9 |
|
||||
| `vse-windows-nvidia-cuda-12.6.7z`| 3.12 | 3.0.0 | 2.7.0 | CUDA 12.6 | 5.0 – 8.9 |
|
||||
| `vse-windows-nvidia-cuda-12.8.7z`| 3.12 | 3.0.0 | 2.7.0 | CUDA 12.8 | 5.0 – 9.0+ |
|
||||
|
||||
> NVIDIA provides a list of supported compute capabilities for each GPU model. You can refer to the following link: [CUDA GPUs](https://developer.nvidia.com/cuda-gpus) to check which CUDA version is compatible with your GPU.
|
||||
|
||||
**Docker Versions:**
|
||||
```shell
|
||||
# Nvidia 10, 20, 30 Series Graphics Cards
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda11.8
|
||||
|
||||
# Nvidia 40 Series Graphics Cards
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda12.6
|
||||
|
||||
# Nvidia 50 Series Graphics Cards
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-cuda12.8
|
||||
|
||||
# AMD / Intel Dedicated or Integrated Graphics
|
||||
docker run -it --name vsr --gpus all eritpchy/video-subtitle-remover:1.1.1-directml
|
||||
|
||||
# Demo video, input
|
||||
/vsr/test/test.mp4
|
||||
docker cp vsr:/vsr/test/test_no_sub.mp4 ./
|
||||
```
|
||||
|
||||
## Demonstration
|
||||
|
||||
@@ -40,117 +69,98 @@ Windows GPU Version v1.1.0 (GPU):
|
||||
|
||||
## Source Code Usage Instructions
|
||||
|
||||
> **Do not use this project without an Nvidia graphics card**. The minimum requirements are:
|
||||
>
|
||||
> **GPU**: GTX 1060 or higher graphics card
|
||||
>
|
||||
> CPU: Supports AVX instruction set
|
||||
#### 1. Install Python
|
||||
|
||||
#### 1. Download and install Miniconda
|
||||
Please ensure that you have installed Python 3.12+.
|
||||
|
||||
- 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>
|
||||
- Windows users can go to the [Python official website](https://www.python.org/downloads/windows/) to download and install Python.
|
||||
- MacOS users can install using Homebrew:
|
||||
```shell
|
||||
brew install python@3.12
|
||||
```
|
||||
- Linux users can install via the package manager, such as on Ubuntu/Debian:
|
||||
```shell
|
||||
sudo apt update && sudo apt install python3.12 python3.12-venv python3.12-dev
|
||||
```
|
||||
|
||||
- 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>
|
||||
#### 2. Install Dependencies
|
||||
|
||||
#### 2. Create and activate a virtual environment
|
||||
It is recommended to use a virtual environment to manage project dependencies to avoid conflicts with the system environment.
|
||||
|
||||
(1) Switch to the source code directory:
|
||||
(1) Create and activate the virtual environment:
|
||||
```shell
|
||||
python -m venv videoEnv
|
||||
```
|
||||
|
||||
- Windows:
|
||||
```shell
|
||||
videoEnv\\Scripts\\activate
|
||||
```
|
||||
- MacOS/Linux:
|
||||
```shell
|
||||
source videoEnv/bin/activate
|
||||
```
|
||||
|
||||
#### 3. Create and Activate Project Directory
|
||||
|
||||
Change to the directory where your source code is located:
|
||||
```shell
|
||||
cd <source_code_directory>
|
||||
```
|
||||
> For example, if your source code is in the `tools` folder on the D drive and the folder name is `video-subtitle-remover`, use:
|
||||
> ```shell
|
||||
> cd D:/tools/video-subtitle-remover-main
|
||||
> ```
|
||||
|
||||
> For example, if your source code is in the `tools` folder on drive D, and the source code folder name is `video-subtitle-remover`, enter `cd D:/tools/video-subtitle-remover-main`.
|
||||
#### 4. Install the Appropriate Runtime Environment
|
||||
|
||||
(2) Create and activate the conda environment:
|
||||
This project supports two runtime modes: CUDA (NVIDIA GPU acceleration) and DirectML (AMD, Intel, and other GPUs/APUs).
|
||||
|
||||
```shell
|
||||
conda create -n videoEnv python=3.8
|
||||
```
|
||||
##### (1) CUDA (For NVIDIA GPU users)
|
||||
|
||||
```shell
|
||||
conda activate videoEnv
|
||||
```
|
||||
> Make sure your NVIDIA GPU driver supports the selected CUDA version.
|
||||
|
||||
#### 3. Install dependencies
|
||||
|
||||
Please make sure you have already 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**
|
||||
|
||||
<details>
|
||||
<summary>Linux</summary>
|
||||
<h5>(1) Download 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) Install CUDA 11.7</h5>
|
||||
<pre><code>sudo sh cuda_11.7.0_515.43.04_linux.run</code></pre>
|
||||
<p>1. Input accept</p>
|
||||
<img src="https://i.328888.xyz/2023/03/31/iwVoeH.png" width="500" alt="">
|
||||
<p>2. make sure CUDA Toolkit 11.7 is chosen (If you have already installed driver, do not select Driver)</p>
|
||||
<img src="https://i.328888.xyz/2023/03/31/iwVThJ.png" width="500" alt="">
|
||||
<p>3. Add environment variables</p>
|
||||
<p>add the following content in <strong>~/.bashrc</strong></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>Make sure it works</p>
|
||||
<pre><code>source ~/.bashrc</code></pre>
|
||||
<h5>(3) Download cuDNN 8.4.1</h5>
|
||||
<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) Install 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>
|
||||
|
||||
<details>
|
||||
<summary>Windows</summary>
|
||||
<h5>(1) Download 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) Install CUDA 11.7</h5>
|
||||
<h5>(3) Download cuDNN 8.4.0</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) Install cuDNN 8.4.0</h5>
|
||||
<p>
|
||||
unzip "cudnn-windows-x86_64-8.4.0.27_cuda11.6-archive.zip", then move all files in "bin, include, lib" in cuda
|
||||
directory to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\
|
||||
</p>
|
||||
</details>
|
||||
|
||||
|
||||
- Install GPU version of 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
|
||||
```
|
||||
- Recommended CUDA 11.8, corresponding to cuDNN 8.6.0.
|
||||
|
||||
- Install CUDA:
|
||||
- Windows: [Download 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
|
||||
```
|
||||
- CUDA is not supported on MacOS.
|
||||
|
||||
```shell
|
||||
python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
|
||||
```
|
||||
- Install cuDNN (CUDA 11.8 corresponds to cuDNN 8.6.0):
|
||||
- [Windows cuDNN 8.6.0 Download](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 Download](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)
|
||||
- Follow the installation guide in the NVIDIA official documentation.
|
||||
|
||||
- Install GPU version of Pytorch:
|
||||
|
||||
```shell
|
||||
conda install pytorch==2.1.0 torchvision==0.16.0 pytorch-cuda=11.8 -c pytorch -c nvidia
|
||||
- Install PaddlePaddle GPU version (CUDA 11.8):
|
||||
```shell
|
||||
pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
|
||||
```
|
||||
or use
|
||||
|
||||
```shell
|
||||
pip install torch==2.1.0 torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cu118
|
||||
|
||||
- Install Torch GPU version (CUDA 11.8):
|
||||
```shell
|
||||
pip install torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu118
|
||||
```
|
||||
|
||||
- Install other dependencies:
|
||||
|
||||
```shell
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
##### (2) DirectML (For AMD, Intel, and other GPU/APU users)
|
||||
|
||||
- Suitable for Windows devices with AMD/NVIDIA/Intel GPUs.
|
||||
- Install ONNX Runtime DirectML version:
|
||||
```shell
|
||||
pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements_directml.txt
|
||||
```
|
||||
|
||||
|
||||
#### 4. Run the program
|
||||
|
||||
@@ -215,6 +225,4 @@ Solution: https://zhuanlan.zhihu.com/p/260034241
|
||||
|
||||
Solution: Upgrade the 7-zip extraction program to the latest version.
|
||||
|
||||
```shell
|
||||
pip install torch==2.1.0 torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cu118
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user