Skip to content

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

file head

维石6e928fff9c62
diff --git a/funclip/launch.py b/funclip/launch.py
index 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 os
import gradio as gr
from funasr import AutoModel
diff --git a/funclip/utils/argparse_tools.py b/funclip/utils/argparse_tools.py
index 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 argparse
from pathlib import Path
diff --git a/funclip/utils/subtitle_utils.py b/funclip/utils/subtitle_utils.py
index 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 % 1000
diff --git a/funclip/utils/trans_utils.py b/funclip/utils/trans_utils.py
index 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 os
def 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 np
def convert_pcm_to_float(data):
if data.dtype == np.float64:
return data
diff --git a/funclip/videoclipper.py b/funclip/videoclipper.py
index 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 re
import os
import sys