Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
accessibility_movie_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵心治
accessibility_movie_2
Commits
ee03e0ae
Commit
ee03e0ae
authored
Sep 25, 2023
by
陈晓勇(工程师)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more ocr test
parent
7db705f9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
4 deletions
+18
-4
detect_with_ocr.py
detect_with_ocr.py
+0
-0
main_window.py
main_window.py
+0
-0
main_window_ui.py
main_window_ui.py
+13
-3
management.py
management.py
+2
-1
narratage_detection.py
narratage_detection.py
+3
-0
No files found.
detect_with_ocr.py
View file @
ee03e0ae
This diff is collapsed.
Click to expand it.
main_window.py
View file @
ee03e0ae
This diff is collapsed.
Click to expand it.
main_window_ui.py
View file @
ee03e0ae
...
...
@@ -18,6 +18,9 @@ class MyWidget(QWidget):
# def __init__(self, parent=None):
# super(QWidget, self).__init__(parent)
# self.painter_flag = True
def
__init__
(
self
,
parent
=
None
,
color
=
Qt
.
red
):
super
(
QWidget
,
self
)
.
__init__
(
parent
)
self
.
color
=
color
def
paintEvent
(
self
,
event
):
# print(">>>>>>>>into paint")
...
...
@@ -26,7 +29,7 @@ class MyWidget(QWidget):
lock
.
acquire
()
painter
=
QPainter
(
self
)
painter
.
setRenderHint
(
QPainter
.
Antialiasing
)
# Optional: Enable anti-aliasing
painter
.
setPen
(
QPen
(
Qt
.
red
,
2
,
Qt
.
SolidLine
))
painter
.
setPen
(
QPen
(
self
.
color
,
2
,
Qt
.
SolidLine
))
painter
.
drawLine
(
0
,
1
,
800
,
1
)
painter
.
end
()
lock
.
release
()
...
...
@@ -314,6 +317,8 @@ class Ui_MainWindow(object):
self
.
horizontalLayout_7
.
setObjectName
(
"horizontalLayout_7"
)
self
.
up_ocr_btn
=
QtWidgets
.
QPushButton
(
self
.
centralwidget
)
self
.
up_ocr_btn
.
setObjectName
(
"up_ocr_btn"
)
# self.up_ocr_btn.setAutoRepeatDelay(False)
# self.up_ocr_btn.setAutoRepeat
self
.
horizontalLayout_7
.
addWidget
(
self
.
up_ocr_btn
)
self
.
down_ocr_btn
=
QtWidgets
.
QPushButton
(
self
.
centralwidget
)
self
.
down_ocr_btn
.
setObjectName
(
"down_ocr_btn"
)
...
...
@@ -324,10 +329,14 @@ class Ui_MainWindow(object):
self
.
down_ocr_bottom_btn
=
QtWidgets
.
QPushButton
(
self
.
centralwidget
)
self
.
down_ocr_bottom_btn
.
setObjectName
(
"down_ocr_bottom_btn"
)
self
.
horizontalLayout_7
.
addWidget
(
self
.
down_ocr_bottom_btn
)
self
.
confirm_ocr_btn
=
QtWidgets
.
QPushButton
(
self
.
centralwidget
)
self
.
confirm_ocr_btn
.
setObjectName
(
"confirm_ocr_btn"
)
self
.
horizontalLayout_7
.
addWidget
(
self
.
confirm_ocr_btn
)
self
.
confirm_head_aside_btn
=
QtWidgets
.
QPushButton
(
self
.
centralwidget
)
self
.
confirm_head_aside_btn
.
setObjectName
(
"confirm_head_aside_btn"
)
self
.
horizontalLayout_7
.
addWidget
(
self
.
confirm_head_aside_btn
)
self
.
horizontalLayout_8
=
QtWidgets
.
QHBoxLayout
()
self
.
horizontalLayout_8
.
setObjectName
(
"horizontalLayout_8"
)
self
.
detect_btn
=
QtWidgets
.
QPushButton
(
self
.
centralwidget
)
...
...
@@ -523,7 +532,8 @@ class Ui_MainWindow(object):
self
.
action_redo
=
QtWidgets
.
QAction
(
MainWindow
)
# self.action_redo.setFont(font)
self
.
action_redo
.
setObjectName
(
"action_redo"
)
self
.
action_3
=
QtWidgets
.
QAction
(
"旁白区间检测"
,
self
,
triggered
=
self
.
show_detect_dialog
)
# self.action_3 = QtWidgets.QAction("旁白区间检测",self,triggered=self.show_detect_dialog)
self
.
action_3
=
QtWidgets
.
QAction
(
"旁白区间检测"
,
self
,
triggered
=
self
.
show_confirmation_dialog
)
self
.
action_3
.
setEnabled
(
False
)
self
.
action_4
=
QtWidgets
.
QAction
(
"旁白音频合成"
,
self
,
triggered
=
self
.
show_assemble_dialog
)
self
.
action_4
.
setEnabled
(
False
)
...
...
@@ -539,7 +549,6 @@ class Ui_MainWindow(object):
self
.
action_9
.
setEnabled
(
True
)
self
.
action_10
=
QtWidgets
.
QAction
(
"片头旁白定位"
,
self
,
triggered
=
self
.
confirm_head_aside
)
self
.
action_10
.
setEnabled
(
True
)
# self.action_3.setObjectName("action_3")
# self.action_4 = QtWidgets.QAction(MainWindow)
# self.action_4.setObjectName("action_4")
...
...
@@ -604,6 +613,7 @@ class Ui_MainWindow(object):
self
.
up_ocr_bottom_btn
.
setText
(
_translate
(
"MainWindow"
,
"字幕下边界上移"
))
self
.
down_ocr_bottom_btn
.
setText
(
_translate
(
"MainWindow"
,
"字幕下边界下移"
))
self
.
confirm_head_aside_btn
.
setText
(
_translate
(
"MainWindow"
,
"片头旁白定位"
))
self
.
confirm_ocr_btn
.
setText
(
_translate
(
"MainWindow"
,
"字幕边界确认"
))
self
.
detect_btn
.
setText
(
_translate
(
"MainWindow"
,
"旁白区间检测"
))
self
.
tabWidget
.
setTabText
(
self
.
tabWidget
.
indexOf
(
self
.
all_tab
),
_translate
(
"MainWindow"
,
"字幕旁白"
))
self
.
tabWidget
.
setTabText
(
self
.
tabWidget
.
indexOf
(
self
.
zm_tab
),
_translate
(
"MainWindow"
,
"字幕"
))
...
...
management.py
View file @
ee03e0ae
...
...
@@ -77,13 +77,14 @@ class OperateRecord:
# 每一行的具体信息,"起始时间", "终止时间", "字幕", '建议', '解说脚本'
class
Element
:
def
__init__
(
self
,
st_time_sec
:
str
,
ed_time_sec
:
str
,
subtitle
,
suggest
,
aside
,
speed
=
"1.00(4字/秒)"
):
def
__init__
(
self
,
st_time_sec
:
str
,
ed_time_sec
:
str
,
subtitle
,
suggest
,
aside
,
speed
=
"1.00(4字/秒)"
,
ocr_h
=
None
):
self
.
st_time_sec
=
st_time_sec
self
.
ed_time_sec
=
ed_time_sec
self
.
subtitle
=
subtitle
self
.
suggest
=
suggest
self
.
aside
=
aside
self
.
speed
=
speed
self
.
ocr_h
=
ocr_h
# 判断当前元素是否是字幕
def
is_subtitle
(
self
):
...
...
narratage_detection.py
View file @
ee03e0ae
...
...
@@ -63,6 +63,9 @@ def detect(video_path: str, start_time: float, end_time: float, book_path: str,
from
detect_with_ocr
import
detect_with_ocr
detect_with_ocr
(
video_path
,
book_path
,
start_time
,
end_time
,
state
,
mainWindow
)
def
process_err
(
mainWindow
:
MainWindow
=
None
):
from
detect_with_ocr
import
process_err_ocr
process_err_ocr
(
mainWindow
)
if
__name__
==
'__main__'
:
# 定义参数
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment