shixian.shi
commited on
Commit
·
2aacd40
1
Parent(s):
852ca96
update ui
Browse files
app.py
CHANGED
|
@@ -28,30 +28,31 @@ if __name__ == "__main__":
|
|
| 28 |
def video_clip_addsub(dest_text, start_ost, end_ost, state, font_size, font_color):
|
| 29 |
return audio_clipper.video_clip(dest_text, start_ost, end_ost, state, font_size, font_color, add_sub=True)
|
| 30 |
|
| 31 |
-
|
| 32 |
top_md_1 = ("""
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
* Step1:
|
| 38 |
-
* Step2:
|
| 39 |
-
* Step3:
|
| 40 |
""")
|
| 41 |
-
|
| 42 |
|
| 43 |
top_md_2 = ("""
|
| 44 |
-
|
| 45 |
-
|
|
|
|
| 46 |
<div align="center">
|
| 47 |
<div style="display:flex; gap: 0.25rem;" align="center">
|
| 48 |
FunASR_APP: <a href='https://github.com/alibaba/funasr-app'><img src='https://img.shields.io/badge/Github-Code-blue'></a>
|
| 49 |
-
|
| 50 |
</div>
|
| 51 |
</div>
|
| 52 |
""")
|
| 53 |
|
| 54 |
-
top_md_3 = ("""
|
| 55 |
<div align="center">
|
| 56 |
<div style="display:flex; gap: 0.25rem;" align="center">
|
| 57 |
FunASR: <a href='https://github.com/alibaba-damo-academy/FunASR'><img src='https://img.shields.io/badge/Github-Code-blue'></a>
|
|
@@ -64,9 +65,9 @@ if __name__ == "__main__":
|
|
| 64 |
# gradio interface
|
| 65 |
with gr.Blocks() as demo:
|
| 66 |
#gr.Image("./examples/guide.png", show_label=False)
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
video_state = gr.State()
|
| 71 |
audio_state = gr.State()
|
| 72 |
with gr.Tab("🎥✂️视频裁剪 Video Clipping"):
|
|
|
|
| 28 |
def video_clip_addsub(dest_text, start_ost, end_ost, state, font_size, font_color):
|
| 29 |
return audio_clipper.video_clip(dest_text, start_ost, end_ost, state, font_size, font_color, add_sub=True)
|
| 30 |
|
| 31 |
+
|
| 32 |
top_md_1 = ("""
|
| 33 |
+
A video clip tool based on Paraformer-long's VAD, ASR, timestamp prediction, punctuation restoration abilities.
|
| 34 |
|
| 35 |
+
Get the video clip simply following steps:
|
| 36 |
|
| 37 |
+
* Step1: Upload video file (or try examples below), click **<font color="#f7802b">Recognize</font>** button
|
| 38 |
+
* Step2: Copy text segments you need to 'Text to Clip', set the subtitle settings (if you need)
|
| 39 |
+
* Step3: Click **<font color="#f7802b">Clip</font>** button or **<font color="#f7802b">Clip and Generate Subtitles</font>** button
|
| 40 |
""")
|
| 41 |
+
|
| 42 |
|
| 43 |
top_md_2 = ("""
|
| 44 |
+
The video had better to have size under 40Mb,
|
| 45 |
+
For video in large size, you can split the audio from it and use 'Audio Clip',
|
| 46 |
+
or **<font color="#1785c4">establish your own gradio service with the source code (recommanded)</font>** :
|
| 47 |
<div align="center">
|
| 48 |
<div style="display:flex; gap: 0.25rem;" align="center">
|
| 49 |
FunASR_APP: <a href='https://github.com/alibaba/funasr-app'><img src='https://img.shields.io/badge/Github-Code-blue'></a>
|
| 50 |
+
🌟Support Us: <a href='https://github.com/alibaba/funasr-app/stargazers'><img src='https://img.shields.io/github/stars/alibaba/funasr-app.svg?style=social'></a>
|
| 51 |
</div>
|
| 52 |
</div>
|
| 53 |
""")
|
| 54 |
|
| 55 |
+
top_md_3 = ("""You may understand FunASR futher with source code and paper:
|
| 56 |
<div align="center">
|
| 57 |
<div style="display:flex; gap: 0.25rem;" align="center">
|
| 58 |
FunASR: <a href='https://github.com/alibaba-damo-academy/FunASR'><img src='https://img.shields.io/badge/Github-Code-blue'></a>
|
|
|
|
| 65 |
# gradio interface
|
| 66 |
with gr.Blocks() as demo:
|
| 67 |
#gr.Image("./examples/guide.png", show_label=False)
|
| 68 |
+
gr.Markdown(top_md_1)
|
| 69 |
+
gr.Markdown(top_md_2)
|
| 70 |
+
gr.Markdown(top_md_3)
|
| 71 |
video_state = gr.State()
|
| 72 |
audio_state = gr.State()
|
| 73 |
with gr.Tab("🎥✂️视频裁剪 Video Clipping"):
|