Commit 1c807388 authored by 翟艳秋(20软)'s avatar 翟艳秋(20软)

modified the errors in detect_with_ocr and change the dir order of resources like speaker audios

parent 0c8c815e
__pycache__
.vscode
.idea
chineseocr_lite
exp
chineseocr_usage.py
easyOCR_usage.py
dist
build
......@@ -83,7 +83,7 @@ class Assemble_Dialog(QDialog, Ui_Dialog):
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("./images/eagle_2.ico"))
app.setWindowIcon(QIcon("./res/images/eagle_2.ico"))
dialog = Assemble_Dialog()
dialog.show()
sys.exit(app.exec_())
\ No newline at end of file
......@@ -33,4 +33,4 @@ dir_path = os.path.dirname(os.path.abspath(__file__))
class Pathes:
speaker_conf_path = os.path.join(dir_path, "speakers.json")
speaker_conf_path = os.path.join(dir_path, "res/speakers.json")
......@@ -23,6 +23,7 @@ class Detect_Dialog(QDialog, Ui_Dialog):
self.pushButton_2.clicked.connect(self.openTableFile)
self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).clicked.connect(self.start_detect)
self.prompt_dialog = Prompt_Dialog()
def init_self(self):
self.lineEdit.setText(self.projectContext.video_path)
self.lineEdit_2.setText(self.projectContext.excel_path)
......@@ -59,7 +60,7 @@ class Detect_Dialog(QDialog, Ui_Dialog):
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("./images/eagle_2.ico"))
app.setWindowIcon(QIcon("./res/images/eagle_2.ico"))
dialog = Detect_Dialog()
dialog.show()
sys.exit(app.exec_())
\ No newline at end of file
......@@ -19,8 +19,10 @@ import os
import cv2
import numpy as np
from paddleocr import PaddleOCR
# from easyOCR_usage import EasyOCR
# from chineseocr_usage import ChineseOCR
import sys
print("PaddleOCR load path:", os.path.abspath(sys.modules[PaddleOCR.__module__].__file__))
# print("PaddleOCR load path:", os.path.abspath(sys.modules[PaddleOCR.__module__].__file__))
import difflib
import re
......@@ -33,6 +35,8 @@ up_b, down_b = 0, 0
# 初始化ocr工具
ocr = PaddleOCR(use_angle_cls=True, lang="ch", show_log=False, use_gpu=False)
# ocr = EasyOCR()
# ocr = ChineseOCR()
# 正常语速为4字/秒
normal_speed = 4
......@@ -65,7 +69,8 @@ def get_position(video_path: str, start_time: float) -> Tuple[float, float]:
# print("img:", img)
# gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# cv2.imshow('img', gray)
# cv2.imshow(img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
cnt += 1
if img is None or cnt > 10000:
break
......@@ -83,42 +88,43 @@ def get_position(video_path: str, start_time: float) -> Tuple[float, float]:
for x in res:
# print("x:", x)
rect, (txt, confidence) = x
[x1,y1],[x2,y2],[x3,y3],[x4,y4] = rect
# font_size = rect[2][1] - rect[0][1]
mid = (rect[0][0] + rect[1][0]) / 2
gradient = np.arctan(abs((rect[1][1] - rect[0][1]) / (rect[1][0] - rect[0][0])))
mid = (x1 + x2) / 2
gradient = np.arctan(abs((y2 - y1) / (x2 - x1)))
# 可能是字幕的文本
if confidence > 0.9 and 0.4 * img.shape[1] < mid < 0.6 * img.shape[1] and gradient < 0.1:
conf_thred = 0.9
# conf_thred = 0.8
if confidence > conf_thred and 0.4 * img.shape[1] < mid < 0.6 * img.shape[1] and gradient < 0.1:
if bottom_position is None:
bottom_position = rect[0][1]
bottom_position = y1
# 判断是否与前一文本相同(是不是同一个字幕),非同一字幕的前提下,取对应上下边界,
keys = subtitle_position.keys()
if abs(rect[0][1] - bottom_position) < 10:
if abs(y1 - bottom_position) < 10:
if pre_txt is None or pre_txt != txt:
txt_cnt += 1
pre_txt = txt
if (rect[0][0], rect[2][1]) in keys:
subtitle_position[(rect[0][1], rect[2][1])] += 1
if (y1, y3) in keys:
subtitle_position[(y1, y3)] += 1
else:
replace = False
for k in keys:
# 更新键值为最宽的上下限
if abs(rect[0][1] - k[0]) + abs(rect[2][1] - k[1]) < 10:
new_k = min(k[0], rect[0][1]), max(k[1], rect[2][1])
if abs(y1 - k[0]) + abs(y3 - k[1]) < 10:
subtitle_position[k] += 1
new_k = min(k[0], y1), max(k[1], y3)
if new_k != k:
subtitle_position[new_k] = subtitle_position[k]
subtitle_position[new_k] += 1
subtitle_position.pop(k)
else:
subtitle_position[k] += 1
replace = True
break
if not replace:
subtitle_position[(rect[0][1], rect[2][1])] = 1
subtitle_position[(y1, y3)] = 1
if txt_cnt == 3:
break
print(subtitle_position)
up_bounding, down_bounding = max(subtitle_position, key=subtitle_position.get)
return up_bounding + height, down_bounding + height
return int(up_bounding + height), int(down_bounding + height)
def erasePunc(txt: str) -> str:
......@@ -167,6 +173,7 @@ def normalize(text: str) -> str:
text = text.translate(table)
text = text.strip(' ,。、【】_·:-@‘[;')
# 促成首尾匹配的()
if len(text) > 0:
if text[-1] == ')' and text[0] != '(':
text = '(' + text
elif text[-1] != ')' and text[0] == '(':
......@@ -191,9 +198,12 @@ def detect_subtitle(img: np.ndarray) -> Union[str, None]:
img = cv2.resize(img, (int(img.shape[1] * 1.5), int(img.shape[0] * 1.5)))
res = ocr.ocr(img, cls=True)
sorted(res, key=lambda text: text[0][0][1])
sorted(res, key=lambda text: text[0][0][0])
if len(res) == 0:
return None
return None, 0
possible_txt = []
conf = 0
print(res)
for x in res:
# cv2.imshow("cut", img)
# cv2.waitKey(0)
......@@ -204,18 +214,35 @@ def detect_subtitle(img: np.ndarray) -> Union[str, None]:
gradient = np.arctan(abs((rect[1][1] - rect[0][1]) / (rect[1][0] - rect[0][0])))
# log.append("文本:{},置信度:{},中心点:{},斜率:{},字体大小:{}".format(txt, confidence, mid / img.shape[1], gradient,
# font_size)) 置信度>0.7 & 斜率<0.1 & 字幕偏移量<=25 & 字幕中心在画面宽的0.4-0.6之间
if confidence > 0.7 and gradient < 0.1 and 0.4 < mid / img.shape[1] < 0.6 and \
abs(rect[0][1] - 30) + abs(img.shape[0] - rect[2][1] - 30) <= 25:
# print("文本:{},置信度:{},中心点:{},斜率:{},字体大小:{}".format(txt, confidence, mid / img.shape[1], gradient, font_size))
# print("差距:{}".format(abs(rect[0][1] - 30) + abs(img.shape[0] - rect[2][1] - 30)))
conf_thred1 = 0.7
conf_thred2 = 0.85
# conf_thred1 = 0.1
# conf_thred2 = 0.4
# conf_thred1 = 0.5
# conf_thred2 = 0.7
if confidence > conf_thred1 and gradient < 0.1 and 0.4 < mid / img.shape[1] < 0.6 and \
abs(rect[0][1] - 30) + abs(img.shape[0] - rect[2][1] - 30) <= font_size - 10:
subTitle += txt
conf = max(conf,confidence)
# possible_txt.append([txt, mid/img.shape[1]])
possible_txt.append(txt)
# 如果字幕在一行中分为两个(或以上)对话文本
elif confidence > 0.85 and gradient < 0.1:
elif confidence > conf_thred2 and gradient < 0.1:
if 0.3 < mid / img.shape[1] < 0.4 or 0.6 < mid / img.shape[1] < 0.7:
# possible_txt.append([txt, mid/img.shape[1]])
possible_txt.append(txt)
conf = max(conf, confidence)
# sorted(possible_txt, key=lambda pos : pos[1])
# print(possible_txt)
if len(possible_txt) >= 2:
subTitle = ''.join(possible_txt)
# subTitle = ' '.join([x[0] for x in possible_txt])
subTitle = ' '.join(possible_txt)
print(subTitle, conf)
if len(subTitle) > 0:
return subTitle
return None
return subTitle, conf
return None, 0
def process_video(video_path: str, begin: float, end: float, book_path: str, sheet_name: str, state=None, mainWindow: MainWindow=None):
......@@ -243,6 +270,7 @@ def process_video(video_path: str, begin: float, end: float, book_path: str, she
video = cv2.VideoCapture(video_path)
fps = video.get(cv2.CAP_PROP_FPS)
lastSubTitle = None
lastConf = 0
# res是在视频遍历过程中获取的字幕文件,不掺杂对旁白的分析
res = []
cnt = 0
......@@ -279,9 +307,11 @@ def process_video(video_path: str, begin: float, end: float, book_path: str, she
mainWindow.projectContext.nd_process = state[0]
mainWindow.projectContext.last_time = cur_time
subTitle = detect_subtitle(frame)
subTitle, conf = detect_subtitle(frame)
if subTitle is not None:
subTitle = normalize(subTitle)
if len(subTitle) == 0:
subTitle = None
# 第一次找到字幕
if lastSubTitle is None and subTitle is not None:
start_time = cur_time
......@@ -315,10 +345,11 @@ def process_video(video_path: str, begin: float, end: float, book_path: str, she
add_to_list(mainWindow, "字幕", [round(start_time, 3), round(end_time, 3), lastSubTitle, ''])
start_time = end_time
else:
lastSubTitle = subTitle if len(subTitle) > len(lastSubTitle) else lastSubTitle
lastSubTitle = subTitle if conf > lastConf else lastSubTitle
continue
# 当前字幕与上一段字幕不一样
lastSubTitle = subTitle
lastConf = conf
def add_to_list(mainWindow: MainWindow, element_type: str, li: list):
......
current excel_path: None
emit close Event
log文件夹地址 D:\AddCaption\cur_version\accessibility_movie_2\log
打开工程:self.player.duration() 7157499
设置最大值为: 7158.499
继续检测,video_path=F:/影视作品/国产电影/工作需要/记忆大师.mkv, book_path=F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
===子线程已经开启 in detect ===
[2023/03/13 17:51:49] root WARNING: version PP-OCRv2 not support cls models, use version PP-OCR instead
Namespace(benchmark=False, cls_batch_num=6, cls_image_shape='3, 48, 192', cls_model_dir='C:\\Users\\91662/.paddleocr/2.3.0.1\\ocr\\cls\\ch_ppocr_mobile_v2.0_cls_infer', cls_thresh=0.9, cpu_threads=10, det=True, det_algorithm='DB', det_db_box_thresh=0.6, det_db_score_mode='fast', det_db_thresh=0.3, det_db_unclip_ratio=1.5, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_east_score_thresh=0.8, det_limit_side_len=960, det_limit_type='max', det_model_dir='C:\\Users\\91662/.paddleocr/2.3.0.1\\ocr\\det\\ch\\ch_PP-OCRv2_det_infer', det_sast_nms_thresh=0.2, det_sast_polygon=False, det_sast_score_thresh=0.5, drop_score=0.5, e2e_algorithm='PGNet', e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_limit_side_len=768, e2e_limit_type='max', e2e_model_dir=None, e2e_pgnet_mode='fast', e2e_pgnet_polygon=True, e2e_pgnet_score_thresh=0.5, e2e_pgnet_valid_set='totaltext', enable_mkldnn=False, gpu_mem=500, help='==SUPPRESS==', image_dir=None, ir_optim=True, label_list=['0', '180'], lang='ch', layout_path_model='lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config', max_batch_size=10, max_text_length=25, min_subgraph_size=15, output='./output/table', precision='fp32', process_id=0, rec=True, rec_algorithm='CRNN', rec_batch_num=6, rec_char_dict_path='D:\\software\\anaconda3\\envs\\bfm\\lib\\site-packages\\paddleocr\\ppocr\\utils\\ppocr_keys_v1.txt', rec_char_type='ch', rec_image_shape='3, 32, 320', rec_model_dir='C:\\Users\\91662/.paddleocr/2.3.0.1\\ocr\\rec\\ch\\ch_PP-OCRv2_rec_infer', save_log_path='./log_output/', show_log=False, table_char_dict_path=None, table_char_type='en', table_max_len=488, table_model_dir=None, total_process_num=1, type='ocr', use_angle_cls=True, use_dilation=False, use_gpu=False, use_mp=False, use_pdserving=False, use_space_char=True, use_tensorrt=False, version='PP-OCRv2', vis_font_path='./doc/fonts/simfang.ttf', warmup=True)
start and end time: 652.667 7157.0
当前使用的语速为 4.5
你不把记忆拿回来 0.9953354
你不把记忆拿回来 0.99582434
你不把记忆拿回来 0.9931778
你不把记忆拿回来 0.9539131
你不把记忆拿回来 0.9951175
我是不会签字的 0.9117651
--------------------------------------------------
654.375 655.625 你不把记忆拿回来
我是不会签字的 0.92129695
我是不会签字的 0.90846413
我是不会签字的 0.9079482
我是不会签字的 0.9900196
我是不会签字的 0.95336884
655.625 657.125 我是不会签字的
[0.09230473662148946]
当前进度条进度 0.09230473662148946
江先生 0.9960251
江先生 0.994093
江先生 0.9989538
江先生 0.9989612
现在开始恢复记忆 0.99888563
--------------------------------------------------
677.875 678.875 江先生
现在开始恢复记忆 0.9507421
现在开始恢复记忆 0.9402848
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.09492454939220343]
当前进度条进度 0.09492454939220343
现在开始恢复记忆 0.9483846
现在开始恢复记忆 0.93684924
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
现在开始恢复记忆 0.9969666
678.875 680.375 现在开始恢复记忆
不好意思 0.99783117
不好意思 0.9974912
0
--------------------------------------------------
695.125 695.625 不好意思
0
0
0
0
[0.09736970797820316]
当前进度条进度 0.09736970797820316
0
0
让二位久等了 0.95029706
--------------------------------------------------
697.375 697.625 让二位久等了
江先生 0.9128761
江先生 0.9974926
江先生 0.99511486
0
--------------------------------------------------
698.875 699.625 江先生
我会开 一些安眠药给作 0.9990797
我会开 一些安眠药给1 0.9991085
我会开 一些安眠药给1 0.9990609
我会开 一些安眠药给件 0.9989345
我会开 一些安眠药给价 0.9989603
我会开一些安眠药给你 0.9940852
699.875 701.375 我会开 一些安眠药给1
帮助你进入深层睡眠 0.92500526
帮助你进入深层睡眠 0.99609375
帮助你进入深层睡眠 0.9940191
帮助你进入深层睡眠 0.8964688
帮助你进入深层睡眠 0.94686985
帮助你进入深层睡眠 0.94663525
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.09820804806483163]
当前进度条进度 0.09820804806483163
帮助你进入深层睡眠 0.9243198
701.625 703.375 帮助你进入深层睡眠
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
正常情况下 0.9970692
正常情况下 0.9965547
正常情况下 0.9966053
正常情况下 0.99778557
只需要两三个充足的睡 0.93494195
703.875 704.875 正常情况下
只需要两三个充足的睡 0.933437
只需要两三个充足的睡 0.92873156
只需要两三个充足的睡眠 0.86793226
只需要两三个充足的睡 0.9291954
只需要两三个充足的睡 0.9278326
只需要两三个充足的睡 0.92767113
取回来的记忆就会重新激 0.9873053
704.875 706.625 只需要两三个充足的睡
取回来的记忆就会重新激洁 0.95401144
取回来的记忆就会重新激洁 0.95200604
取回来的记忆就会重新激洁 0.9519537
取回来的记忆就会重新激洁 0.91420776
取回来的记忆就会重新激治 0.9133617
取回来的记忆就会重新激 0.9749718
取回来的记忆就会重新激汗 0.923368
取回来的记忆就会重新激汗 0.9078519
[0.09904638815146011]
当前进度条进度 0.09904638815146011
取回来的记忆就会重新激洁 0.9083209
706.625 709.125 取回来的记忆就会重新激
也就是记忆重载 0.9982189
也就是记忆重载 0.9983795
也就是记忆重载 0.9982629
也就是记忆重载 0.9986733
也就是记忆重载 0.9979205
也就是记忆重载 0.9979771
709.375 710.875 也就是记忆重载
不过我要提醒你一点 0.99753547
不过我要提醒你一点 0.9976639
不过我要提醒你一点 0.9975236
不过我要提醒你一点 0.9975358
不过我要提醒你一点 0.9975593
不过我要提醒你一点 0.9975128
不过我要提醒你一点 0.99745816
通过记忆重载写入大脑的记忆 0.9802487
711.375 713.125 不过我要提醒你一点
通过记忆重载写入大脑的记忆 0.98612
通过记忆重载写入大脑的记忆 0.9528935
通过记忆重载写入大脑的记忆 0.9893311
通过记忆重载写入大脑的记忆 0.9758211
通过记忆重载写入大脑的记忆 0.9803143
通过记忆重载写入大脑的记忆 0.9320978
通过记忆重载写入大脑的记忆 0.96548855
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.09988472823808858]
当前进度条进度 0.09988472823808858
通过记忆重载写入大脑的记忆 0.99595076
713.125 715.375 通过记忆重载写入大脑的记忆
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
一旦超过七十二小时 0.9933085
一旦超过七十二小时 0.99255157
一旦超过七十二小时 0.99352974
一旦超过七十二小时 0.9946157
一旦超过七十二小时 0.95930034
一旦超过七十二小时 0.9614594
715.625 717.125 一旦超过七十二小时
就会永久保存下来 0.9896284
就会永久保存下来 0.9869693
就会永久保存下来 0.98876834
就会永久保存下来 0.98933613
就会永久保存下来 0.99644524
就会永久保存下来 0.9945674
就会永久保存下来 0.99328744
717.375 719.125 就会永久保存下来
那是不是也就是说 0.9988622
那是不是也就是说 0.9984125
719.625 720.125 那是不是也就是说
0
删除掉的话 0.92376053
2删除掉的话 0.88816136
不删除掉的话 0.92455846
忆删除掉的话 0.8681555
[0.1011422383680313]
当前进度条进度 0.1011422383680313
亿删除掉的话 0.8262689
忆删除掉的话 0.9422156
--------------------------------------------------
722.875 724.375 忆删除掉的话
那就要在七十二小时之内 0.90509874
那就要在七士二小时之内 0.9589067
那就要在七十二小时之内 0.92509866
那就要在七十二小时之内 0.98997015
那就要在七十二小时之内 0.935846
那就要在七十二小时之内 0.9869136
725.125 726.625 那就要在七十二小时之内
再做一次手术 0.92236876
再做一次手术 0.92485505
再做一次手术 0.9242405
再做一次手术 0.9254048
726.875 727.875 再做一次手术
准确地说 0.95883155
准确地说 0.98281103
准确地说 0.93450695
0
728.125 728.875 准确地说
0.86266255
0
0.8505486
0.8529224
0.89557964
0.8905004
0
0
row, col = 213, 0
0
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.10215523263937404]
当前进度条进度 0.10215523263937404
0
0
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
0.87304723
0
0
是永久册 0.8969761
是永久册 0.87944174
是永久册 0.89136726
是永久册 0.90054584
是永久册 0.95072246
--------------------------------------------------
734.375 735.625 是永久册
以目# 0.71942157
以目 0.96814764
以目 0.8840461
以目 0.88219017
以目 0.8819307
办法把记忆拿出来两次 0.98037255
735.875 737.125 以目
办法把记忆拿出来两次 0.981321
办法把记忆拿出来两次 0.9796243
办法把记忆拿出来两次 0.9801644
办法把记忆拿出来两次 0.97946805
办法把记忆拿出来两次 0.9819213
有办法把记忆拿出来两次 0.93638575
有办法把记忆拿出来两次 0.9404077
[0.10327301942154533]
当前进度条进度 0.10327301942154533
办法把记忆拿出来两次 0.9671737
737.125 739.375 办法把记忆拿出来两次
在这段时间 0.99717224
在这段时间 0.95413697
在这段时间 0.9980836
在这段时间 0.953272
在这段时间 0.9628886
江先生你也可以再考虑一下 Mrlian thingthrough 0.99639577
740.125 741.375 在这段时间
江先生你也可以再考虑一下 0.9953766
江先生你也可以再考虑 0.99493825
江先生你也可以再考虑一下 0.9530461
江先生你也可以再考虑一下 0.9940317
江先生你也可以再考虑一下 0.9679196
江先生你也可以再考虑 0.9944447
741.375 743.125 江先生你也可以再考虑一下 Mrlian thingthrough
如果你真的决定做这个手术 0.96023446
如果你真的决定做这个手术 0.9827301
如果你真的决定做这个手术 0.9965158
如果你真的决定做这个手术 0.99413544
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.1039716361604024]
当前进度条进度 0.1039716361604024
如果你真的决定做这个手术 0.99678963
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
如果你真的决定做这个手术 0.99654293
如果你真的决定做这个手术 0.980833
如果你真的决定做这个手术 0.9888234
如果你真的决定做这个 0.9973631
请提早告诉我们 0.99527884
743.375 745.625 如果你真的决定做这个
请提早告诉我们 0.9776434
请提早告诉我们 0.98730326
请提早告诉我们 0.89795434
请提早告诉我们 0.9822841
请提早告诉我们 0.9976
745.625 747.125 请提早告诉我们
那我先定 0.9975218
那我先定 小丰 0.9890769
那我先定 小丰 0.9987372
before====
self.sld_video PyQt5.QtCore.QSize(780, 20)
self.scrollAreaWidgetContents PyQt5.QtCore.QSize(800, 40)
self.sld_video.maximum() 7158
after====
self.sld_video PyQt5.QtCore.QSize(1170, 20)
self.scrollAreaWidgetContents PyQt5.QtCore.QSize(1180, 40)
那那我先定 小丰 0.9993061
[0.1049496995948023]
当前进度条进度 0.1049496995948023
那我先定 小丰 0.9992303
那那我先定 小丰 0.99927884
那那我先定 小丰 0.99804413
--------------------------------------------------
750.125 751.875 那那我先定 小丰
row, col = 220, 0
能不能等记忆都恢复守 0.93775815
能不能等记忆都恢复 0.9479316
能不能等记忆都恢复房 0.93789357
能不能等记忆都恢复房 0.9106084
能不能等记忆都恢复 0.9969704
能不能等记忆都恢复 0.9510071
能不能等记忆都恢复 0.9957199
能不能等记忆都恢复 0.9954409
能不能等记忆都恢复 0.9560799
--------------------------------------------------
757.375 759.625 能不能等记忆都恢复
再做决定啊 0.9910146
再做决定啊 0.98642176
再做决定啊人 0.83694166
再做决定啊 0.98640954
再做决定啊 0.9884001
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.10631200223557356]
当前进度条进度 0.10631200223557356
再做决定啊 0.98078156
再做决定啊 0.9909975
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
759.875 761.625 再做决定啊
[0.10928112337571608]
当前进度条进度 0.10928112337571608
我刚准备点外卖 0.9504979
我刚准备点外卖 0.98948056
我刚准备点外卖 0.99205357
我刚准备点外卖 0.9947176
我刚准备点外卖 0.9903504
我刚准备点外卖 0.9904696
--------------------------------------------------
798.125 799.625 我刚准备点外卖
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.11176121279865865]
当前进度条进度 0.11176121279865865
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
我给你带吃的了 0.98352
我给你带吃的了 0.99769264
我给你带吃的了 0.97962
我给你带吃的了 0.98624504
我给你带吃的了 0.98613614
我给你带吃的了 0.99695146
--------------------------------------------------
802.875 804.375 我给你带吃的了
书 0.9998965
书 0.9999763
书 0.9999211
--------------------------------------------------
806.375 807.125 书
还有你换洗的衣服 0.9616654
还有你换洗的衣服 0.99391204
还有你换洗的衣服 0.9945851
还有你换洗的衣服 0.9919034
还有你换洗的衣服 0.98569477
807.375 808.625 还有你换洗的衣服
我看到她了 0.98386896
我看到她了 0.9696313
我看到她了 0.9887414
我看到她了 0.98186934
--------------------------------------------------
809.875 810.875 我看到她了
[0.1133680312980299]
当前进度条进度 0.1133680312980299
她一切都好你不用担心 0.9964366
她一切都好你不用担心 0.9945655
她一切都好你不用担心 0.9954602
她一切都好你不用担心 0.99630946
她一切都好你不用担心 0.9946202
她一切都好你不用担心 0.99091214
她一切都好你不用担心 0.98904246
811.375 813.125 她一切都好你不用担心
喂 0.9939282
喂 0.9406755
0
--------------------------------------------------
820.875 821.375 喂
慧兰 0.9996294
慧兰 0.8432034
慧兰 0.9996209
--------------------------------------------------
823.125 823.875 慧兰
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.11542895067765824]
当前进度条进度 0.11542895067765824
row, col = 211, 0
我只是想报个平安 0.95576787
我只是想报个平安 0.9987479
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
我只是想报个平安 0.99841475
我只是想报个平安 0.97643936
我只是想报个平安 0.986892
我只是想报个平安 0.9863329
我只是想报个平安 0.95899653
--------------------------------------------------
826.625 828.375 我只是想报个平安
row, col = 212, 0
你如果这样的话 0.9992342
你如果这样的话 0.9992228
你如果这样的话 0.9992835
你如果这样的话 0.9992837
--------------------------------------------------
835.125 836.125 你如果这样的话
躲起来有意义吗 0.99783534
躲起来有意义吗 0.99779516
躲起来有意义吗 0.9978075
躲起来有意义吗 0.9977311
躲起来有意义吗 0.9976197
836.375 837.625 躲起来有意义吗
[0.11721042336174375]
当前进度条进度 0.11721042336174375
你说的对 0.9943558
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.12031926784965767]
当前进度条进度 0.12031926784965767
你说的对 0.9983061
你说的对 0.99840236
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
你说的对 0.9993005
你说的对 0.9992321
--------------------------------------------------
861.125 862.375 你说的对
谢谢你照顾我这么久 0.962343
谢谢你照顾我这么久 0.9674056
谢谢你照顾我这么久 0.9921782
谢谢你照顾我这么久 0.9912423
谢谢你照顾我这么久 0.99144197
谢谢你照顾我这么久 0.98853946
--------------------------------------------------
867.375 868.875 谢谢你照顾我这么久
但是有一些事情 0.994956
但是有一些事情 0.9951776
但是有一些事情 0.89831835
但是有一些事情 0.9973455
但是有一些事情 0.9980833
0
869.125 870.375 但是有一些事情
我必须要回去跟他说清楚 have 0.9659498
[0.1216466396534861]
当前进度条进度 0.1216466396534861
我必须要回去跟他说清楚 0.96577936
我必须要回去跟他说清楚 0.9554872
我必须要回去跟他说清楚 0.9555977
我必须要回去跟他说清楚 0.9939564
我必须要回去跟他说清楚 0.9518945
我必须要回去跟他说清楚 0.96712494
我必须要回去跟他说清楚 0.9579407
我必须要回去跟他说清楚 0.99315315
870.625 872.875 我必须要回去跟他说清楚
row, col = 191, 0
好我陪你去 0.9908067
好我陪你去 0.9961506
好我陪你去 0.99475336
好我陪你去 0.99697053
873.125 874.125 好我陪你去
不用了 0.9996214
不用了 0.9996546
row, col = 197, 0
不用了 0.99969053
不用了 0.9765069
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.1223103255554003]
当前进度条进度 0.1223103255554003
874.625 875.625 不用了
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
我自己可以处理好 0.96243787
我自己可以处理好 0.96811694
我自己可以处理好 0.9698504
我自己可以处理好 0.9746407
我自己可以处理好 0.990148
我自己可以处理好 0.95120806
我自己可以处理好 0.9857984
876.375 878.125 我自己可以处理好
row, col = 200, 0
row, col = 201, 0
[0.12444110660891435]
当前进度条进度 0.12444110660891435
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
[0.12748008942294256]
当前进度条进度 0.12748008942294256
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
current excel_path: F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx
emit close Event
保存表格到路径[F:/影视作品/国产电影/工作需要\test_on_log\记忆大师.xlsx]成功
current excel_path: None
emit close Event
current excel_path: None
emit close Event
current excel_path: None
emit close Event
current excel_path: None
emit close Event
打开工程:self.player.duration() 6470031
设置最大值为: 6471.031
继续检测,video_path=F:/影视作品/国产电影/工作需要/何以笙箫默.mp4, book_path=F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
===子线程已经开启 in detect ===
[2023/03/15 22:42:28] root WARNING: version PP-OCRv2 not support cls models, use version PP-OCR instead
Namespace(benchmark=False, cls_batch_num=6, cls_image_shape='3, 48, 192', cls_model_dir='C:\\Users\\91662/.paddleocr/2.3.0.1\\ocr\\cls\\ch_ppocr_mobile_v2.0_cls_infer', cls_thresh=0.9, cpu_threads=10, det=True, det_algorithm='DB', det_db_box_thresh=0.6, det_db_score_mode='fast', det_db_thresh=0.3, det_db_unclip_ratio=1.5, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_east_score_thresh=0.8, det_limit_side_len=960, det_limit_type='max', det_model_dir='C:\\Users\\91662/.paddleocr/2.3.0.1\\ocr\\det\\ch\\ch_PP-OCRv2_det_infer', det_sast_nms_thresh=0.2, det_sast_polygon=False, det_sast_score_thresh=0.5, drop_score=0.5, e2e_algorithm='PGNet', e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_limit_side_len=768, e2e_limit_type='max', e2e_model_dir=None, e2e_pgnet_mode='fast', e2e_pgnet_polygon=True, e2e_pgnet_score_thresh=0.5, e2e_pgnet_valid_set='totaltext', enable_mkldnn=False, gpu_mem=500, help='==SUPPRESS==', image_dir=None, ir_optim=True, label_list=['0', '180'], lang='ch', layout_path_model='lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config', max_batch_size=10, max_text_length=25, min_subgraph_size=15, output='./output/table', precision='fp32', process_id=0, rec=True, rec_algorithm='CRNN', rec_batch_num=6, rec_char_dict_path='D:\\software\\anaconda3\\envs\\bfm\\lib\\site-packages\\paddleocr\\ppocr\\utils\\ppocr_keys_v1.txt', rec_char_type='ch', rec_image_shape='3, 32, 320', rec_model_dir='C:\\Users\\91662/.paddleocr/2.3.0.1\\ocr\\rec\\ch\\ch_PP-OCRv2_rec_infer', save_log_path='./log_output/', show_log=False, table_char_dict_path=None, table_char_type='en', table_max_len=488, table_model_dir=None, total_process_num=1, type='ocr', use_angle_cls=True, use_dilation=False, use_gpu=False, use_mp=False, use_pdserving=False, use_space_char=True, use_tensorrt=False, version='PP-OCRv2', vis_font_path='./doc/fonts/simfang.ttf', warmup=True)
start and end time: 726.1666666666667 6470.0
当前使用的语速为 4.5
0.95899916
0.9607498
0.99373466
0
[0.11257727975270479]
当前进度条进度 0.11257727975270479
我好好的拍风景 0.9705042
我好好的拍风景 0.9490954
我好好的拍风景 0.965555
我好好的拍风景 0.90730715
我好好的拍风景 0.9673556
--------------------------------------------------
732.625 733.875 我好好的拍风景
你干嘛突然冒出来 0.9550874
你干嘛突然冒出来 0.9770944
你干嘛突然冒出来 0.97972035
你干嘛突然冒出来 0.97452617
734.125 735.125 你干嘛突然冒出来
哎 你怎么走啦 0.8990383
哎你怎么走啦 0.95480126
哎你怎么走啦 0.964776
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.11505023183925811]
当前进度条进度 0.11505023183925811
哎你怎么走啦 0.9708491
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
把风景还给你 0.992821
--------------------------------------------------
743.875 744.875 哎你怎么走啦
把风景还给你 0.99268675
把风景还给你 0.99131745
把风景还给你 0.9874008
把风景还给你 0.9901797
744.875 746.125 把风景还给你
好吧我承认我是在偷拍你 0.99442
好吧 我承认我是在偷拍你 0.90935916
好吧我承认我是在偷拍你 0.99485433
好吧我承认我是在偷拍你 0.99498904
好吧 我承认我是在偷拍你 0.94988734
好吧我承认我是在偷拍你 0.99619275
好吧我承认我是在偷拍你 0.9540827
那你能告诉我你的名字系别吗 0.94763416
746.375 748.125 好吧我承认我是在偷拍你
那你能告诉我你的名字系别吗 0.96933866
那你能告诉我你的名字系别吗 0.99072975
那你能告诉我你的名字系别吗 0.98814934
那你能告诉我你的名字系别吗 0.97374886
那你能告诉我你的名字系别吗 0.9712865
那你能告诉我你的名字系别吗 0.9732217
748.125 749.875 那你能告诉我你的名字系别吗
我冲好照片以后送给你啊 0.9464689
我冲好照片以后送给你呕 0.94112754
我冲好照片以后送给你啊 0.94544846
我冲好照片以后送给你呕 0.9320711
我冲好照片以后送给你啊 0.97316545
750.125 751.375 我冲好照片以后送给你啊
你不说啊 0.9961268
[0.11620942812982998]
当前进度条进度 0.11620942812982998
你不说啊 0.9963781
751.625 752.125 你不说啊
你不说我可一个一个去打听啦 0.9591834
你不说我可一个一个去打听啦 0.9830602
你不说我可一个一个去打听啦 0.99439746
你不说我可一个一个去打听啦 0.99713826
你不说我可一个一个去打听啦 0.974446
752.375 753.625 你不说我可一个一个去打听啦
我一个一个问 0.92178583
我一个一个问 0.9769395
我一个一个问 0.99525785
753.875 754.625 我一个一个问
我相信全校这么多人 0.99708486
我相信全校这么多人 0.9866687
我相信全校这么多人 0.93458164
我相信全校这么多人 0.99657863
我相信全校这么多人 0.9899505
有志者事竟成 0.9902742
754.875 756.125 我相信全校这么多人
有志者事竟成 0.97136396
有志者事竟成 0.9899966
『志者事竟成 0.8167448
我一定可以 0.9146881
756.125 757.125 有志者事竟成
我一定可以 0.99922657
国际法二年级何以琛 0.967566
757.125 757.625 我一定可以
国际法二年级何以琛 0.9965854
国际法二年级何以琛 0.9947938
国际法二年级 何以琛 0.9022449
国际法二年级何以琛 0.9924056
国际法二年级何以琛 0.97234017
国际法二年级何以琛 0.9592074
可以你好我是赵默笙 0.9754922
757.625 759.375 国际法二年级何以琛
何以琛你好 我是赵默笙 0.92934996
何以琛你好 我是赵默笙 0.9437681
何以琛你好我是赵默笙 0.98898685
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.11748454404945904]
当前进度条进度 0.11748454404945904
可以琛你好我是赵默笙 0.9498542
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
何以琛你好 我是赵默笙 0.945635
赵就是那个赵 0.99930793
759.375 760.875 何以琛你好我是赵默笙
赵就是那个赵 0.9992318
赵就是那个赵 0.9990463
默是沉默的默 0.968859
760.875 761.625 赵就是那个赵
默是沉默的默 0.99284244
默是沉默的默 0.9745489
默是沉默的默 0.9701088
笙笙笙是一种乐器 0.97283804
761.625 762.625 默是沉默的默
笙笙笙是一种乐器 0.985574
笙笙笙是一种乐器 0.993246
笙笙 笙是一种乐器 0.94256806
笙笙笙是一种乐器 0.9842117
笙笙笙是一种乐器 0.99002635
笙笙笙是一种乐器 0.98595697
笙笙 笙是一种乐器 0.94261974
笙笙笙是一种乐器 0.9840605
笙笙笙是一种乐器 0.8863659
它是有典故的来自徐志摩的诗 0.9909658
762.625 765.125 笙笙笙是一种乐器
它是有典故的来自徐志摩的诗 0.940855
它是有典故的来自徐志摩的诗 0.9845558
它是有典故的来自徐志摩的诗 0.98333144
它是有典故的来自徐志摩的诗 0.973157
它是有典故的来自徐志摩的诗 0.994204
它是有典故的来自徐志摩的诗 0.98513424
765.125 766.875 它是有典故的来自徐志摩的诗
[0.11891421947449768]
当前进度条进度 0.11891421947449768
你走的真快 0.91657436
你走的真快 0.99766576
你走的真快 0.9986354
--------------------------------------------------
770.375 771.125 你走的真快
我可以继续讲完 0.99865377
我可以继续讲完 0.9972955
我可以继续讲完 0.9982478
我可以继续讲完 0.9969364
我可以继续讲完 0.9988431
--------------------------------------------------
772.625 773.875 我可以继续讲完
赵默笙我说过了 0.99332535
赵默笙我说过了 0.9918982
赵默笙我说过了 0.9983863
赵默笙我说过了 0.99783707
赵默笙我说过了 0.99686
774.125 775.375 赵默笙我说过了
我不准备在大学找女朋友 0.9166529
我不准备在大学找女朋友 0.9936205
我不准备在大学找女朋友 0.99669766
我不准备在大学找女朋友 0.9954565
我不准备在大学找女朋友 0.99375856
我我知道我知道 0.9312154
775.625 776.875 我不准备在大学找女朋友
我我知道我知道 0.9763519
我我知道我知道 0.99874914
我我知道我知道 0.9886721
我我知道我知道 0.99910384
所以我现在先排队等你毕业 0.997987
776.875 778.125 我我知道我知道
所以我现在先排队等你毕业了 0.9210584
所以我现在先排队等你毕业了 0.99657834
所以我现在先排队等你毕业了 0.9571585
所以我现在先排队等你毕业了 0.9963404
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.12042117465224111]
当前进度条进度 0.12042117465224111
所以我现在先排队等你毕业了 0.99854463
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
所以我现在先排队等你毕业 0.99231553
778.125 779.875 所以我现在先排队等你毕业了
有优先录取权嘛 0.9227491
有优先录取权嘛 0.99347544
有优先录取权嘛 0.98860663
有优先录取权嘛 0.9883241
780.125 781.125 有优先录取权嘛
我有课 0.99590856
我有课 0.9959697
--------------------------------------------------
784.375 784.875 我有课
别跟着我了 0.9972849
别跟着我了 0.89872515
别跟着我了 0.99761736
785.375 786.125 别跟着我了
我也有课 0.91527104
我也有课 0.959899
我也有课 0.9931948
786.875 787.625 我也有课
[0.12227588871715611]
当前进度条进度 0.12227588871715611
你你别误会啊 0.9964569
你 你别误会啊 0.9213186
你你别误会啊 0.9974518
你你别误会啊 0.99719614
你你别误会啊 0.9979894
--------------------------------------------------
793.375 794.625 你你别误会啊
我我就是想跟你说 0.9991908
我 我就是想跟你说 0.94613785
我我就是想跟你说 0.99798656
我我就是想跟你说 0.9988672
我我就是想跟你说 0.99928534
794.875 796.125 我我就是想跟你说
那些谣言真的不是我传出去的 0.9565048
那些谣言真的不是我传出去的 0.9886039
那些谣言真的不是我传出去的 0.99829704
那些谣言真的不是我传出去的 0.992447
那些谣言真的不是我传出去的 0.9625336
那些谣言真的不是我传出去的 0.9437755
那些谣言真的不是我传出去的 0.97895014
那些谣言真的不是我传出去的 0.9875236
真的 你要相信我 0.81934774
796.375 798.375 那些谣言真的不是我传出去的
真的你要相信我 0.99889845
真的 你要相信我 0.95473653
真的你要相信我 0.99764115
真的 你要相信我 0.9363807
798.375 799.625 真的 你要相信我
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.12362828438948996]
当前进度条进度 0.12362828438948996
我知道 0.9983527
我知道 0.999057
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
800.125 800.625 我知道
因为那是我传的 0.8961544
因为那是我传的 0.93475544
因为那是我传的 0.9975319
因为那是我传的 0.9978097
因为那是我传的 0.99887913
--------------------------------------------------
802.875 804.125 因为那是我传的
我考虑过了 0.99461555
我考虑过了 0.9909598
我考虑过了 0.96522665
--------------------------------------------------
806.875 807.625 我考虑过了
如果三年后注定你是我的女朋友 0.99753135
如果三年后注定你是我的女朋友 0.99792683
如果三年后注定你是我的女朋友 0.9837713
如果三年后注定你是我的女朋友 0.99834
如果三年后注定你是我的女朋友 0.9337095
如果三年后注定你是我的女朋友 0.98198223
如果三年后注定你是我的女朋友 0.9948166
如果三年后注定你是我的女朋友 0.97114605
--------------------------------------------------
808.625 810.625 如果三年后注定你是我的女朋友
[0.12532843894899537]
当前进度条进度 0.12532843894899537
我何不提早行使我的权利 0.9624752
我何不提早行使我的权利 0.9720818
我何不提早行使我的权利 0.98314613
我何不提早行使我的权利 0.99343294
我何不提早行使我的权利 0.9657396
我何不提早行使我的权利 0.9797888
我何不提早行使我的权利 0.9928766
--------------------------------------------------
811.625 813.375 我何不提早行使我的权利
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.1276854714064915]
当前进度条进度 0.1276854714064915
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
你先撤 0.9930554
你先撤 0.98888713
你先撤 0.8937934
你先撤 0.99321765
我掩护 0.99284774
--------------------------------------------------
828.125 829.125 你先撤
我掩护 0.9782925
我掩护 0.9946916
829.125 829.875 我掩护
保护好这位老首长 0.94613945
保护好这位老首长 0.9793073
保护好这位老首长 0.9379467
保护好这位老首长 0.9476641
保护好这位老首长 0.9364077
保护好这位老首长 0.99728
Yes sir 0.89762497
830.125 831.625 保护好这位老首长
Yes sir 0.9193858
Yes sir 0.94056165
831.625 832.375 Yes sir
首长 0.99962115
首长 0.9997258
832.875 833.375 首长
走啊 0.9990338
走啊 0.99864423
833.625 834.125 走啊
[0.12961746522411127]
当前进度条进度 0.12961746522411127
没劲 0.9720733
没劲 0.977203
没劲 0.88961196
--------------------------------------------------
839.125 839.875 没劲
我说你怎么每次都不参加律所的活动啊 0.9955443
我说你怎么每次都不参加律所的活动啊 0.99138856
我说你怎么每次都不参加律所的活动啊 0.9818989
我说你怎么每次都不参加律所的活动啊 0.961873
我说你怎么每次都不参加律所的活动啊 0.98797965
我说你怎么每次都不参加律所的活动啊 0.96047556
我说你怎么每次都不参加律所的活动啊 0.9895775
我说你怎么每次都不参加律所的活动啊 0.98446655
--------------------------------------------------
841.625 843.625 我说你怎么每次都不参加律所的活动啊
有你们俩就够了 0.9904198
有你们俩就够了 0.99420065
有你们俩就够了 0.9918939
有你们俩就够了 0.9952398
843.875 844.875 有你们俩就够了
我听说你把人家许霹需又给拒了啊 0.85929495
我听说你把人家许霹雳又给拒了啊 0.87731373
我听说你把人家许霹雳又给拒了啊 0.92098135
我听说你把人家许霹雳又给拒了啊 0.9047693
我听说你把人家许露雳又给书 0.8721802
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.13077666151468315]
当前进度条进度 0.13077666151468315
我听说你把人家许霹雳又给拒 0.9296216
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
我听说你把人家许霹雳又给拒 0.91203
845.125 846.875 我听说你把人家许霹雳又给拒
哭得不行不行的 0.9966143
哭得不行不行的 0.9376694
哭得不行不行的 0.9965124
847.625 848.375 哭得不行不行的
何止啊 0.96013427
何止啊 0.9889756
何止啊 0.9672651
848.625 849.375 何止啊
外企女高管 0.9405116
外企女高管 0.9396542
外企女高管 0.9342602
外企女高管 0.9445163
849.875 850.875 外企女高管
电台女主播 0.9740528
电台女主播 0.96499664
电台女主播 0.98060036
电台女主播 0.94224703
851.125 852.125 电台女主播
你妹何以玫 0.95389843
你妹何以玫 0.95957935
你妹何以玫 0.9186926
你妹何以玫 0.9789424
哎你说你拒的这些个姑娘 0.96840405
852.375 853.375 你妹何以玫
哎你说你拒的这些个姑娘 0.98407936
哎你说你拒的这些个姑娘 0.9746802
[0.13201313755795982]
当前进度条进度 0.13201313755795982
哎 你说你拒的这些个姑娘 0.9073681
哎你说你拒的这些个姑娘 0.9595963
哎你说你拒的这些个姑娘 0.97737974
哎你说你拒的这些个姑娘 0.9739578
853.375 855.125 哎你说你拒的这些个姑娘
你发一个给他好不好 0.9899985
你发一个给他好不好 0.9940706
你发一个给他好不好 0.9945593
你发一个给他好不好 0.99396324
855.375 856.375 你发一个给他好不好
你这人老这么清心寡欲的可不行啊 0.9857887
你这人老这么清心寡欲的可不行啊 0.9867609
你这人老这么清心寡欲的可不行啊 0.9874026
你这人老这么清心寡欲的可不行啊 0.98777455
你这人老这么清心寡欲的可不行啊 0.97039455
你这人老这么清心寡欲的可不行啊 0.95880437
你这人老这么清心寡欲的可不行啊 0.97863674
你这人老这么清心寡欲的可不行啊 0.9726241
来来哥们给你把把脉 0.9941438
856.625 858.625 你这人老这么清心寡欲的可不行啊
来来哥们给你把把脉 0.9929725
来来哥们给你把把脉 0.99108154
来来哥们给你把把脉 0.99220794
来来哥们给你把把脉 0.9856434
先别写了 0.9982494
858.625 859.875 来来哥们给你把把脉
先别写了 0.9987224
先别写了 0.9996765
859.875 860.625 先别写了
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.1330177743431221]
当前进度条进度 0.1330177743431221
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
你这不是有什么隐疾吧 0.9966232
你这不是有什么隐疾吧 0.96749055
你这不是有什么隐疾吧 0.9974286
你这不是有什么隐疾吧 0.9574496
你这不是有什么隐疾吧 0.99766666
你这不是有什么隐疾吧 0.9147852
你这不是有什么隐疾吧 0.995313
861.375 863.125 你这不是有什么隐疾吧
袁律 0.9962031
袁律 0.99878347
袁律 0.9989178
向律 0.9946163
--------------------------------------------------
865.375 866.125 袁律
向律 0.9665394
向律 0.9754399
866.125 866.875 向律
刚才有一位女士说要送这个给你 0.9561539
刚才有一位女士说要送这个给你 0.99790347
刚才有一位女士说要送这个给你 0.98934793
刚才有一位女士说要送这个给你 0.9543184
刚才有一位女士说要送这个给你 0.9667397
刚才有一位女士说要送这个给你 0.9852009
刚才有一位女士说要送这个给你 0.9942273
[0.13440880989180834]
当前进度条进度 0.13440880989180834
--------------------------------------------------
867.875 869.625 刚才有一位女士说要送这个给你
我知道我知道 0.9959393
我知道我知道 0.9968562
我知道我知道 0.99817514
我知道我知道 0.9963563
--------------------------------------------------
873.125 874.125 我知道我知道
药不能停 0.9906298
药不能停 0.9964988
药不能停 0.9953444
874.625 875.375 药不能停
凉了 0.99634457
凉了 0.99746007
换一杯 0.9976463
--------------------------------------------------
878.875 879.375 凉了
换一杯 0.9970338
换一杯 0.99754095
879.375 880.125 换一杯
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.1365340030911901]
当前进度条进度 0.1365340030911901
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
大会疼人啦 0.8558427
大会疼人啦 0.89373887
太会疼人啦 0.957815
太会疼人啦 0.9717309
太会疼人啦 0.84723103
大会疼人啦 0.8223098
会疼人啦 0.8562505
会疼人啦 0.8263006
太会疼人啦 0.97743165
太会疼人啦 0.96613836
太会疼人啦 0.9776987
--------------------------------------------------
884.125 886.875 太会疼人啦
0
0
0
0
[0.1382727975270479]
当前进度条进度 0.1382727975270479
0
0
0
榴莲味儿的 0.90221786
榴莲味儿的 0.94539577
榴莲味儿的 0.995469
榴莲味儿我喜欢 0.99339545
--------------------------------------------------
899.125 899.875 榴莲味儿的
榴莲味儿我喜欢 0.9609834
榴莲味儿我喜欢 0.99595726
榴莲味儿我喜欢 0.95175517
榴莲味儿我喜欢 0.9762519
0
899.875 901.125 榴莲味儿我喜欢
最讨厌榴莲了 0.99716026
最讨厌榴莲了 0.9809625
最讨厌榴莲了 0.9966266
901.625 902.375 最讨厌榴莲了
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
[0.1402047913446677]
当前进度条进度 0.1402047913446677
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
在看书啊 0.99455607
在看书啊 0.9903811
在看书啊 0.9919016
--------------------------------------------------
913.125 913.875 在看书啊
选一颗 0.9965113
选一颗 0.9961631
选一颗 0.99895865
--------------------------------------------------
915.125 915.875 选一颗
[0.14240726429675424]
当前进度条进度 0.14240726429675424
current excel_path: F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx
emit close Event
这什么味儿啊 0.9926056
保存表格到路径[F:/影视作品/国产电影/工作需要/hysxm\何以笙箫默.xlsx]成功
这什么味儿啊 0.9946838
这什么味儿啊 0.99278826
这什么味儿啊 0.99386734
--------------------------------------------------
922.375 923.375 这什么味儿啊
[import_slot] video_path=
current excel_path: None
emit close Event
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,13 +4,13 @@ import os
import cv2
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QMainWindow, QFileDialog, QTableWidget, QTableWidgetItem, QAbstractItemView, QProgressBar, QLabel, QApplication, QPushButton
from PyQt5.QtWidgets import QMainWindow, QFileDialog, QTableWidget, QTableWidgetItem, QAbstractItemView, QProgressBar, QLabel, QApplication, QPushButton, QMenu
from PyQt5.QtCore import QUrl, Qt, QTimer, QRect, pyqtSignal, QPersistentModelIndex
from PyQt5.QtMultimedia import *
from PyQt5.QtGui import QIcon
import utils
from utils import validate_and_get_filepath, stop_thread
from management import RunThread, ProjectContext, Element
from management import RunThread, ProjectContext, Element, make_print_to_file
from detect_dialog import Detect_Dialog
from assemble_dialog import Assemble_Dialog
from prompt_dialog import Prompt_Dialog
......@@ -88,7 +88,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.export_timer.timeout.connect(self.check_if_export_over_slot)
self.video_timer = QTimer()
self.video_timer.timeout.connect(self.change_videotime_label_slot)
self.video_timer.start(1000) # todo 作为参数配置
self.video_timer.start(5000) # todo 作为参数配置
self.refresh_tab_timer = QTimer()
self.refresh_tab_timer.timeout.connect(self.refresh_tab_slot)
......@@ -136,7 +136,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.action_redo.setEnabled(False)
# 暂时去掉了
# self.action_view_history.triggered.connect(self.view_history_slot)
self.action_operate.triggered.connect(self.operate_slot)
self.action_operate.triggered.connect(self.show_operate_dialog)
self.action_operate.setEnabled(False)
self.action_insert_aside_from_now.triggered.connect(self.insert_aside_from_now_slot)
self.action_insert_aside_from_now.setEnabled(False)
......@@ -195,6 +195,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
content_header = self.projectContext.contentHeader
self.all_tableWidget.setColumnCount(len(content_header))
self.all_tableWidget.setHorizontalHeaderLabels(content_header)
# 允许打开上下文菜单
self.all_tableWidget.setContextMenuPolicy(Qt.CustomContextMenu)
# 绑定事件
self.all_tableWidget.customContextMenuRequested.connect(self.generateMenu)
all_tableHead = self.all_tableWidget.horizontalHeader()
all_tableHead.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents)
all_tableHead.setSectionResizeMode(1, QtWidgets.QHeaderView.Stretch)
......@@ -259,6 +264,34 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 更新工程信息
self.projectContext.Init(project_path)
self.update_ui()
# 打印到log文件中
t = RunThread(funcName=make_print_to_file, args=os.path.join(os.getcwd(), 'log'), name="logging")
print(t)
make_print_to_file(os.path.join(os.getcwd(),'log'))
def generateMenu(self, pos):
print("pos",pos)
# 获取点击行号
for i in self.all_tableWidget.selectionModel().selection().indexes():
rowNum = i.row()
print(rowNum)
# 如果选择的行索引小于2,弹出上下文菜单
menu = QMenu()
item1 = menu.addAction("删除")
# 转换坐标系
screenPos = self.all_tableWidget.mapToGlobal(pos)
print("转换后的坐标", screenPos)
# 被阻塞
action = menu.exec(screenPos)
if action == item1:
print('选择了第1个菜单项',self.all_tableWidget.item(rowNum,0).text()
,self.all_tableWidget.item(rowNum,1).text()
,self.all_tableWidget.item(rowNum,2).text())
self.del_line_operation_slot(rowNum + 1)
return
# 重写关闭Mmainwindow窗口
def closeEvent(self, event):
......@@ -348,7 +381,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 打开某个工程
def open_project_slot(self):
project_path = QFileDialog.getExistingDirectory(self, "选择工程文件夹", os.getcwd())
print("[import_slot] project_path=" + project_path)
# print("[import_slot] project_path=" + project_path)
if project_path == "" or project_path == None:
return
self.init_project(project_path)
......@@ -373,7 +406,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.prompt_dialog.show_dialog_signal.emit(f"该工程原检测的视频对应路径{video_path}目前已失效,请导入新的视频重新开始检测或移动视频到对应位置,并重新启动工程")
self.import_movie.setEnabled(True)
else:
self.player.setMedia(QMediaContent(QUrl(video_path))) # 选取视频文件
self.player.setMedia(QMediaContent(QUrl.fromLocalFile(video_path))) # 选取视频文件
self.playVideo() # 播放视频
self.action_insert_aside_from_now.setEnabled(True)
self.insert_aside_from_now_btn.setEnabled(True)
......@@ -425,7 +458,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.projectContext.excel_path = book_path
# 获取视频的时长等信息,初始化开始结束时间
startTime = "00:00:00"
startTime = "00:01:00"
video = cv2.VideoCapture(video_path)
fps = video.get(cv2.CAP_PROP_FPS)
......@@ -680,12 +713,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
if self.is_video_playing is True:
self.player.pause()
self.is_video_playing = False
self.btn_play.setIcon(QIcon('images\播放.svg'))
self.btn_play.setIcon(QIcon('res\images\播放.svg'))
self.init_previewed_audio()
else:
self.player.play()
self.is_video_playing = True
self.btn_play.setIcon(QIcon("images\暂停.svg"))
self.btn_play.setIcon(QIcon("res\images\暂停.svg"))
self.init_previewed_audio()
def videoDoubleClicked(self, text):
......@@ -745,9 +778,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.all_tableWidget_idx = len(all_elements)
self.pb_tableWidget_idx = len(aside_list)
self.zm_tableWidget_idx = len(subtitle_list)
self.all_tableWidget.resizeRowsToContents()
self.pb_tableWidget.resizeRowsToContents()
self.zm_tableWidget.resizeRowsToContents()
# self.all_tableWidget.resizeRowsToContents()
# self.pb_tableWidget.resizeRowsToContents()
# self.zm_tableWidget.resizeRowsToContents()
if not user_operation:
self.projectContext.initial_ing = False
......@@ -767,7 +800,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
btn = QPushButton()
btn.setText(f"预览{idx}")
col = len(elem_list)
btn.clicked.connect(self.btn_pressed_preview_audio_slot)
btn.clicked.connect(self.audio_preview_slot)
table.setCellWidget(idx, col, btn)
......@@ -799,7 +832,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 只有Content页的字幕列和 Aside页的字幕列 可编辑
def btn_pressed_preview_audio_slot(self):
def audio_preview_slot(self):
btn = self.sender()
# 法1:按照物理位置。这样的结果不太对
idx = self.pb_tableWidget.indexAt(btn.pos())
......@@ -809,7 +842,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
audio_path = None
pos_sec = utils.trans_to_seconds(item.text())
audio_path = os.path.dirname(self.projectContext.excel_path) + (
"/tmp/%.2f.wav" % pos_sec)
"/tmp/%.3f.wav" % pos_sec)
print("待播放的音频文件为", audio_path)
if audio_path is not None:
# 确认该音频是否正在合成中
......@@ -857,6 +890,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
text = item.text() # 获取内容
self.init_previewed_audio()
# 停下旁白预览
self.audio_player.setMedia(QMediaContent())
if self.checkIfVideoTimeCanChange(row, col):
self.video_timer.stop()
self.video_timer.start(1000) # 双击的时候,就重启计时器,避免他跳转回video.position的地方去。
......@@ -932,7 +967,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
from speech_synthesis import speech_synthesis, Speaker, choose_speaker
audio_dir = os.path.dirname(self.projectContext.excel_path)
wav_path = audio_dir + \
'/tmp/%.2f.wav' % float(
'/tmp/%.3f.wav' % float(
self.projectContext.aside_list[int(row)].st_time_sec)
print("wav_path:", wav_path)
# speed_info = self.projectContext.speaker_speed
......@@ -1173,7 +1208,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
else:
self.prompt_dialog.show_with_msg("暂时无合成音频,请至少生成一条\n 旁白音频后再尝试导出")
def operate_slot(self):
def show_operate_dialog(self):
self.operation_dialog.show()
def insert_aside_from_now_slot(self):
......@@ -1185,7 +1220,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
idx = self.calculate_element_row(cur_time)
print("[insert_aside_from_now_slot] idx=", idx)
# 其实end_time目前是没啥用的,可以删掉了
if idx != len(self.projectContext.all_elements):
print("cur_lens", len(self.projectContext.all_elements))
if idx < len(self.projectContext.all_elements) - 1:
self.add_line_operation_slot(idx, str(cur_time), self.projectContext.all_elements[idx+1].st_time_sec,
"", "插入旁白,推荐字数为0", "",self.projectContext.speaker_speed)
else:
......@@ -1204,7 +1240,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 注意,这里需要用同一对象,不能生成多个Element
new_element = Element(start_time, end_time, subtitle, suggest, aside, speed)
self.projectContext.all_elements.insert(int(row), new_element)
self.all_tableWidget_idx=int(row)
self.all_tableWidget_idx = int(row)
if suggest is not None and "插入旁白,推荐字数为" in suggest:
idx = 0
while idx < len(self.projectContext.aside_list):
......@@ -1221,7 +1257,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
break
idx += 1
self.projectContext.subtitle_list.insert(idx, new_element)
self.zm_tableWidget_idx =idx
self.zm_tableWidget_idx = idx
self.refresh_tab_slot()
self.prompt_dialog.show_with_msg("操作成功!!请查看变化")
......@@ -1257,7 +1293,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.prompt_dialog.show_with_msg("操作成功!!请查看变化")
# 只有row起作用
def del_line_operation_slot(self, row, start_time, end_time, subtitle, suggest, aside, speed):
def del_line_operation_slot(self, row, start_time=0, end_time=0, subtitle="", suggest="", aside="", speed=""):
to_be_delete_element = self.projectContext.all_elements[int(row) - 1]
if self.projectContext.all_elements[int(row)-1].suggest is not None \
and "插入旁白,推荐字数为" in self.projectContext.all_elements[int(row)-1].suggest:
......
......@@ -224,8 +224,8 @@
</property>
<property name="icon">
<iconset>
<normaloff>images/播放.svg</normaloff>
<selectedon>images/暂停.svg</selectedon>images/播放.svg</iconset>
<normaloff>res/images/播放.svg</normaloff>
<selectedon>res/images/暂停.svg</selectedon>res/images/播放.svg</iconset>
</property>
<property name="iconSize">
<size>
......@@ -287,14 +287,14 @@
}
QSlider::handle:horizontal {
image: url(images/slider.svg);
image: url(res/images/slider.svg);
width: 12px;
height: 12px;
margin: -24px -12px;
}
QSlider::handle:vertical {
image: url(images/slider.svg);
image: url(res/images/slider.svg);
border-radius: 24px;
width: 12px;
height: 12px;
......
......@@ -111,8 +111,8 @@ class Ui_MainWindow(object):
" }")
self.btn_play.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("images/播放.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon.addPixmap(QtGui.QPixmap("images/暂停.svg"), QtGui.QIcon.Selected, QtGui.QIcon.On)
icon.addPixmap(QtGui.QPixmap("res/images/播放.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon.addPixmap(QtGui.QPixmap("res/images/暂停.svg"), QtGui.QIcon.Selected, QtGui.QIcon.On)
self.btn_play.setIcon(icon)
self.btn_play.setIconSize(QtCore.QSize(30, 30))
self.btn_play.setObjectName("btn_play")
......@@ -147,14 +147,14 @@ class Ui_MainWindow(object):
" }\n"
"\n"
" QSlider::handle:horizontal {\n"
" image: url(images/slider.svg);\n"
" image: url(res/images/slider.svg);\n"
" width: 12px;\n"
" height: 12px;\n"
" margin: -24px -12px;\n"
" }\n"
"\n"
" QSlider::handle:vertical {\n"
" image: url(images/slider.svg);\n"
" image: url(res/images/slider.svg);\n"
" border-radius: 24px;\n"
" width: 12px;\n"
" height: 12px;\n"
......
......@@ -114,7 +114,7 @@ class ProjectContext:
self.project_base_dir = None
self.video_path = None
self.excel_path = None
self.conf_path = 'conf.ini'
self.conf_path = 'res/conf.ini'
self.subtitle_list = []
self.aside_list = []
self.all_elements = []
......@@ -123,7 +123,7 @@ class ProjectContext:
self.duration = 0
# 一些常量
self.header = ["起始时间", "终止时间", "字幕", '建议', '解说脚本', "语速"]
self.aside_header = ['起始时间', '推荐插入字数', '解说脚本',"语速", "预览音频"]
self.aside_header = ['起始时间', '推荐字数', '解说脚本',"语速", "预览音频"]
self.subtitle_header = ["起始时间", "终止时间", "字幕"]
self.contentHeader = ["起始时间", "字幕", "解说脚本", "语速"]
......@@ -191,6 +191,8 @@ class ProjectContext:
def save_conf(self):
with open(self.conf_path, 'w', encoding='utf-8') as f:
# if len(self.caption_boundings) > 0:
# print(type(self.caption_boundings[0]))
# 将context里包含的一些信息保留下来,包括工程的检测进度、检测中间产物(excel)、视频路径、说话人信息
info = {
"video_path": self.video_path,
......@@ -344,7 +346,7 @@ class ProjectContext:
相关配置文件为"speaker.json",如果有信息需要修改,请在speaker.json中修改
"""
f = open("speakers.json", encoding="utf-8")
f = open("./res/speakers.json", encoding="utf-8")
content = json.load(f)
for speaker_info in content["speaker_details"]:
self.speakers.append(Speaker(speaker_info))
......@@ -473,6 +475,29 @@ def read_sheet(book_path: str, sheet_name: str = "") -> dict:
return sheet_content
def create_detail_day() -> str:
"""生成当天日期
Returns:
str: 当天日期
"""
daytime = datetime.datetime.now().strftime('day' + '%Y_%m_%d')
return daytime
def make_print_to_file(path: str = './'):
"""将print的内容输出到log文件夹中
Args:
path (str, optional): 设置的log文件夹路径. Defaults to './'.
"""
if not os.path.exists(path):
os.mkdir(path)
filename = create_detail_day() + '.log'
f = open(os.path.join(path, filename), 'a', encoding='utf-8')
print("log文件夹地址", path)
sys.stdout = f
if __name__ == '__main__':
# d = read_sheet("test37second.xlsx")
# print(d["字幕"])
......@@ -490,3 +515,5 @@ if __name__ == '__main__':
all_element = sorted(all_element, key = lambda x: x.st_time_sec)
print(all_element[0].st_time_sec)
......@@ -94,7 +94,9 @@ class Operation_Dialog(QDialog, Ui_Dialog):
self.set_all_user_component_status(True)
self.pickStartPos.setEnabled(True)
self.pickEndPos.setEnabled(True)
self.pushButton_3.setEnabled(False)
self.pushButton_3.setEnabled(True)
self.zmpb_change_slot()
self.adddel_change_slot()
def check_validate_slot(self):
# 校验行数
......@@ -150,12 +152,12 @@ class Operation_Dialog(QDialog, Ui_Dialog):
if row_number < rowCount:
assert float(self.mainWindow.projectContext.all_elements[list_idx+1].st_time_sec) > start_time_f
elif self.comboBox_2.currentText() == "修改一行":
if row_number >= 1:
if row_number > 1:
assert float(self.mainWindow.projectContext.all_elements[list_idx-1].st_time_sec) < start_time_f
if row_number < rowCount:
assert float(self.mainWindow.projectContext.all_elements[list_idx+1].st_time_sec) > start_time_f
# 要求start_time_f小于总时长
assert start_time_f < self.mainWindow.player.duration()/1000
assert start_time_f < self.mainWindow.player.duration() / 1000
except Exception as e:
import traceback
exc_traceback = ''.join(
......@@ -276,7 +278,7 @@ class Operation_Dialog(QDialog, Ui_Dialog):
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("./images/eagle_2.ico"))
app.setWindowIcon(QIcon("./res/images/eagle_2.ico"))
dialog = Operation_Dialog()
dialog.show()
sys.exit(app.exec_())
......@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>724</width>
<height>502</height>
<width>858</width>
<height>498</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0,0">
<item row="6" column="2">
<widget class="QLabel" name="label_11">
<property name="text">
......@@ -229,7 +229,7 @@
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
<item>
<widget class="QComboBox" name="comboBox">
<property name="enabled">
......
......@@ -125,7 +125,7 @@ class Ui_Dialog(object):
self.horizontalLayout.addWidget(self.comboBox)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.horizontalLayout.setStretch(0, 1)
# self.horizontalLayout.setStretch(0, 1)
self.horizontalLayout.setStretch(1, 1)
self.gridLayout.addLayout(self.horizontalLayout, 0, 1, 1, 1)
self.comboBox_2 = QtWidgets.QComboBox(Dialog)
......@@ -151,6 +151,7 @@ class Ui_Dialog(object):
self.timeEdit_2.setCurrentSectionIndex(2)
self.timeEdit_2.setObjectName("timeEdit_2")
self.gridLayout.addWidget(self.timeEdit_2, 3, 1, 1, 1)
self.gridLayout.setColumnStretch(1, 1)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
......
{
"speaker_details": [{
"id": 0,
"name": "晓辰",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "休闲、放松的语音,用于自发性对话和会议听录。",
"audio_path": "./res/speaker_audio/Xiaochen.wav",
"speaker_code": "zh-CN-XiaochenNeural"
},
{
"id": 1,
"name": "晓涵",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "温暖、甜美、富有感情的声音,可用于许多对话场景。",
"audio_path": "./res/speaker_audio/Xiaohan.wav",
"speaker_code": "zh-CN-XiaohanNeural"
},
{
"id": 2,
"name": "晓墨",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "清晰、放松的声音,具有丰富的角色扮演和情感,适合音频书籍。",
"audio_path": "./res/speaker_audio/Xiaomo.wav",
"speaker_code": "zh-CN-XiaomoNeural"
},
{
"id": 7,
"name": "晓晓",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "活泼、温暖的声音,具有多种场景风格和情感。",
"audio_path": "./res/speaker_audio/Xiaoxiao.wav",
"speaker_code": "zh-CN-XiaoxiaoNeural"
},
{
"id": 8,
"name": "晓萱",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "自信、有能力的声音,具有丰富的角色扮演和情感,适合音频书籍。",
"audio_path": "./res/speaker_audio/Xiaoxuan.wav",
"speaker_code": "zh-CN-XiaoxuanNeural"
},
{
"id": 9,
"name": "晓颜",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "训练有素、舒适的语音,用于客户服务和对话场景。",
"audio_path": "./res/speaker_audio/Xiaoyan.wav",
"speaker_code": "zh-CN-XiaoyanNeural"
},
{
"id": 3,
"name": "晓秋",
"language": "中文(普通话,简体)",
"age_group": "中年人",
"gender": "女",
"description": "智能、舒适的语音,适合阅读长内容。",
"audio_path": "./res/speaker_audio/Xiaoqiu.wav",
"speaker_code": "zh-CN-XiaoqiuNeural"
},
{
"id": 4,
"name": "晓秋",
"language": "中文(普通话,简体)",
"age_group": "中年人",
"gender": "女",
"description": "智能、舒适的语音,适合阅读长内容。",
"audio_path": "./res/speaker_audio/Xiaoqiu.wav",
"speaker_code": "zh-CN-XiaoqiuNeural"
},
{
"id": 5,
"name": "晓睿",
"language": "中文(普通话,简体)",
"age_group": "老年",
"gender": "女",
"description": "成熟、睿智的声音,具有丰富的情感,适合音频书籍。",
"audio_path": "./res/speaker_audio/Xiaorui.wav",
"speaker_code": "zh-CN-XiaoruiNeural"
},
{
"id": 6,
"name": "晓双",
"language": "中文(普通话,简体)",
"age_group": "儿童",
"gender": "女",
"description": "可爱、愉悦的语音,可应用于许多儿童相关场景。",
"audio_path": "./res/speaker_audio/Xiaoshuang.wav",
"speaker_code": "zh-CN-XiaoshuangNeural"
},
{
"id": 10,
"name": "晓悠",
"language": "中文(普通话,简体)",
"age_group": "儿童",
"gender": "女",
"description": "天使般的清晰声音,可以应用于许多儿童相关场景。",
"audio_path": "./res/speaker_audio/Xiaoyou.wav",
"speaker_code": "zh-CN-XiaoyouNeural"
},
{
"id": 11,
"name": "云希",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "男",
"description": "活泼、阳光的声音,具有丰富的情感,可用于许多对话场景。",
"audio_path": "./res/speaker_audio/Yunxi.wav",
"speaker_code": "zh-CN-YunxiNeural"
},
{
"id": 12,
"name": "云扬",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "男",
"description": "专业、流利的声音,具有多种场景风格。",
"audio_path": "./res/speaker_audio/Yunyang.wav",
"speaker_code": "zh-CN-YunyangNeural"
},
{
"id": 13,
"name": "云野",
"language": "中文(普通话,简体)",
"age_group": "中年人",
"gender": "男",
"description": "成熟、放松的声音,具有多种情感,适合音频书籍。",
"audio_path": "./res/speaker_audio/Yunye.wav",
"speaker_code": "zh-CN-YunyeNeural"
}
]
}
\ No newline at end of file
......@@ -104,7 +104,7 @@ def thread_it(func, *args, name):
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("./images/eagle_2.ico"))
app.setWindowIcon(QIcon("./res/images/eagle_2.ico"))
dialog = Setting_Dialog()
dialog.show()
sys.exit(app.exec_())
\ No newline at end of file
......@@ -6,78 +6,60 @@
<rect>
<x>0</x>
<y>0</y>
<width>612</width>
<height>404</height>
<width>420</width>
<height>216</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" columnstretch="2,1">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1" rowminimumheight="60,60">
<item row="0" column="0">
<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>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>130</x>
<y>130</y>
<width>181</width>
<height>31</height>
</rect>
</property>
<property name="currentText">
<string/>
</property>
</widget>
<widget class="QComboBox" name="comboBox_2">
<property name="geometry">
<rect>
<x>130</x>
<y>190</y>
<width>151</width>
<height>31</height>
</rect>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>旁白语速:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_2">
<property name="currentText">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>350</x>
<y>140</y>
<width>121</width>
<height>71</height>
</rect>
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="text">
<string>播放样例音频</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
......
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'setting_dialog.ui'
# Form implementation generated from reading ui file 'd:\AddCaption\cur_version\accessibility_movie_2\setting_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
......@@ -12,24 +14,35 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(612, 404)
Dialog.resize(420, 216)
self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
self.gridLayout_2.setObjectName("gridLayout_2")
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
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.setGeometry(QtCore.QRect(30, 200, 111, 16))
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
self.comboBox = QtWidgets.QComboBox(Dialog)
self.comboBox.setGeometry(QtCore.QRect(130, 130, 181, 31))
self.comboBox.setCurrentText("")
self.comboBox.setObjectName("comboBox")
self.gridLayout.addWidget(self.comboBox, 0, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1)
self.comboBox_2 = QtWidgets.QComboBox(Dialog)
self.comboBox_2.setGeometry(QtCore.QRect(130, 190, 151, 31))
self.comboBox_2.setCurrentText("")
self.comboBox_2.setObjectName("comboBox_2")
self.gridLayout.addWidget(self.comboBox_2, 1, 1, 1, 1)
self.gridLayout.setRowMinimumHeight(0, 60)
self.gridLayout.setRowMinimumHeight(1, 60)
self.gridLayout.setColumnStretch(1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(350, 140, 121, 71))
self.pushButton.setMinimumSize(QtCore.QSize(0, 60))
self.pushButton.setObjectName("pushButton")
self.gridLayout_2.addWidget(self.pushButton, 0, 1, 1, 1)
self.gridLayout_2.setColumnStretch(0, 2)
self.gridLayout_2.setColumnStretch(1, 1)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
......@@ -40,5 +53,3 @@ class Ui_Dialog(object):
self.label_3.setText(_translate("Dialog", "旁白说话人:"))
self.label_4.setText(_translate("Dialog", "旁白语速:"))
self.pushButton.setText(_translate("Dialog", "播放样例音频"))
{
"speaker_details": [
{
"id": 0,
"name": "晓辰",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "休闲、放松的语音,用于自发性对话和会议听录。",
"audio_path": "./speaker_audio/Xiaochen.wav",
"speaker_code": "zh-CN-XiaochenNeural"
},
{
"id": 1,
"name": "晓涵",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "温暖、甜美、富有感情的声音,可用于许多对话场景。",
"audio_path": "./speaker_audio/Xiaohan.wav",
"speaker_code": "zh-CN-XiaohanNeural"
},
{
"id": 2,
"name": "晓墨",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "清晰、放松的声音,具有丰富的角色扮演和情感,适合音频书籍。",
"audio_path": "./speaker_audio/Xiaomo.wav",
"speaker_code": "zh-CN-XiaomoNeural"
},
{
"id": 7,
"name": "晓晓",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "活泼、温暖的声音,具有多种场景风格和情感。",
"audio_path": "./speaker_audio/Xiaoxiao.wav",
"speaker_code": "zh-CN-XiaoxiaoNeural"
},
{
"id": 8,
"name": "晓萱",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "自信、有能力的声音,具有丰富的角色扮演和情感,适合音频书籍。",
"audio_path": "./speaker_audio/Xiaoxuan.wav",
"speaker_code": "zh-CN-XiaoxuanNeural"
},
{
"id": 9,
"name": "晓颜",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "女",
"description": "训练有素、舒适的语音,用于客户服务和对话场景。",
"audio_path": "./speaker_audio/Xiaoyan.wav",
"speaker_code": "zh-CN-XiaoyanNeural"
},
{
"id": 3,
"name": "晓秋",
"language": "中文(普通话,简体)",
"age_group": "中年人",
"gender": "女",
"description": "智能、舒适的语音,适合阅读长内容。",
"audio_path": "./speaker_audio/Xiaoqiu.wav",
"speaker_code": "zh-CN-XiaoqiuNeural"
},
{
"id": 4,
"name": "晓秋",
"language": "中文(普通话,简体)",
"age_group": "中年人",
"gender": "女",
"description": "智能、舒适的语音,适合阅读长内容。",
"audio_path": "./speaker_audio/Xiaoqiu.wav",
"speaker_code": "zh-CN-XiaoqiuNeural"
},
{
"id": 5,
"name": "晓睿",
"language": "中文(普通话,简体)",
"age_group": "老年",
"gender": "女",
"description": "成熟、睿智的声音,具有丰富的情感,适合音频书籍。",
"audio_path": "./speaker_audio/Xiaorui.wav",
"speaker_code": "zh-CN-XiaoruiNeural"
},
{
"id": 6,
"name": "晓双",
"language": "中文(普通话,简体)",
"age_group": "儿童",
"gender": "女",
"description": "可爱、愉悦的语音,可应用于许多儿童相关场景。",
"audio_path": "./speaker_audio/Xiaoshuang.wav",
"speaker_code": "zh-CN-XiaoshuangNeural"
},
{
"id": 10,
"name": "晓悠",
"language": "中文(普通话,简体)",
"age_group": "儿童",
"gender": "女",
"description": "天使般的清晰声音,可以应用于许多儿童相关场景。",
"audio_path": "./speaker_audio/Xiaoyou.wav",
"speaker_code": "zh-CN-XiaoyouNeural"
},
{
"id": 11,
"name": "云希",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "男",
"description": "活泼、阳光的声音,具有丰富的情感,可用于许多对话场景。",
"audio_path": "./speaker_audio/Yunxi.wav",
"speaker_code": "zh-CN-YunxiNeural"
},
{
"id": 12,
"name": "云扬",
"language": "中文(普通话,简体)",
"age_group": "年轻人",
"gender": "男",
"description": "专业、流利的声音,具有多种场景风格。",
"audio_path": "./speaker_audio/Yunyang.wav",
"speaker_code": "zh-CN-YunyangNeural"
},
{
"id": 13,
"name": "云野",
"language": "中文(普通话,简体)",
"age_group": "中年人",
"gender": "男",
"description": "成熟、放松的声音,具有多种情感,适合音频书籍。",
"audio_path": "./speaker_audio/Yunye.wav",
"speaker_code": "zh-CN-YunyeNeural"
}
]
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ adjusted_wav_path = "adjusted.wav"
normal_speed = 4
normal_interval = 0.1
ffmpeg_path = r'.\ffmpeg-4.3.1\bin\ffmpeg'
ffmpeg_path = r'.\res\ffmpeg-4.3.1\bin\ffmpeg'
speakers = []
part_len = 50
......
......@@ -14,7 +14,7 @@
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
ffmpeg_path = r'.\ffmpeg-4.3.1\bin\ffmpeg'
ffmpeg_path = r'.\res\ffmpeg-4.3.1\bin\ffmpeg'
def extract_audio(video_path: str, root: str, start_time: float, end_time: float, state=None) -> str:
......
......@@ -19,18 +19,11 @@ if __name__ == '__main__':
try:
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
# app = QApplication(sys.argv)
# app.setWindowIcon(QIcon("./images/eagle_2.ico"))
# mainWindow = MainWindow()
# mainWindow.setWindowTitle("无障碍电影制作软件")
# apply_stylesheet(app, theme='dark_amber.xml')
# mainWindow.show()
# sys.exit(app.exec_())
currentExitCode = MainWindow.EXIT_CODE_REBOOT
while currentExitCode == MainWindow.EXIT_CODE_REBOOT:
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("./images/eagle_2.ico"))
app.setWindowIcon(QIcon("./res/images/eagle_2.ico"))
mainWindow = MainWindow(project_path)
if project_path == None or project_path == "":
mainWindow.setWindowTitle(f"无障碍电影制作软件(请打开或新建工程)")
......
File deleted
File deleted
import sys
from PyQt5.QtWidgets import (QWidget, QTableWidget, QHBoxLayout, QApplication, QTableWidgetItem, QAbstractItemView)
from PyQt5.QtCore import Qt
class TableWidget(QWidget):
def __init__(self):
super(TableWidget,self).__init__()
self.initUI()
def initUI(self):
self.setWindowTitle("QTableWidget演示")
self.resize(430, 230);
layout = QHBoxLayout()
tablewidget = QTableWidget()
tablewidget.setRowCount(4)
tablewidget.setColumnCount(6)
tablewidget.clear()
layout.addWidget(tablewidget)
tablewidget.setHorizontalHeaderLabels(['时间','文字'])
nameItem = QTableWidgetItem("0:00")
# nameItem.setFlags()
tablewidget.setItem(0,0,nameItem)
ageItem = QTableWidgetItem("24")
tablewidget.setItem(0,1,ageItem)
jgItem = QTableWidgetItem("北京")
jgItem.setFlags(Qt.ItemIsEnabled)
# jgItem.setFlags(Qt.ItemFlags(32))
# jgItem.checkState()
tablewidget.setItem(0,2,jgItem)
self.tablewidget = tablewidget
# 禁止编辑
# tablewidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
# 整行选择
# tablewidget.setSelectionBehavior(QAbstractItemView.SelectRows)
# 调整列和行
# tablewidget.resizeColumnsToContents()
# tablewidget.resizeRowsToContents()
# tablewidget.horizontalHeader().setVisible(False)
# tablewidget.verticalHeader().setVisible(False)
tablewidget.setVerticalHeaderLabels(["a","b"])
# 隐藏表格线
tablewidget.setShowGrid(False)
self.setLayout(layout)
tablewidget.itemDoubleClicked.connect(self.show_data)
# tablewidget.itemActivated.connect(self.show_data2)
tablewidget.itemChanged.connect(self.show_data2)
self.table = tablewidget
# tablewidget.itemPressed.connect(self.show_data2)
# tablewidget.itemEntered.connect(self.show_data2)
# tablewidget.cellEntered.connect(self.show_data4)
# tablewidget.cellChanged.connect(self.show_data3)
def show_data4(self, row, col):
print("in show_data4")
print("row=", row, "col=", col)
def show_data3(self, row, col):
print("in show_data3")
print("row=",row,"col=",col)
def show_data(self, Item):
# 如果单元格对象为空
if Item is None:
print("Is None")
return
else:
print(Item.checkState())
row = Item.row() # 获取行数
col = Item.column() # 获取列数 注意是column而不是col哦
text = Item.text() # 获取内容
# 输出测试
print('row = ', row)
print('col =', col)
print('text = ', text)
print(self.table.itemAt(0,0).text())
def show_data2(self, Item):
print("in show_data2")
self.tablewidget.clear()
# 如果单元格对象为空
if Item is None:
return
else:
row = Item.row() # 获取行数
col = Item.column() # 获取列数 注意是column而不是col哦
text = Item.text() # 获取内容
# 输出测试
print('row = ', row)
print('col =', col)
print('text = ', text)
if __name__ == '__main__':
app = QApplication(sys.argv)
example = TableWidget()
example.show()
sys.exit(app.exec_())
......@@ -40,7 +40,7 @@ def transfer_second_to_time(sec: str) -> str:
hour = int(duration/3600)
minutes = int((duration % 3600)/60)
seconds = int(duration%60)
msec = (float(sec) - hour * 3600 - minutes * 60 - seconds) * 1000
msec = round((float(sec) - hour * 3600 - minutes * 60 - seconds) * 1000)
time = "%02d:%02d:%02d.%03d" % (hour, minutes, seconds, msec)
return time
......
......@@ -224,8 +224,8 @@
</property>
<property name="icon">
<iconset>
<normaloff>images/播放.svg</normaloff>
<selectedon>images/暂停.svg</selectedon>images/播放.svg</iconset>
<normaloff>res/images/播放.svg</normaloff>
<selectedon>res/images/暂停.svg</selectedon>res/images/播放.svg</iconset>
</property>
<property name="iconSize">
<size>
......@@ -287,14 +287,14 @@
}
QSlider::handle:horizontal {
image: url(images/slider.svg);
image: url(res/images/slider.svg);
width: 12px;
height: 12px;
margin: -24px -12px;
}
QSlider::handle:vertical {
image: url(images/slider.svg);
image: url(res/images/slider.svg);
border-radius: 24px;
width: 12px;
height: 12px;
......
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
env_dir = 'D:/无障碍电影制作系统/'
missingPkgs = ['Microsoft.CognitiveServices.Speech.core.dll', 'decorator.py', 'google', 'paddle', 'paddleocr', 'PIL', 'requests', 'urllib3', 'http', 'idna', 'certifi', 'setuptools', 'astor']
def add_missing_packages(lst):
pkgs = []
for x in lst:
if '.' in x:
pkgs.append((env_dir + x, '.'))
else:
pkgs.append((env_dir + x , x))
return pkgs
pkgPaths = add_missing_packages(missingPkgs)
a = Analysis(
['start.py'],
pathex=[],
binaries=[],
datas=[('res', 'res')] + pkgPaths,
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='无障碍电影制作系统',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['res\\images\\eagle_2.ico'],
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='无障碍电影制作系统',
)
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