Commit 8142abd4 authored by 翟艳秋(20软)'s avatar 翟艳秋(20软)

fix some bugs and fit ocr with low quality films

parent ad04a182
...@@ -13,155 +13,72 @@ ...@@ -13,155 +13,72 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<widget class="QDialogButtonBox" name="buttonBox"> <layout class="QGridLayout" name="gridLayout">
<property name="geometry"> <item row="0" column="2">
<rect> <widget class="QPushButton" name="pushButton_2">
<x>220</x> <property name="text">
<y>250</y> <string>表格路径</string>
<width>341</width> </property>
<height>32</height> </widget>
</rect> </item>
</property> <item row="1" column="1">
<property name="toolTip"> <widget class="QLineEdit" name="lineEdit_3">
<string/> <property name="enabled">
</property> <bool>false</bool>
<property name="toolTipDuration"> </property>
<number>-1</number> </widget>
</property> </item>
<property name="orientation"> <item row="2" column="1">
<enum>Qt::Horizontal</enum> <widget class="QLineEdit" name="lineEdit_4">
</property> <property name="enabled">
<property name="standardButtons"> <bool>false</bool>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property>
</property> </widget>
<property name="centerButtons"> </item>
<bool>false</bool> <item row="0" column="1">
</property> <widget class="QLineEdit" name="lineEdit_2"/>
</widget> </item>
<widget class="QLabel" name="label"> <item row="2" column="0">
<property name="geometry"> <widget class="QLabel" name="label_4">
<rect> <property name="text">
<x>40</x> <string>旁白语速:</string>
<y>40</y> </property>
<width>72</width> </widget>
<height>15</height> </item>
</rect> <item row="3" column="1" alignment="Qt::AlignHCenter">
</property> <widget class="QDialogButtonBox" name="buttonBox">
<property name="text"> <property name="toolTip">
<string>视频路径:</string> <string/>
</property> </property>
</widget> <property name="toolTipDuration">
<widget class="QLineEdit" name="lineEdit"> <number>-1</number>
<property name="geometry"> </property>
<rect> <property name="orientation">
<x>130</x> <enum>Qt::Horizontal</enum>
<y>40</y> </property>
<width>231</width> <property name="standardButtons">
<height>21</height> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</rect> </property>
</property> <property name="centerButtons">
</widget> <bool>false</bool>
<widget class="QPushButton" name="pushButton"> </property>
<property name="geometry"> </widget>
<rect> </item>
<x>390</x> <item row="0" column="0">
<y>40</y> <widget class="QLabel" name="label_2">
<width>101</width> <property name="text">
<height>31</height> <string>旁白脚本表格:</string>
</rect> </property>
</property> </widget>
<property name="text"> </item>
<string>选择文件</string> <item row="1" column="0">
</property> <widget class="QLabel" name="label_3">
</widget> <property name="text">
<widget class="QLabel" name="label_2"> <string>旁白说话人:</string>
<property name="geometry"> </property>
<rect> </widget>
<x>20</x> </item>
<y>90</y> </layout>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>旁白脚本表格:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="geometry">
<rect>
<x>130</x>
<y>90</y>
<width>231</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>390</x>
<y>90</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>表格路径</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>30</x>
<y>140</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>旁白说话人:</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>30</x>
<y>200</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>旁白语速:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>130</x>
<y>140</y>
<width>231</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>130</x>
<y>200</y>
<width>231</width>
<height>21</height>
</rect>
</property>
</widget>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'assemble_dialog.ui' # Form implementation generated from reading ui file 'd:\AddCaption\cur_version\accessibility_movie_2\assemble_dialog.ui'
# #
# Created by: PyQt5 UI code generator 5.12 # Created by: PyQt5 UI code generator 5.15.4
# #
# WARNING! All changes made in this file will be lost! # WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
...@@ -13,46 +15,48 @@ class Ui_Dialog(object): ...@@ -13,46 +15,48 @@ class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(585, 326) Dialog.resize(585, 326)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) self.gridLayout = QtWidgets.QGridLayout(Dialog)
self.buttonBox.setGeometry(QtCore.QRect(220, 250, 341, 32)) self.gridLayout.setObjectName("gridLayout")
self.buttonBox.setToolTip("")
self.buttonBox.setToolTipDuration(-1)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName("buttonBox")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(40, 40, 72, 15))
self.label.setObjectName("label")
self.lineEdit = QtWidgets.QLineEdit(Dialog)
self.lineEdit.setGeometry(QtCore.QRect(130, 40, 231, 21))
self.lineEdit.setObjectName("lineEdit")
self.pushButton = QtWidgets.QPushButton(Dialog) self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(390, 40, 101, 31))
self.pushButton.setObjectName("pushButton") self.pushButton.setObjectName("pushButton")
self.label_2 = QtWidgets.QLabel(Dialog) self.gridLayout.addWidget(self.pushButton, 0, 2, 1, 1)
self.label_2.setGeometry(QtCore.QRect(20, 90, 111, 16))
self.label_2.setObjectName("label_2")
self.lineEdit_2 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_2.setGeometry(QtCore.QRect(130, 90, 231, 21))
self.lineEdit_2.setObjectName("lineEdit_2")
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setGeometry(QtCore.QRect(390, 90, 101, 31))
self.pushButton_2.setObjectName("pushButton_2")
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(30, 140, 111, 16))
self.label_3.setObjectName("label_3")
self.label_4 = QtWidgets.QLabel(Dialog) self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setGeometry(QtCore.QRect(30, 200, 111, 16))
self.label_4.setObjectName("label_4") self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.lineEdit_3 = QtWidgets.QLineEdit(Dialog) self.lineEdit_3 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_3.setEnabled(False) self.lineEdit_3.setEnabled(False)
self.lineEdit_3.setGeometry(QtCore.QRect(130, 140, 231, 21))
self.lineEdit_3.setObjectName("lineEdit_3") self.lineEdit_3.setObjectName("lineEdit_3")
self.gridLayout.addWidget(self.lineEdit_3, 2, 1, 1, 1)
self.lineEdit_4 = QtWidgets.QLineEdit(Dialog) self.lineEdit_4 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_4.setEnabled(False) self.lineEdit_4.setEnabled(False)
self.lineEdit_4.setGeometry(QtCore.QRect(130, 200, 231, 21))
self.lineEdit_4.setObjectName("lineEdit_4") self.lineEdit_4.setObjectName("lineEdit_4")
self.gridLayout.addWidget(self.lineEdit_4, 3, 1, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(Dialog)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
self.lineEdit_2 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_2.setObjectName("lineEdit_2")
self.gridLayout.addWidget(self.lineEdit_2, 1, 1, 1, 1)
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setObjectName("pushButton_2")
self.gridLayout.addWidget(self.pushButton_2, 1, 2, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setToolTip("")
self.buttonBox.setToolTipDuration(-1)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 4, 1, 1, 1, QtCore.Qt.AlignHCenter)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.accepted.connect(Dialog.accept)
...@@ -62,9 +66,9 @@ class Ui_Dialog(object): ...@@ -62,9 +66,9 @@ class Ui_Dialog(object):
def retranslateUi(self, Dialog): def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label.setText(_translate("Dialog", "视频路径:"))
self.pushButton.setText(_translate("Dialog", "选择文件")) self.pushButton.setText(_translate("Dialog", "选择文件"))
self.label_4.setText(_translate("Dialog", "旁白语速:"))
self.label_3.setText(_translate("Dialog", "旁白说话人:"))
self.label_2.setText(_translate("Dialog", "旁白脚本表格:")) self.label_2.setText(_translate("Dialog", "旁白脚本表格:"))
self.label.setText(_translate("Dialog", "视频路径:"))
self.pushButton_2.setText(_translate("Dialog", "表格路径")) self.pushButton_2.setText(_translate("Dialog", "表格路径"))
self.label_3.setText(_translate("Dialog", "旁白说话人:"))
self.label_4.setText(_translate("Dialog", "旁白语速:"))
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -21,6 +21,7 @@ class Ui_MainWindow(object): ...@@ -21,6 +21,7 @@ class Ui_MainWindow(object):
" padding: 5px;\n" " padding: 5px;\n"
"}") "}")
self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget = QtWidgets.QWidget(MainWindow)
# self.centralwidget.setStyleSheet("font: 9pt \"黑体\";")
self.centralwidget.setObjectName("centralwidget") self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
...@@ -206,6 +207,7 @@ class Ui_MainWindow(object): ...@@ -206,6 +207,7 @@ class Ui_MainWindow(object):
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.all_tab) self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.all_tab)
self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.all_tableWidget = QtWidgets.QTableWidget(self.all_tab) self.all_tableWidget = QtWidgets.QTableWidget(self.all_tab)
# self.all_tableWidget.setStyleSheet("font: 9pt \"微软雅黑\";")
self.all_tableWidget.setObjectName("all_tableWidget") self.all_tableWidget.setObjectName("all_tableWidget")
self.all_tableWidget.setColumnCount(0) self.all_tableWidget.setColumnCount(0)
self.all_tableWidget.setRowCount(0) self.all_tableWidget.setRowCount(0)
...@@ -240,6 +242,7 @@ class Ui_MainWindow(object): ...@@ -240,6 +242,7 @@ class Ui_MainWindow(object):
self.shuiping.setStretch(1, 5) self.shuiping.setStretch(1, 5)
self.verticalLayout.addLayout(self.shuiping) self.verticalLayout.addLayout(self.shuiping)
self.verticalWidget_2 = QtWidgets.QWidget(self.centralwidget) self.verticalWidget_2 = QtWidgets.QWidget(self.centralwidget)
# self.verticalWidget_2.setStyleSheet("font: 9pt \"微软雅黑\";")
self.verticalWidget_2.setObjectName("verticalWidget_2") self.verticalWidget_2.setObjectName("verticalWidget_2")
self.chuizhi = QtWidgets.QVBoxLayout(self.verticalWidget_2) self.chuizhi = QtWidgets.QVBoxLayout(self.verticalWidget_2)
self.chuizhi.setObjectName("chuizhi") self.chuizhi.setObjectName("chuizhi")
...@@ -330,18 +333,26 @@ class Ui_MainWindow(object): ...@@ -330,18 +333,26 @@ class Ui_MainWindow(object):
self.statusbar.setObjectName("statusbar") self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar) MainWindow.setStatusBar(self.statusbar)
self.setting = QtWidgets.QAction(MainWindow) self.setting = QtWidgets.QAction(MainWindow)
# font = QtGui.QFont()
# font.setFamily("微软雅黑")
# self.setting.setFont(font)
self.setting.setObjectName("setting") self.setting.setObjectName("setting")
self.action_open_project = QtWidgets.QAction(MainWindow) self.action_open_project = QtWidgets.QAction(MainWindow)
# self.action_open_project.setFont(font)
self.action_open_project.setObjectName("action_open_project") self.action_open_project.setObjectName("action_open_project")
self.import_movie = QtWidgets.QAction(MainWindow) self.import_movie = QtWidgets.QAction(MainWindow)
# self.import_movie.setFont(font)
self.import_movie.setObjectName("import_movie") self.import_movie.setObjectName("import_movie")
self.actions = QtWidgets.QAction(MainWindow) self.actions = QtWidgets.QAction(MainWindow)
self.actions.setObjectName("actions") self.actions.setObjectName("actions")
self.action_save = QtWidgets.QAction(MainWindow) self.action_save = QtWidgets.QAction(MainWindow)
# self.action_save.setFont(font)
self.action_save.setObjectName("action_save") self.action_save.setObjectName("action_save")
self.action_undo = QtWidgets.QAction(MainWindow) self.action_undo = QtWidgets.QAction(MainWindow)
# self.action_undo.setFont(font)
self.action_undo.setObjectName("action_undo") self.action_undo.setObjectName("action_undo")
self.action_redo = QtWidgets.QAction(MainWindow) self.action_redo = QtWidgets.QAction(MainWindow)
# self.action_redo.setFont(font)
self.action_redo.setObjectName("action_redo") self.action_redo.setObjectName("action_redo")
self.action_3 = QtWidgets.QAction(MainWindow) self.action_3 = QtWidgets.QAction(MainWindow)
self.action_3.setObjectName("action_3") self.action_3.setObjectName("action_3")
...@@ -352,10 +363,12 @@ class Ui_MainWindow(object): ...@@ -352,10 +363,12 @@ class Ui_MainWindow(object):
self.action_operate = QtWidgets.QAction(MainWindow) self.action_operate = QtWidgets.QAction(MainWindow)
self.action_operate.setObjectName("action_operate") self.action_operate.setObjectName("action_operate")
self.action_export = QtWidgets.QAction(MainWindow) self.action_export = QtWidgets.QAction(MainWindow)
# self.action_export.setFont(font)
self.action_export.setObjectName("action_export") self.action_export.setObjectName("action_export")
self.action_insert_aside_from_now = QtWidgets.QAction(MainWindow) self.action_insert_aside_from_now = QtWidgets.QAction(MainWindow)
self.action_insert_aside_from_now.setObjectName("action_insert_aside_from_now") self.action_insert_aside_from_now.setObjectName("action_insert_aside_from_now")
self.action_create = QtWidgets.QAction(MainWindow) self.action_create = QtWidgets.QAction(MainWindow)
# self.action_create.setFont(font)
self.action_create.setObjectName("action_create") self.action_create.setObjectName("action_create")
self.menu.addAction(self.action_create) self.menu.addAction(self.action_create)
self.menu.addAction(self.action_open_project) self.menu.addAction(self.action_open_project)
......
...@@ -174,6 +174,7 @@ class ProjectContext: ...@@ -174,6 +174,7 @@ class ProjectContext:
return return
with open(self.conf_path, 'r', encoding='utf8') as f: with open(self.conf_path, 'r', encoding='utf8') as f:
info = json.load(f) info = json.load(f)
# print(json.dumps(info, ensure_ascii=False, indent=4))
self.video_path = info["video_path"] self.video_path = info["video_path"]
self.excel_path = info["excel_path"] self.excel_path = info["excel_path"]
self.speaker_info = info["speaker_info"]["speaker_id"] self.speaker_info = info["speaker_info"]["speaker_id"]
...@@ -207,8 +208,7 @@ class ProjectContext: ...@@ -207,8 +208,7 @@ class ProjectContext:
} }
} }
f.write(json.dumps(info)) f.write(json.dumps(info))
def setVideoPath(self, video_path): def setVideoPath(self, video_path):
self.video_path = video_path self.video_path = video_path
......
...@@ -141,7 +141,7 @@ class Operation_Dialog(QDialog, Ui_Dialog): ...@@ -141,7 +141,7 @@ class Operation_Dialog(QDialog, Ui_Dialog):
assert start_time_f < end_time_f assert start_time_f < end_time_f
if row_number < rowCount: if row_number < rowCount:
# 要求结束时间在下一行的起始时间前面,对增加和修改都适用 # 要求结束时间在下一行的起始时间前面,对增加和修改都适用
assert float(self.mainWindow.projectContext.all_elements[list_idx+1].st_time_sec) > end_time_f assert float(self.mainWindow.projectContext.all_elements[list_idx+1].st_time_sec) >= end_time_f
# 要求起始时间在上一行后面,在下一行前面 # 要求起始时间在上一行后面,在下一行前面
if self.comboBox_2.currentText() == "增加一行": if self.comboBox_2.currentText() == "增加一行":
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment