11---
22comments : true
3+ hide :
4+ - toc
35---
46
57### 1. 安装使用VideoSubFinder软件
68
7- - 下载地址:Windows & Linux ([ videosubfinder官网] ( https://sourceforge.net/projects/videosubfinder/ ) / QQ群(706807542)共享文件) | [ Mac版] ( https://github.com/eritpchy/videosubfinder-cli )
8- - 使用教程:[ VideoSubFinder提取字幕关键帧教程] ( https://juejin.cn/post/7203362527082053691 )
9- - 最终生成的` RGBImages ` 和` TXTImages ` 目录一般会在软件安装目录下
10- - ✧ 推荐用` RGBImages ` 目录中图像(感谢小伙伴[ dyphire] ( https://github.com/dyphire ) 在[ #21 ] ( https://github.com/SWHL/RapidVideOCR/issues/21 ) 的反馈)
9+ 下载地址:Windows & Linux ([ videosubfinder官网] ( https://sourceforge.net/projects/videosubfinder/ ) / QQ群(706807542)共享文件) | [ Mac版] ( https://github.com/eritpchy/videosubfinder-cli )
10+
11+ 使用教程:[ VideoSubFinder提取字幕关键帧教程] ( https://juejin.cn/post/7203362527082053691 )
12+
13+ 最终生成的` RGBImages ` 和` TXTImages ` 目录一般会在软件安装目录下
14+
15+ ✧ 推荐用` RGBImages ` 目录中图像(感谢小伙伴[ dyphire] ( https://github.com/dyphire ) 在[ #21 ] ( https://github.com/SWHL/RapidVideOCR/issues/21 ) 的反馈)
1116
1217### 2. 安装rapid_videocr
1318
@@ -17,68 +22,59 @@ pip install rapid_videocr
1722
1823### 3. Python使用
1924
20- {{< tabs tabTotal="2">}}
21- {{% tab tabName="Only OCR" %}}
25+ === "Only OCR"
2226
23- ``` python linenums="1"
24- from rapid_videocr import RapidVideOCR
27+ ```python linenums="1"
28+ from rapid_videocr import RapidVideOCR
2529
26- # RapidVideOCRInput有两个初始化参数
27- # is_concat_rec: 是否用单张图识别,默认是False,也就是默认用单图识别
28- # concat_batch: 叠图识别的图像张数,默认10,可自行调节
29- # out_format: 输出格式选择,[srt, ass, txt, all], 默认是 all
30- # is_print_console: 是否打印结果,[0, 1], 默认是0,不打印
31- input_args = RapidVideOCRInput(
32- is_batch_rec = False , ocr_params = {" Global.with_paddle" : True }
33- )
34- extractor = RapidVideOCR(input_args)
30+ # RapidVideOCRInput有两个初始化参数
31+ # is_concat_rec: 是否用单张图识别,默认是False,也就是默认用单图识别
32+ # concat_batch: 叠图识别的图像张数,默认10,可自行调节
33+ # out_format: 输出格式选择,[srt, ass, txt, all], 默认是 all
34+ # is_print_console: 是否打印结果,[0, 1], 默认是0,不打印
35+ input_args = RapidVideOCRInput(
36+ is_batch_rec=False, ocr_params={"Global.with_paddle": True}
37+ )
38+ extractor = RapidVideOCR(input_args)
3539
36- rgb_dir = " tests/test_files/RGBImages"
37- save_dir = " outputs"
38- save_name = " a"
40+ rgb_dir = "tests/test_files/RGBImages"
41+ save_dir = "outputs"
42+ save_name = "a"
3943
40- # outputs/a.srt outputs/a.ass outputs/a.t
41- extractor(rgb_dir, save_dir, save_name = save_name)
42- ```
44+ # outputs/a.srt outputs/a.ass outputs/a.t
45+ extractor(rgb_dir, save_dir, save_name=save_name)
46+ ```
4347
44- {{% /tab %}}
45- {{% tab tabName="Extract + OCR" %}}
48+ === "Extract + OCR"
4649
47- ``` python linenums="1"
48- from rapid_videocr import RapidVideoSubFinderOCR
50+ ```python linenums="1"
51+ from rapid_videocr import RapidVideoSubFinderOCR
4952
50- vsf_exe = r " G:\P rogramFiles\V ideoSubFinder_6. 10_x64\R elease_x64\V ideoSubFinderWXW. exe"
51- extractor = RapidVideoSubFinderOCR(vsf_exe_path = vsf_exe, is_concat_rec = True )
53+ vsf_exe = r"G:\ProgramFiles\VideoSubFinder_6.10_x64\Release_x64\VideoSubFinderWXW.exe"
54+ extractor = RapidVideoSubFinderOCR(vsf_exe_path=vsf_exe, is_concat_rec=True)
5255
53- # video_path can be directory path or video full path.
54- video_path = ' test_files/tiny/2.mp4'
55- save_dir = ' outputs'
56- extractor(video_path, save_dir)
57- ```
58-
59- {{% /tab %}}
60- {{< /tabs >}}
56+ # video_path can be directory path or video full path.
57+ video_path = 'test_files/tiny/2.mp4'
58+ save_dir = 'outputs'
59+ extractor(video_path, save_dir)
60+ ```
6161
6262### 4. 命令行使用
6363
64- {{< tabs tabTotal="2">}}
65- {{% tab tabName="Only OCR" %}}
64+ === "Only OCR"
6665
67- ``` bash linenums="1"
68- rapid_videocr -i RGBImages
69- ```
70-
71- {{% /tab %}}
72- {{% tab tabName="Extract + OCR" %}}
66+ ```bash linenums="1"
67+ rapid_videocr -i RGBImages
68+ ```
7369
74- ``` bash linenums="1"
75- rapid_videocr -vsf G:\P rogramFiles\V ideoSubFinder_6.10_x64\R elease_x64\V ideoSubFinderWXW.exe -video_dir G:\P rogramFiles\R apidVideOCR\t est_files\t iny
76- ```
70+ === "Extract + OCR"
7771
78- {{% /tab %}}
79- {{< /tabs >}}
72+ ```bash linenums="1"
73+ rapid_videocr -vsf G:\ProgramFiles\VideoSubFinder_6.10_x64\Release_x64\VideoSubFinderWXW.exe -video_dir G:\ProgramFiles\RapidVideOCR\test_files\tiny
74+ ```
8075
8176详细参数:
77+
8278<details >
8379
8480``` bash linenums="1"
@@ -170,4 +166,6 @@ VSFParameters:
170166
171167前往` save_dir ` 目录下即可查看结果。
172168
173- {{< alert context="info" text="如果想要让视频播放软件自动挂载srt文件或ass文件,需要更改srt或ass文件名字为视频文件名字,且放到同一目录下,亦或者手动指定加载。" />}}
169+ !!! info
170+
171+ "如果想要让视频播放软件自动挂载srt文件或ass文件,需要更改srt或ass文件名字为视频文件名字,且放到同一目录下,亦或者手动指定加载。
0 commit comments