mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-05-18 03:27:33 +08:00
使用PySide6-Fluent-Widgets重构整套UI
添加任务列表组件并优化视频加载逻辑 支持可视化显示字幕区域 整理所有模型, 分别为STTN智能擦除, STTN字幕检测, LAMA, ProPainter, OpenCV 提高处理性能 新增CPU运行模式并优化多语言支持 修复Propainter模式部分视频报错 本次提交新增了CPU运行模式,适用于无GPU加速的场景。同时,优化了多语言支持,新增了日语、韩语、越南语等语言配置文件,并更新了README文档以反映新的运行模式和多语言支持。此外,修复了部分代码逻辑,提升了系统的稳定性和兼容性。
This commit is contained in:
20
backend/tools/ocr.py
Normal file
20
backend/tools/ocr.py
Normal file
@@ -0,0 +1,20 @@
|
||||
def get_coordinates(dt_box):
|
||||
"""
|
||||
从返回的检测框中获取坐标
|
||||
:param dt_box 检测框返回结果
|
||||
:return list 坐标点列表
|
||||
"""
|
||||
coordinate_list = list()
|
||||
if isinstance(dt_box, list):
|
||||
for i in dt_box:
|
||||
i = list(i)
|
||||
(x1, y1) = int(i[0][0]), int(i[0][1])
|
||||
(x2, y2) = int(i[1][0]), int(i[1][1])
|
||||
(x3, y3) = int(i[2][0]), int(i[2][1])
|
||||
(x4, y4) = int(i[3][0]), int(i[3][1])
|
||||
xmin = max(x1, x4)
|
||||
xmax = min(x2, x3)
|
||||
ymin = max(y1, y2)
|
||||
ymax = min(y3, y4)
|
||||
coordinate_list.append((xmin, xmax, ymin, ymax))
|
||||
return coordinate_list
|
||||
Reference in New Issue
Block a user