FunASR-powered video transcription, subtitle generation, and LLM-assisted clipping tool with a local Gradio UI.
Python ai-toolsai-video-editingasrauto-subtitleschinesecontent-creationfunasrfunclipgradiollmparaformerspeech-recognitionspeech-to-textsubtitles-generatortranscriptionvideo-editingvideo-processingvideo-subtitlesvideo-transcriptionwhisper-alternative
file head
维石6e928fff9c62
diff --git a/funclip/launch.py b/funclip/launch.pyindex bae7e4a..192286a 100644--- a/funclip/launch.py+++ b/funclip/launch.py@@ -1,3 +1,8 @@+#!/usr/bin/env python3+# -*- encoding: utf-8 -*-+# Copyright FunASR (https://github.com/alibaba-damo-academy/FunClip). All Rights Reserved.+# MIT License (https://opensource.org/licenses/MIT)+import osimport gradio as grfrom funasr import AutoModeldiff --git a/funclip/utils/argparse_tools.py b/funclip/utils/argparse_tools.pyindex fc621ed..a1e7205 100644--- a/funclip/utils/argparse_tools.py+++ b/funclip/utils/argparse_tools.py@@ -1,3 +1,8 @@+#!/usr/bin/env python3+# -*- encoding: utf-8 -*-+# Copyright FunASR (https://github.com/alibaba-damo-academy/FunClip). All Rights Reserved.+# MIT License (https://opensource.org/licenses/MIT)+import argparsefrom pathlib import Pathdiff --git a/funclip/utils/subtitle_utils.py b/funclip/utils/subtitle_utils.pyindex b4e1df4..745683d 100644--- a/funclip/utils/subtitle_utils.py+++ b/funclip/utils/subtitle_utils.py@@ -1,3 +1,8 @@+#!/usr/bin/env python3+# -*- encoding: utf-8 -*-+# Copyright FunASR (https://github.com/alibaba-damo-academy/FunClip). All Rights Reserved.+# MIT License (https://opensource.org/licenses/MIT)+def time_convert(ms):ms = int(ms)tail = ms % 1000diff --git a/funclip/utils/trans_utils.py b/funclip/utils/trans_utils.pyindex b54347b..9573905 100644--- a/funclip/utils/trans_utils.py+++ b/funclip/utils/trans_utils.py@@ -1,5 +1,12 @@-PUNC_LIST = [',', '。', '!', '?', '、']+#!/usr/bin/env python3+# -*- encoding: utf-8 -*-+# Copyright FunASR (https://github.com/alibaba-damo-academy/FunClip). All Rights Reserved.+# MIT License (https://opensource.org/licenses/MIT)+import os+import numpy as np++PUNC_LIST = [',', '。', '!', '?', '、']def pre_proc(text):res = ''@@ -62,7 +69,6 @@ def write_state(output_dir, state):with open(output_dir+'/sd_sentences', 'w') as fout:fout.write(str(state['sd_sentences']))-import osdef load_state(output_dir):state = {}with open(output_dir+'/recog_res_raw') as fin:@@ -80,7 +86,6 @@ def load_state(output_dir):state['sd_sentences'] = eval(line)return state-import numpy as npdef convert_pcm_to_float(data):if data.dtype == np.float64:return datadiff --git a/funclip/videoclipper.py b/funclip/videoclipper.pyindex 9d8e4d9..c12816c 100644--- a/funclip/videoclipper.py+++ b/funclip/videoclipper.py@@ -1,3 +1,8 @@+#!/usr/bin/env python3+# -*- encoding: utf-8 -*-+# Copyright FunASR (https://github.com/alibaba-damo-academy/FunClip). All Rights Reserved.+# MIT License (https://opensource.org/licenses/MIT)+import reimport osimport sys