Skip to content

FunASR-powered video transcription, subtitle generation, and LLM-assisted clipping tool with a local Gradio UI.

update introduction

维石7f0a28a8538f
diff --git a/funclip/introduction.py b/funclip/introduction.py
index ac731be..fa1827a 100644
--- a/funclip/introduction.py
+++ b/funclip/introduction.py
@@ -1,22 +1,20 @@
top_md_1 = ("""
- 基于阿里巴巴通义实验室自研SeACo-Paraformer-长音频版的语音识别、端点检测、标点预测、时间戳功能、角色区分、热词定制化功能
+ <div align="center">
+ <div style="display:flex; gap: 0.25rem;" align="center">
+ FunClip: <a href='https://github.com/alibaba-damo-academy/FunClip'><img src='https://img.shields.io/badge/Github-Code-blue'></a>
+ 🌟支持我们: <a href='https://github.com/alibaba-damo-academy/FunClip/stargazers'><img src='https://img.shields.io/github/stars/alibaba-damo-academy/FunClip.svg?style=social'></a>
+ </div>
+ </div>
+
+ 基于阿里巴巴通义实验室自研并开源的[FunASR](https://github.com/alibaba-damo-academy/FunASR)工具包及Paraformer系列模型及语音识别、端点检测、标点预测、时间戳预测、说话人区分、热词定制化开源链路
准确识别,自由复制所需段落,或者设置说话人标识,一键裁剪、添加字幕
* Step1: 上传视频或音频文件(或使用下方的用例体验),点击 **<font color="#f7802b">识别</font>** 按钮
* Step2: 复制识别结果中所需的文字至右上方,或者右设置说话人标识,设置偏移与字幕配置(可选)
* Step3: 点击 **<font color="#f7802b">裁剪</font>** 按钮或 **<font color="#f7802b">裁剪并添加字幕</font>** 按钮获得结果
- """)
-
-top_md_2 = ("""
- 受到网络传输与服务资源的限制,用于体验的视频最好大小在40mb以下
- 过大的视频可以尝试分离音轨使用音频剪辑,或 **<font color="#1785c4">通过源代码将您的ClipVideo服务部署在本地(推荐)</font>** :
- <div align="center">
- <div style="display:flex; gap: 0.25rem;" align="center">
- FunASR_APP: <a href='https://github.com/alibaba/funasr-app'><img src='https://img.shields.io/badge/Github-Code-blue'></a>
- 🌟支持我们: <a href='https://github.com/alibaba/funasr-app/stargazers'><img src='https://img.shields.io/github/stars/alibaba/funasr-app.svg?style=social'></a>
- </div>
- </div>
+
+ 🔥 FunClip现在集成了大语言模型智能剪辑功能,选择LLM模型进行体验吧~
""")
top_md_3 = ("""访问FunASR项目与论文能够帮助您深入了解ParaClipper中所使用的语音处理相关模型:
@@ -34,7 +32,6 @@ top_md_4 = ("""我们在「LLM智能裁剪」模块中提供三种LLM调用方
2. 选择GPT开头的模型即为调用openai官方api,此时需要您自备sk与网络环境;
3. [gpt4free](https://github.com/xtekky/gpt4free?tab=readme-ov-file)项目也被集成进FunClip,可以通过它免费调用gpt模型;
- 其中方式1与方式2需要在界面中传入相应的apikey
-
+ 其中方式1与方式2需要在界面中传入相应的apikey
方式3而可能非常不稳定,返回时间可能很长或者结果获取失败,可以多多尝试或者自己准备sk使用方式1
""")
diff --git a/funclip/launch.py b/funclip/launch.py
index f89ba64..9813c10 100644
--- a/funclip/launch.py
+++ b/funclip/launch.py
@@ -8,7 +8,7 @@ import logging
import gradio as gr
from funasr import AutoModel
from videoclipper import VideoClipper
-from introduction import top_md_1, top_md_2, top_md_3, top_md_4
+from introduction import top_md_1, top_md_3, top_md_4
from llm.openai_api import openai_call
from llm.g4f_openai_api import g4f_openai_call
from llm.qwen_api import call_qwen_model
@@ -124,7 +124,7 @@ if __name__ == "__main__":
theme = gr.Theme.load("funclip/utils/theme.json")
with gr.Blocks(theme=theme) as funclip_service:
gr.Markdown(top_md_1)
- gr.Markdown(top_md_2)
+ # gr.Markdown(top_md_2)
gr.Markdown(top_md_3)
gr.Markdown(top_md_4)
video_state, audio_state = gr.State(), gr.State()
diff --git a/funclip/videoclipper.py b/funclip/videoclipper.py
index 5e379b4..a6ff23a 100644
--- a/funclip/videoclipper.py
+++ b/funclip/videoclipper.py
@@ -52,7 +52,8 @@ class VideoClipper():
return_raw_text=True,
is_final=True,
hotword=hotwords,
- output_dir=output_dir,)
+ output_dir=output_dir,
+ cache={})
res_srt = generate_srt(rec_result[0]['sentence_info'])
state['recog_res_raw'] = rec_result[0]['raw_text']
state['timestamp'] = rec_result[0]['timestamp']