Skip to content

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

code update

维石ab63e74c9260
diff --git a/funclip/launch.py b/funclip/launch.py
index 6daf244..f3915ce 100644
--- a/funclip/launch.py
+++ b/funclip/launch.py
@@ -42,7 +42,7 @@ if __name__ == "__main__":
return None, (sr, res_audio), message, clip_srt
# gradio interface
- with gr.Blocks() as demo:
+ with gr.Blocks() as funclip_service:
gr.Markdown(top_md_1)
gr.Markdown(top_md_2)
gr.Markdown(top_md_3)
@@ -100,4 +100,4 @@ if __name__ == "__main__":
outputs=[video_output, clip_message, srt_clipped])
# start gradio service in local
- demo.launch()
+ funclip_service.launch()
diff --git a/funclip/videoclipper.py b/funclip/videoclipper.py
index 2ff0199..b772685 100644
--- a/funclip/videoclipper.py
+++ b/funclip/videoclipper.py
@@ -7,8 +7,8 @@ import logging
import argparse
import numpy as np
import soundfile as sf
-import moviepy.editor as mpy
from moviepy.editor import *
+import moviepy.editor as mpy
from moviepy.video.tools.subtitles import SubtitlesClip
from utils.subtitle_utils import generate_srt, generate_srt_clip
from utils.argparse_tools import ArgumentParser, get_commandline_args
@@ -304,13 +304,9 @@ def runner(stage, file, sd_switch, output_dir, dest_text, dest_spk, start_ost, e
# initialize funasr automodel
logging.warning("Initializing modelscope asr pipeline.")
funasr_model = AutoModel(model="iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
- model_revision="v2.0.4",
vad_model="damo/speech_fsmn_vad_zh-cn-16k-common-pytorch",
- vad_model_revision="v2.0.4",
punc_model="damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch",
- punc_model_revision="v2.0.4",
spk_model="damo/speech_campplus_sv_zh-cn_16k-common",
- spk_model_revision="v2.0.2",
)
audio_clipper = VideoClipper(funasr_model)
if mode == 'audio':