Skip to content

washing1127/subtitle_ocr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

功能

解析视频文件,提取其中文字以及对应的时间节点。主要用于语料生成。

生成的语料不能保证完全正确,还需要后续标注。

流程

  1. 将视频文件放到 videos 目录下
  2. 运行 get_position.py 手动确定视频中字幕的具体位置
  3. 运行 extract_subtitle.py
    1. 截取视频每一帧字幕位置的图片,保存在 frame_img 目录下
    2. 提取图片中文字,生成 时间点+文字内容 的文件
  4. 运行 to_textgrid.py 生成 textgrid 文件
  5. 自行调用 del_file.py 里的函数,多线程删除中间文件

TODO:

  1. 写函数注释
  2. 增加英文字幕功能(只需要替换OCR引擎即可)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages