-
-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathdemo.py
More file actions
32 lines (24 loc) · 960 Bytes
/
demo.py
File metadata and controls
32 lines (24 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: liekkaskono@163.com
# 提取 + 识别
from rapid_videocr import RapidVideOCRInput, RapidVideoSubFinderOCR, VideoSubFinderInput
vsf_exe_path = (
r"G:\ProgramFiles\VideoSubFinder_6.10_x64\Release_x64\VideoSubFinderWXW.exe"
)
vsf_input_params = VideoSubFinderInput(vsf_exe_path=vsf_exe_path)
input_args = RapidVideOCRInput(is_batch_rec=False)
vsf_ocr = RapidVideoSubFinderOCR(vsf_input_params, input_args)
# video_path可以是目录或者具体video路径
video_path = "test_files/tiny/2.mp4"
save_dir = "outputs"
vsf_ocr(video_path, save_dir)
# 只识别
from rapid_videocr import RapidVideOCR, RapidVideOCRInput
input_args = RapidVideOCRInput(is_batch_rec=False, log_level="critical")
extractor = RapidVideOCR(input_args)
rgb_dir = "tests/test_files/RGBImages"
save_dir = "outputs"
save_name = "a"
# outputs/a.srt outputs/a.ass outputs/a.txt
extractor(rgb_dir, save_dir, save_name=save_name)