Spaces:
Running
on
A10G
Running
on
A10G
Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,7 @@ jsons = {
|
|
43 |
}
|
44 |
|
45 |
def get_video_url(option):
|
|
|
46 |
return videos[option]
|
47 |
|
48 |
@spaces.GPU()
|
@@ -72,7 +73,7 @@ def evaluate_sign_language(user_video, standard_video_option):
|
|
72 |
# 初始化反馈报告
|
73 |
qualification = "不合格" if score < 60 else "合格"
|
74 |
advice = f"""<div style='font-family: "Heiti SC"; text-align: center; font-size: 24px;'><b>\n手語表現反饋報告</b></div>
|
75 |
-
<br><br><br><b>日期:</b> {current_date}<br><
|
76 |
|
77 |
part_translation = {
|
78 |
'Right Hand': '右手細節、',
|
@@ -100,7 +101,9 @@ def evaluate_sign_language(user_video, standard_video_option):
|
|
100 |
advice += "無"
|
101 |
|
102 |
advice += "<br>建議:請參考標準視頻,模仿正確的動作,保持速度一致。<br><br>"
|
103 |
-
|
|
|
|
|
104 |
|
105 |
ret_video = gen_audio(subtitles, tmpdir)
|
106 |
return advice, ret_video, tmp
|
@@ -150,7 +153,6 @@ with gr.Blocks(
|
|
150 |
with gr.Column():
|
151 |
video_selector = gr.Dropdown(list(videos.keys()), label="請選擇教學視頻")
|
152 |
video_player = gr.Video(label="請觀看教學視頻演示")
|
153 |
-
video_selector.change(get_video_url, inputs=video_selector, outputs=video_player)
|
154 |
with gr.Column():
|
155 |
upload_video = gr.Video(label="請錄製/上傳您的視頻,點擊\'開始評估\'")
|
156 |
evaluate_button = gr.Button("開始評估")
|
@@ -159,7 +161,7 @@ with gr.Blocks(
|
|
159 |
advice_output = gr.HTML(label="反饋報告")
|
160 |
with gr.Column():
|
161 |
compare_video_player = gr.Video(label="評估結果")
|
162 |
-
|
163 |
tmp_dir_state = gr.State()
|
164 |
evaluate_button.click(
|
165 |
evaluate_sign_language,
|
|
|
43 |
}
|
44 |
|
45 |
def get_video_url(option):
|
46 |
+
# print(videos[option])
|
47 |
return videos[option]
|
48 |
|
49 |
@spaces.GPU()
|
|
|
73 |
# 初始化反馈报告
|
74 |
qualification = "不合格" if score < 60 else "合格"
|
75 |
advice = f"""<div style='font-family: "Heiti SC"; text-align: center; font-size: 24px;'><b>\n手語表現反饋報告</b></div>
|
76 |
+
<br><br><br><b>日期:</b> {current_date}<br><br><b>改進建議(供參考):</b><br>"""
|
77 |
|
78 |
part_translation = {
|
79 |
'Right Hand': '右手細節、',
|
|
|
101 |
advice += "無"
|
102 |
|
103 |
advice += "<br>建議:請參考標準視頻,模仿正確的動作,保持速度一致。<br><br>"
|
104 |
+
|
105 |
+
advice += f"<b>整體结果:</b> {qualification}<br>"
|
106 |
+
# advice += f"<b>整體结果:</b> 您本次的總評分為 {score:.2f}/100分。<br>"
|
107 |
|
108 |
ret_video = gen_audio(subtitles, tmpdir)
|
109 |
return advice, ret_video, tmp
|
|
|
153 |
with gr.Column():
|
154 |
video_selector = gr.Dropdown(list(videos.keys()), label="請選擇教學視頻")
|
155 |
video_player = gr.Video(label="請觀看教學視頻演示")
|
|
|
156 |
with gr.Column():
|
157 |
upload_video = gr.Video(label="請錄製/上傳您的視頻,點擊\'開始評估\'")
|
158 |
evaluate_button = gr.Button("開始評估")
|
|
|
161 |
advice_output = gr.HTML(label="反饋報告")
|
162 |
with gr.Column():
|
163 |
compare_video_player = gr.Video(label="評估結果")
|
164 |
+
video_selector.change(get_video_url, inputs=video_selector, outputs=video_player)
|
165 |
tmp_dir_state = gr.State()
|
166 |
evaluate_button.click(
|
167 |
evaluate_sign_language,
|