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
4733180f
Commit
4733180f
authored
Aug 21, 2023
by
cxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix for import excel
parent
60f70e01
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
77 additions
and
52 deletions
+77
-52
cap.png
cap.png
+0
-0
ding_notify.conf
ding_notify.conf
+6
-0
ding_utils.py
ding_utils.py
+39
-30
excel_utils.py
excel_utils.py
+1
-1
main_window.py
main_window.py
+22
-15
render.py
render.py
+4
-1
conf.ini
res/conf.ini
+2
-2
speakers.json
res/speakers.json
+1
-1
start.spec
start.spec
+1
-1
utils.py
utils.py
+1
-1
No files found.
cap.png
0 → 100644
View file @
4733180f
34.8 KB
ding_notify.conf
0 → 100644
View file @
4733180f
{
"user_name"
:
"盲文出版社"
,
"dd_url_prefix"
:
"https://oapi.dingtalk.com/robot/send?access_token=a7e6b223bc0a6e4b5e3f64b1570d0c884db0d833592f5e84b020c2896130d659"
,
"secret"
:
"SEC252452789bc17cfb1e6c973f837426fa0f9fd50c8793239c070e9d3c021d8109"
}
\ No newline at end of file
ding_utils.py
View file @
4733180f
...
...
@@ -9,35 +9,44 @@ import base64
import
hashlib
import
urllib.parse
user_name
=
"盲文出版社"
dd_url_prefix
=
"https://oapi.dingtalk.com/robot/send?access_token=a7e6b223bc0a6e4b5e3f64b1570d0c884db0d833592f5e84b020c2896130d659"
# dd_url_prefix = "https://oapi.dingtalk.com/robot/send?access_token=12a5e64b24e7345fed2415c5c2f9101180763e327b21727cd35fdaa3fb274e74"
secret
=
'SEC252452789bc17cfb1e6c973f837426fa0f9fd50c8793239c070e9d3c021d8109'
# secret = "SECb5d68b27bd2e4694667d36c0f91336f3641b3287b945906a83997353f961d415"
with
open
(
"./ding_notify.conf"
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
json_obj
=
json
.
load
(
f
)
# user_name = "盲文出版社"
# dd_url_prefix = "https://oapi.dingtalk.com/robot/send?access_token=a7e6b223bc0a6e4b5e3f64b1570d0c884db0d833592f5e84b020c2896130d659"
# # dd_url_prefix = "https://oapi.dingtalk.com/robot/send?access_token=12a5e64b24e7345fed2415c5c2f9101180763e327b21727cd35fdaa3fb274e74"
# secret = 'SEC252452789bc17cfb1e6c973f837426fa0f9fd50c8793239c070e9d3c021d8109'
# # secret = "SECb5d68b27bd2e4694667d36c0f91336f3641b3287b945906a83997353f961d415"
user_name
=
json_obj
[
"user_name"
]
dd_url_prefix
=
json_obj
[
"dd_url_prefix"
]
secret
=
json_obj
[
"secret"
]
def
notify
(
err
):
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
secret_enc
=
secret
.
encode
(
'utf-8'
)
string_to_sign
=
'{}
\n
{}'
.
format
(
timestamp
,
secret
)
string_to_sign_enc
=
string_to_sign
.
encode
(
'utf-8'
)
hmac_code
=
hmac
.
new
(
secret_enc
,
string_to_sign_enc
,
digestmod
=
hashlib
.
sha256
)
.
digest
()
sign
=
urllib
.
parse
.
quote_plus
(
base64
.
b64encode
(
hmac_code
))
print
(
timestamp
)
print
(
sign
)
dd_url
=
dd_url_prefix
+
"×tamp="
+
timestamp
+
"&sign="
+
sign
h
=
{
"Content-Type"
:
"application/json"
}
d
=
{
"msgtype"
:
"markdown"
,
"markdown"
:
{
"title"
:
"msg"
,
"text"
:
"| 用户名称:
%
s
\n
"
%
(
user_name
)
+
"
\n
"
+
"| 异常时间:
%
s
\n
"
%
(
time
.
strftime
(
'
%
Y:
%
m:
%
d
%
H:
%
M:
%
S'
,
time
.
localtime
(
int
(
time
.
time
()))))
+
"
\n
"
+
"| 异常信息:
%
s
\n
"
%
(
err
)
try
:
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
secret_enc
=
secret
.
encode
(
'utf-8'
)
string_to_sign
=
'{}
\n
{}'
.
format
(
timestamp
,
secret
)
string_to_sign_enc
=
string_to_sign
.
encode
(
'utf-8'
)
hmac_code
=
hmac
.
new
(
secret_enc
,
string_to_sign_enc
,
digestmod
=
hashlib
.
sha256
)
.
digest
()
sign
=
urllib
.
parse
.
quote_plus
(
base64
.
b64encode
(
hmac_code
))
print
(
timestamp
)
print
(
sign
)
dd_url
=
dd_url_prefix
+
"×tamp="
+
timestamp
+
"&sign="
+
sign
h
=
{
"Content-Type"
:
"application/json"
}
d
=
{
"msgtype"
:
"markdown"
,
"markdown"
:
{
"title"
:
"msg"
,
"text"
:
"| 用户名称:
%
s
\n
"
%
(
user_name
)
+
"
\n
"
+
"| 异常时间:
%
s
\n
"
%
(
time
.
strftime
(
'
%
Y:
%
m:
%
d
%
H:
%
M:
%
S'
,
time
.
localtime
(
int
(
time
.
time
()))))
+
"
\n
"
+
"| 异常信息:
%
s
\n
"
%
(
err
)
}
}
}
r
=
requests
.
post
(
dd_url
,
json
.
dumps
(
d
),
headers
=
h
)
print
(
r
.
status_code
)
print
(
r
.
text
)
\ No newline at end of file
r
=
requests
.
post
(
dd_url
,
json
.
dumps
(
d
),
headers
=
h
)
print
(
r
.
status_code
)
print
(
r
.
text
)
except
Exception
as
e
:
print
(
"ding notify err"
)
print
(
e
)
\ No newline at end of file
excel_utils.py
View file @
4733180f
...
...
@@ -93,7 +93,7 @@ def read_xlsx(file_path):
new_element
=
Element
(
start_time
,
end_time
,
subtitle
,
suggest
,
aside
,
speed
)
new_element
.
print_self
()
elements
.
append
(
new_element
)
#
checkLength(elements)
checkLength
(
elements
)
print
(
"element size:"
)
print
(
len
(
elements
))
return
elements
...
...
main_window.py
View file @
4733180f
...
...
@@ -759,7 +759,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self
.
all_threads
.
append
(
t
)
for
t
in
self
.
threads
:
t
.
start
()
try
:
t
.
start
()
except
Exception
as
e
:
print
(
e
)
print
(
"===子线程已经开启 in detect ==="
)
self
.
statusbarLabel
.
setText
(
" 准备检测:"
)
...
...
@@ -1696,20 +1699,24 @@ class MainWindow(QMainWindow, Ui_MainWindow):
"""撤销之前对表格内容的修改操作
"""
self
.
can_write_history
=
False
self
.
user_editing_aside
=
True
record
=
self
.
projectContext
.
history_pop
()
print
(
'[undo_slot] record=
%
s'
%
(
record
.
to_string
()))
item
=
QTableWidgetItem
(
record
.
old_str
)
row
=
int
(
record
.
row
)
# self.projectContext.aside_list[row].aside = record.old_str
# self.pb_tableWidget.setItem(
# row, constant.Aside.AsideColumnNumber, item)
self
.
projectContext
.
all_elements
[
row
]
.
aside
=
record
.
old_str
self
.
all_tableWidget
.
setItem
(
row
,
constant
.
Content
.
AsideColumnNumber
,
item
)
self
.
action_redo
.
setEnabled
(
True
)
try
:
self
.
can_write_history
=
False
self
.
user_editing_aside
=
True
record
=
self
.
projectContext
.
history_pop
()
print
(
'[undo_slot] record=
%
s'
%
(
record
.
to_string
()))
item
=
QTableWidgetItem
(
record
.
old_str
)
row
=
int
(
record
.
row
)
# self.projectContext.aside_list[row].aside = record.old_str
# self.pb_tableWidget.setItem(
# row, constant.Aside.AsideColumnNumber, item)
self
.
projectContext
.
all_elements
[
row
]
.
aside
=
record
.
old_str
self
.
all_tableWidget
.
setItem
(
row
,
constant
.
Content
.
AsideColumnNumber
,
item
)
self
.
action_redo
.
setEnabled
(
True
)
except
Exception
as
e
:
print
(
"undo slot err"
)
print
(
e
)
def
redo_slot
(
self
):
"""重做之前撤销的对表格内容的修改操作
...
...
render.py
View file @
4733180f
...
...
@@ -32,7 +32,10 @@ class ExportProcessor(QWidget):
self
.
threads
.
append
(
t
)
for
t
in
self
.
threads
:
t
.
start
()
try
:
t
.
start
()
except
Exception
as
e
:
print
(
e
)
print
(
"===子线程已经开启 in export==="
)
...
...
res/conf.ini
View file @
4733180f
{"video_path":
null,
"excel_path":
null,
"detection_info":
{"detected":
false,
"nd_process":
0.0,
"last_time":
0.0,
"caption_boundings":
[]
,
"has_subtitle":
true},
"speaker_info":
{"speaker_type":
"\u79d1\u5927\u8baf\u98de",
"speaker_id":
"\u6653\u8fb0\uff0c\u5973\uff0c\u5e74\u8f7b\u4eba",
"speaker_speed":
"1.00(4\u5b57/\u79d2)"}}
\ No newline at end of file
{"video_path":
null,
"excel_path":
null,
"detection_info":
{"detected":
false,
"nd_process":
0.0,
"last_time":
0.0,
"caption_boundings":
[]
,
"has_subtitle":
true},
"speaker_info":
{"speaker_type":
"\u6d59\u5927\u5185\u90e8tts",
"speaker_id":
"eagle\uff0c\u5973\uff0c\u5e74\u8f7b\u4eba",
"speaker_speed":
"1.00(4\u5b57/\u79d2)"}}
\ No newline at end of file
res/speakers.json
View file @
4733180f
...
...
@@ -142,7 +142,7 @@
],
"speaker_zju_details"
:
[{
"id"
:
0
,
"name"
:
"
test
"
,
"name"
:
"
eagle
"
,
"language"
:
"中文(普通话,简体)"
,
"age_group"
:
"年轻人"
,
"gender"
:
"女"
,
...
...
start.spec
View file @
4733180f
...
...
@@ -20,7 +20,7 @@ a = Analysis(
[
'start.py'
],
pathex
=
[],
binaries
=
[],
datas
=
[(
'vits_chinese'
,
'vits_chinese'
)]
+
[(
'res'
,
'res'
),(
'./deploy.bat'
,
'.'
),(
'LAVFilters64'
,
'LAVFilters64'
),(
'LAVFilters32'
,
'LAVFilters32'
)]
+
pkgPaths
,
datas
=
[(
'vits_chinese'
,
'vits_chinese'
)]
+
[(
'res'
,
'res'
),(
'./deploy.bat'
,
'.'
),(
'
./ding_notify.conf'
,
'.'
),(
'
LAVFilters64'
,
'LAVFilters64'
),(
'LAVFilters32'
,
'LAVFilters32'
)]
+
pkgPaths
,
hiddenimports
=
[
'filecmp'
],
hookspath
=
[],
hooksconfig
=
{},
...
...
utils.py
View file @
4733180f
...
...
@@ -132,7 +132,7 @@ def check_sheet_content(book_path: str) -> bool:
bool: True(用户输入的表符合预期) or False(用户输入的表格式不正确,很可能输入错误)
"""
sheet_heads
=
get_sheetHead
(
book_path
)
need_heads
=
[
'起始时间'
,
'终止时间'
,
'字幕'
,
'建议'
,
'解说脚本'
]
need_heads
=
[
'起始时间'
,
'终止时间'
,
'字幕'
,
'建议
旁白字数
'
,
'解说脚本'
]
if
len
(
sheet_heads
)
==
0
:
return
False
...
...
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