shixian.shi commited on
Commit
2aacd40
·
1 Parent(s): 852ca96
Files changed (1) hide show
  1. app.py +15 -14
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
- 基于达摩院自研Paraformer-长音频版的语音识别、端点检测、标点预测、时间戳功能
34
 
35
- 准确识别,自由复制所需段落并一键裁剪、添加字幕
36
 
37
- * Step1: 上传视频文件(或使用下方的用例体验),点击 **<font color="#f7802b">识别</font>** 按钮
38
- * Step2: 复制识别结果中所需的文字至右上方,设置偏移与字幕配置(可选)
39
- * Step3: 点击 **<font color="#f7802b">裁剪</font>** 按钮或 **<font color="#f7802b">裁剪并添加字幕</font>** 按钮获得结果
40
  """)
41
- '''
42
 
43
  top_md_2 = ("""
44
- 受到网络传输与服务资源的限制,用于体验的视频最好大小在40mb以下
45
- 过大的视频可以尝试分离音轨使用音频剪辑,或 **<font color="#1785c4">通过源代码将您的ClipVideo服务部署在本地(推荐)</font>**
 
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
- 🌟支持我们: <a href='https://github.com/alibaba/funasr-app/stargazers'><img src='https://img.shields.io/github/stars/alibaba/funasr-app.svg?style=social'></a>
50
  </div>
51
  </div>
52
  """)
53
 
54
- top_md_3 = ("""访问FunASR项目与论文能够帮助您深入了解ClipVideo中所使用的语音处理相关模型:
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
- # gr.Markdown(top_md_1)
68
- #gr.Markdown(top_md_2)
69
- #gr.Markdown(top_md_3)
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"):