Skip to content

Commit

Permalink
Fix: merge zh_recogn & sensevoice to FunAsr
Browse files Browse the repository at this point in the history
  • Loading branch information
jianchang512 committed Nov 1, 2024
1 parent f1590e7 commit 5e0d188
Show file tree
Hide file tree
Showing 28 changed files with 384 additions and 266 deletions.
1 change: 1 addition & 0 deletions test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"metadata": {"transaction_key": "deprecated", "request_id": "e69753ae-4e80-4077-9ccf-54d1e32a8aa7", "sha256": "696ddf1d22a425d3a9466b2368cdd24364c9cf9de83bae0883c8d433a5389fb6", "created": "2024-11-01T06:30:17.667Z", "duration": 11.088, "channels": 1, "models": ["2a000f0d-afa1-4f20-8481-94f8bc30b0b2"], "model_info": {"2a000f0d-afa1-4f20-8481-94f8bc30b0b2": {"name": "large-whisper", "version": "2022-12-08.0", "arch": "whisper"}}}, "results": {"channels": [{"alternatives": [{"transcript": "\u53e4\u8001\u65b0\u6232\u4e2d\u767c\u73fe\u4e86\u6709\u6a5f\u5206\u5b50\u6211\u5011\u96e2\u7b2c\u4e09\u985e\u63a5\u89f8\u9084\u6709\u591a\u9060\u5fae\u535a\u6b63\u5f0f\u5c55\u958b\u62cd\u651d\u4efb\u52d9\u5df2\u7d93\u5c46\u6eff\u9031\u5e74\u6700\u8fd1\u4e5f\u50b3\u56de\u4f86\u8a31\u591a\u904e\u53bb\u96e3\u4ee5\u62cd\u651d\u5230\u7684\u7167\u7247", "confidence": 0.9891718, "words": [{"word": "\u53e4", "start": 0.06, "end": 0.22, "confidence": 0.24031715, "punctuated_word": "\u53e4"}, {"word": "\u8001", "start": 0.22, "end": 0.45999998, "confidence": 0.4851624, "punctuated_word": "\u8001"}, {"word": "\u65b0", "start": 0.45999998, "end": 0.52, "confidence": 0.9871694, "punctuated_word": "\u65b0"}, {"word": "\u6232", "start": 0.52, "end": 0.71999997, "confidence": 0.689627, "punctuated_word": "\u6232"}, {"word": "\u4e2d", "start": 0.71999997, "end": 0.94, "confidence": 0.7163843, "punctuated_word": "\u4e2d"}, {"word": "\u767c\u73fe", "start": 0.94, "end": 1.4, "confidence": 0.99306655, "punctuated_word": "\u767c\u73fe"}, {"word": "\u4e86", "start": 1.4, "end": 1.5, "confidence": 0.99730957, "punctuated_word": "\u4e86"}, {"word": "\u6709", "start": 1.5, "end": 1.7199999, "confidence": 0.9590886, "punctuated_word": "\u6709"}, {"word": "\u6a5f", "start": 1.7199999, "end": 1.88, "confidence": 0.99941957, "punctuated_word": "\u6a5f"}, {"word": "\u5206", "start": 1.88, "end": 2.08, "confidence": 0.055190008, "punctuated_word": "\u5206"}, {"word": "\u5b50", "start": 2.08, "end": 2.58, "confidence": 0.96733665, "punctuated_word": "\u5b50"}, {"word": "\u6211\u5011", "start": 2.6599998, "end": 2.8999999, "confidence": 0.9208613, "punctuated_word": "\u6211\u5011"}, {"word": "\u96e2", "start": 2.8999999, "end": 3.12, "confidence": 0.9793457, "punctuated_word": "\u96e2"}, {"word": "\u7b2c\u4e09", "start": 3.12, "end": 3.3799999, "confidence": 0.9081615, "punctuated_word": "\u7b2c\u4e09"}, {"word": "\u985e", "start": 3.3799999, "end": 3.6, "confidence": 0.99989676, "punctuated_word": "\u985e"}, {"word": "\u63a5", "start": 3.6, "end": 3.76, "confidence": 0.9999919, "punctuated_word": "\u63a5"}, {"word": "\u89f8", "start": 3.76, "end": 4.04, "confidence": 0.7521827, "punctuated_word": "\u89f8"}, {"word": "\u9084\u6709", "start": 4.04, "end": 4.3199997, "confidence": 0.9909378, "punctuated_word": "\u9084\u6709"}, {"word": "\u591a", "start": 4.3199997, "end": 4.48, "confidence": 0.17423469, "punctuated_word": "\u591a"}, {"word": "\u9060", "start": 4.48, "end": 4.98, "confidence": 0.9891718, "punctuated_word": "\u9060"}, {"word": "\u5fae", "start": 5.02, "end": 5.2, "confidence": 0.99999905, "punctuated_word": "\u5fae"}, {"word": "\u535a", "start": 5.2, "end": 5.38, "confidence": 0.9900187, "punctuated_word": "\u535a"}, {"word": "\u6b63", "start": 5.38, "end": 5.54, "confidence": 0.9524369, "punctuated_word": "\u6b63"}, {"word": "\u5f0f", "start": 5.54, "end": 5.68, "confidence": 0.9987935, "punctuated_word": "\u5f0f"}, {"word": "\u5c55", "start": 5.68, "end": 5.8599997, "confidence": 0.9839077, "punctuated_word": "\u5c55"}, {"word": "\u958b", "start": 5.8599997, "end": 6.04, "confidence": 0.9992906, "punctuated_word": "\u958b"}, {"word": "\u62cd", "start": 6.04, "end": 6.18, "confidence": 0.99999917, "punctuated_word": "\u62cd"}, {"word": "\u651d", "start": 6.18, "end": 6.3799996, "confidence": 0.99359775, "punctuated_word": "\u651d"}, {"word": "\u4efb", "start": 6.3799996, "end": 6.5, "confidence": 0.13850875, "punctuated_word": "\u4efb"}, {"word": "\u52d9", "start": 6.5, "end": 6.7599998, "confidence": 0.9938491, "punctuated_word": "\u52d9"}, {"word": "\u5df2\u7d93", "start": 6.7599998, "end": 6.96, "confidence": 0.9992866, "punctuated_word": "\u5df2\u7d93"}, {"word": "\u5c46", "start": 6.96, "end": 7.12, "confidence": 0.9860264, "punctuated_word": "\u5c46"}, {"word": "\u6eff", "start": 7.12, "end": 7.3599997, "confidence": 0.9997645, "punctuated_word": "\u6eff"}, {"word": "\u9031", "start": 7.3599997, "end": 7.54, "confidence": 0.33030534, "punctuated_word": "\u9031"}, {"word": "\u5e74", "start": 7.54, "end": 8.0, "confidence": 0.9914724, "punctuated_word": "\u5e74"}, {"word": "\u6700\u8fd1", "start": 8.0, "end": 8.3, "confidence": 0.97437614, "punctuated_word": "\u6700\u8fd1"}, {"word": "\u4e5f", "start": 8.3, "end": 8.44, "confidence": 0.6378956, "punctuated_word": "\u4e5f"}, {"word": "\u50b3", "start": 8.44, "end": 8.599999, "confidence": 0.34981716, "punctuated_word": "\u50b3"}, {"word": "\u56de\u4f86", "start": 8.599999, "end": 8.98, "confidence": 0.9960781, "punctuated_word": "\u56de\u4f86"}, {"word": "\u8a31", "start": 8.98, "end": 9.139999, "confidence": 0.9695547, "punctuated_word": "\u8a31"}, {"word": "\u591a", "start": 9.139999, "end": 9.28, "confidence": 0.9946556, "punctuated_word": "\u591a"}, {"word": "\u904e\u53bb", "start": 9.28, "end": 9.62, "confidence": 0.99605715, "punctuated_word": "\u904e\u53bb"}, {"word": "\u96e3", "start": 9.62, "end": 9.84, "confidence": 0.99637187, "punctuated_word": "\u96e3"}, {"word": "\u4ee5", "start": 9.84, "end": 9.96, "confidence": 0.9914835, "punctuated_word": "\u4ee5"}, {"word": "\u62cd", "start": 9.96, "end": 10.2, "confidence": 0.99999964, "punctuated_word": "\u62cd"}, {"word": "\u651d", "start": 10.2, "end": 10.36, "confidence": 0.98693615, "punctuated_word": "\u651d"}, {"word": "\u5230", "start": 10.36, "end": 10.5199995, "confidence": 0.99140453, "punctuated_word": "\u5230"}, {"word": "\u7684", "start": 10.5199995, "end": 10.639999, "confidence": 0.9991404, "punctuated_word": "\u7684"}, {"word": "\u7167", "start": 10.639999, "end": 10.84, "confidence": 0.09480816, "punctuated_word": "\u7167"}, {"word": "\u7247", "start": 10.84, "end": 11.34, "confidence": 0.9071409, "punctuated_word": "\u7247"}], "paragraphs": {"transcript": "\n\u53e4 \u8001 \u65b0 \u6232 \u4e2d \u767c\u73fe \u4e86 \u6709 \u6a5f \u5206 \u5b50 \u6211\u5011 \u96e2 \u7b2c\u4e09 \u985e \u63a5 \u89f8 \u9084\u6709 \u591a \u9060 \u5fae \u535a \u6b63 \u5f0f \u5c55 \u958b \u62cd \u651d \u4efb \u52d9 \u5df2\u7d93 \u5c46 \u6eff \u9031 \u5e74 \u6700\u8fd1 \u4e5f \u50b3 \u56de\u4f86 \u8a31 \u591a \u904e\u53bb \u96e3 \u4ee5 \u62cd \u651d \u5230 \u7684 \u7167 \u7247", "paragraphs": [{"sentences": [{"text": "\u53e4 \u8001 \u65b0 \u6232 \u4e2d \u767c\u73fe \u4e86 \u6709 \u6a5f \u5206 \u5b50 \u6211\u5011 \u96e2 \u7b2c\u4e09 \u985e \u63a5 \u89f8 \u9084\u6709 \u591a \u9060 \u5fae \u535a \u6b63 \u5f0f \u5c55 \u958b \u62cd \u651d \u4efb \u52d9 \u5df2\u7d93 \u5c46 \u6eff \u9031 \u5e74 \u6700\u8fd1 \u4e5f \u50b3 \u56de\u4f86 \u8a31 \u591a \u904e\u53bb \u96e3 \u4ee5 \u62cd \u651d \u5230 \u7684 \u7167 \u7247", "start": 0.06, "end": 11.34}], "start": 0.06, "end": 11.34, "num_words": 50}]}}]}], "utterances": [{"start": 0.06, "end": 11.34, "confidence": 0.84095657, "channel": 0, "transcript": "\u53e4 \u8001 \u65b0 \u6232 \u4e2d \u767c\u73fe \u4e86 \u6709 \u6a5f \u5206 \u5b50 \u6211\u5011 \u96e2 \u7b2c\u4e09 \u985e \u63a5 \u89f8 \u9084\u6709 \u591a \u9060 \u5fae \u535a \u6b63 \u5f0f \u5c55 \u958b \u62cd \u651d \u4efb \u52d9 \u5df2\u7d93 \u5c46 \u6eff \u9031 \u5e74 \u6700\u8fd1 \u4e5f \u50b3 \u56de\u4f86 \u8a31 \u591a \u904e\u53bb \u96e3 \u4ee5 \u62cd \u651d \u5230 \u7684 \u7167 \u7247", "words": [{"word": "\u53e4", "start": 0.06, "end": 0.22, "confidence": 0.24031715, "punctuated_word": "\u53e4"}, {"word": "\u8001", "start": 0.22, "end": 0.45999998, "confidence": 0.4851624, "punctuated_word": "\u8001"}, {"word": "\u65b0", "start": 0.45999998, "end": 0.52, "confidence": 0.9871694, "punctuated_word": "\u65b0"}, {"word": "\u6232", "start": 0.52, "end": 0.71999997, "confidence": 0.689627, "punctuated_word": "\u6232"}, {"word": "\u4e2d", "start": 0.71999997, "end": 0.94, "confidence": 0.7163843, "punctuated_word": "\u4e2d"}, {"word": "\u767c\u73fe", "start": 0.94, "end": 1.4, "confidence": 0.99306655, "punctuated_word": "\u767c\u73fe"}, {"word": "\u4e86", "start": 1.4, "end": 1.5, "confidence": 0.99730957, "punctuated_word": "\u4e86"}, {"word": "\u6709", "start": 1.5, "end": 1.7199999, "confidence": 0.9590886, "punctuated_word": "\u6709"}, {"word": "\u6a5f", "start": 1.7199999, "end": 1.88, "confidence": 0.99941957, "punctuated_word": "\u6a5f"}, {"word": "\u5206", "start": 1.88, "end": 2.08, "confidence": 0.055190008, "punctuated_word": "\u5206"}, {"word": "\u5b50", "start": 2.08, "end": 2.58, "confidence": 0.96733665, "punctuated_word": "\u5b50"}, {"word": "\u6211\u5011", "start": 2.6599998, "end": 2.8999999, "confidence": 0.9208613, "punctuated_word": "\u6211\u5011"}, {"word": "\u96e2", "start": 2.8999999, "end": 3.12, "confidence": 0.9793457, "punctuated_word": "\u96e2"}, {"word": "\u7b2c\u4e09", "start": 3.12, "end": 3.3799999, "confidence": 0.9081615, "punctuated_word": "\u7b2c\u4e09"}, {"word": "\u985e", "start": 3.3799999, "end": 3.6, "confidence": 0.99989676, "punctuated_word": "\u985e"}, {"word": "\u63a5", "start": 3.6, "end": 3.76, "confidence": 0.9999919, "punctuated_word": "\u63a5"}, {"word": "\u89f8", "start": 3.76, "end": 4.04, "confidence": 0.7521827, "punctuated_word": "\u89f8"}, {"word": "\u9084\u6709", "start": 4.04, "end": 4.3199997, "confidence": 0.9909378, "punctuated_word": "\u9084\u6709"}, {"word": "\u591a", "start": 4.3199997, "end": 4.48, "confidence": 0.17423469, "punctuated_word": "\u591a"}, {"word": "\u9060", "start": 4.48, "end": 4.98, "confidence": 0.9891718, "punctuated_word": "\u9060"}, {"word": "\u5fae", "start": 5.02, "end": 5.2, "confidence": 0.99999905, "punctuated_word": "\u5fae"}, {"word": "\u535a", "start": 5.2, "end": 5.38, "confidence": 0.9900187, "punctuated_word": "\u535a"}, {"word": "\u6b63", "start": 5.38, "end": 5.54, "confidence": 0.9524369, "punctuated_word": "\u6b63"}, {"word": "\u5f0f", "start": 5.54, "end": 5.68, "confidence": 0.9987935, "punctuated_word": "\u5f0f"}, {"word": "\u5c55", "start": 5.68, "end": 5.8599997, "confidence": 0.9839077, "punctuated_word": "\u5c55"}, {"word": "\u958b", "start": 5.8599997, "end": 6.04, "confidence": 0.9992906, "punctuated_word": "\u958b"}, {"word": "\u62cd", "start": 6.04, "end": 6.18, "confidence": 0.99999917, "punctuated_word": "\u62cd"}, {"word": "\u651d", "start": 6.18, "end": 6.3799996, "confidence": 0.99359775, "punctuated_word": "\u651d"}, {"word": "\u4efb", "start": 6.3799996, "end": 6.5, "confidence": 0.13850875, "punctuated_word": "\u4efb"}, {"word": "\u52d9", "start": 6.5, "end": 6.7599998, "confidence": 0.9938491, "punctuated_word": "\u52d9"}, {"word": "\u5df2\u7d93", "start": 6.7599998, "end": 6.96, "confidence": 0.9992866, "punctuated_word": "\u5df2\u7d93"}, {"word": "\u5c46", "start": 6.96, "end": 7.12, "confidence": 0.9860264, "punctuated_word": "\u5c46"}, {"word": "\u6eff", "start": 7.12, "end": 7.3599997, "confidence": 0.9997645, "punctuated_word": "\u6eff"}, {"word": "\u9031", "start": 7.3599997, "end": 7.54, "confidence": 0.33030534, "punctuated_word": "\u9031"}, {"word": "\u5e74", "start": 7.54, "end": 8.0, "confidence": 0.9914724, "punctuated_word": "\u5e74"}, {"word": "\u6700\u8fd1", "start": 8.0, "end": 8.3, "confidence": 0.97437614, "punctuated_word": "\u6700\u8fd1"}, {"word": "\u4e5f", "start": 8.3, "end": 8.44, "confidence": 0.6378956, "punctuated_word": "\u4e5f"}, {"word": "\u50b3", "start": 8.44, "end": 8.599999, "confidence": 0.34981716, "punctuated_word": "\u50b3"}, {"word": "\u56de\u4f86", "start": 8.599999, "end": 8.98, "confidence": 0.9960781, "punctuated_word": "\u56de\u4f86"}, {"word": "\u8a31", "start": 8.98, "end": 9.139999, "confidence": 0.9695547, "punctuated_word": "\u8a31"}, {"word": "\u591a", "start": 9.139999, "end": 9.28, "confidence": 0.9946556, "punctuated_word": "\u591a"}, {"word": "\u904e\u53bb", "start": 9.28, "end": 9.62, "confidence": 0.99605715, "punctuated_word": "\u904e\u53bb"}, {"word": "\u96e3", "start": 9.62, "end": 9.84, "confidence": 0.99637187, "punctuated_word": "\u96e3"}, {"word": "\u4ee5", "start": 9.84, "end": 9.96, "confidence": 0.9914835, "punctuated_word": "\u4ee5"}, {"word": "\u62cd", "start": 9.96, "end": 10.2, "confidence": 0.99999964, "punctuated_word": "\u62cd"}, {"word": "\u651d", "start": 10.2, "end": 10.36, "confidence": 0.98693615, "punctuated_word": "\u651d"}, {"word": "\u5230", "start": 10.36, "end": 10.5199995, "confidence": 0.99140453, "punctuated_word": "\u5230"}, {"word": "\u7684", "start": 10.5199995, "end": 10.639999, "confidence": 0.9991404, "punctuated_word": "\u7684"}, {"word": "\u7167", "start": 10.639999, "end": 10.84, "confidence": 0.09480816, "punctuated_word": "\u7167"}, {"word": "\u7247", "start": 10.84, "end": 11.34, "confidence": 0.9071409, "punctuated_word": "\u7247"}], "id": "bb514832-2d54-4c0a-beb4-17e7f539ea5f"}]}}
4 changes: 2 additions & 2 deletions videotrans/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

VERSION = "v2.96"
VERSION_NUM = 120096
VERSION = "v2.97"
VERSION_NUM = 120097
6 changes: 2 additions & 4 deletions videotrans/component/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from videotrans.component.set_form import BaiduForm, ChatgptForm, DeepLForm, DeepLXForm, TencentForm, ElevenlabsForm, \
InfoForm, AzureForm, GeminiForm, SetLineRole, YoutubeForm, OttForm, CloneForm, SeparateForm, TtsapiForm, \
GPTSoVITSForm, TransapiForm, ArticleForm, AzurettsForm, ZhrecognForm, ChatttsForm, LocalLLMForm, ZijiehuoshanForm, \
GPTSoVITSForm, TransapiForm, ArticleForm, AzurettsForm, ChatttsForm, LocalLLMForm, ZijiehuoshanForm, \
HebingsrtForm, DoubaoForm, FishTTSForm, CosyVoiceForm, AI302Form, AI302TTSForm, SetINIForm, WatermarkForm, \
GetaudioForm, HunliuForm, VASForm, Fanyisrt, Recognform, Peiyinform, Videoandaudioform, Videoandsrtform, \
OpenAITTSForm, RecognAPIForm, OpenaiRecognAPIForm, DownloadModelForm, FormatcoverForm, SubtitlescoverForm, \
SubtitleEditer,SttAPIForm,VolcEngineTTSForm,SenseVoiceAPIForm,F5TTSForm,DeepgramForm
SubtitleEditer,SttAPIForm,VolcEngineTTSForm,F5TTSForm,DeepgramForm

__all__ = [
"BaiduForm",
Expand All @@ -26,7 +26,6 @@
"TransapiForm",
"ArticleForm",
"AzurettsForm",
"ZhrecognForm",
"ChatttsForm",
"LocalLLMForm",
"ZijiehuoshanForm",
Expand Down Expand Up @@ -55,7 +54,6 @@
"SubtitleEditer",
"SttAPIForm",
"VolcEngineTTSForm",
"SenseVoiceAPIForm",
"F5TTSForm",
"DeepgramForm"
]
15 changes: 0 additions & 15 deletions videotrans/component/set_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from videotrans.ui.recogn import Ui_recogn
from videotrans.ui.recognapi import Ui_recognapiform
from videotrans.ui.stt import Ui_sttform
from videotrans.ui.sense import Ui_senseform
from videotrans.ui.separate import Ui_separateform
from videotrans.ui.setini import Ui_setini
from videotrans.ui.setlinerole import Ui_setlinerole
Expand All @@ -52,7 +51,6 @@
from videotrans.ui.volcenginetts import Ui_volcengineform
from videotrans.ui.watermark import Ui_watermark
from videotrans.ui.youtube import Ui_youtubeform
from videotrans.ui.zh_recogn import Ui_zhrecognform
from videotrans.ui.zijiehuoshan import Ui_zijiehuoshanform
from videotrans.ui.f5tts import Ui_f5ttsform

Expand Down Expand Up @@ -138,14 +136,6 @@ def __init__(self, parent=None):
self.setWindowIcon(QIcon(f"{config.ROOT_DIR}/videotrans/styles/icon.ico"))


class SenseVoiceAPIForm(QDialog, Ui_senseform): # <===
def __init__(self, parent=None):
super(SenseVoiceAPIForm, self).__init__(parent)
self.setupUi(self)
self.setWindowIcon(QIcon(f"{config.ROOT_DIR}/videotrans/styles/icon.ico"))



class OpenaiRecognAPIForm(QDialog, Ui_openairecognapiform): # <===
def __init__(self, parent=None):
super(OpenaiRecognAPIForm, self).__init__(parent)
Expand Down Expand Up @@ -270,11 +260,6 @@ def __init__(self, parent=None):
self.setWindowIcon(QIcon(f"{config.ROOT_DIR}/videotrans/styles/icon.ico"))


class ZhrecognForm(QDialog, Ui_zhrecognform): # <===
def __init__(self, parent=None):
super(ZhrecognForm, self).__init__(parent)
self.setupUi(self)
self.setWindowIcon(QIcon(f"{config.ROOT_DIR}/videotrans/styles/icon.ico"))


class DoubaoForm(QDialog, Ui_doubaoform): # <===
Expand Down
18 changes: 16 additions & 2 deletions videotrans/configure/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def _log_uncaught_exceptions(exc_type, exc_value, exc_traceback):
os.environ['QT_API'] = 'pyside6'
os.environ['SOFT_NAME'] = 'pyvideotrans'
os.environ['MODELSCOPE_CACHE'] = ROOT_DIR + "/models"
os.environ['HF_HOME'] = ROOT_DIR + "/models"
####################################
# 存储所有任务的进度队列,以uuid为键
# 根据uuid将日志进度等信息存入队列,如果不存在则创建
Expand Down Expand Up @@ -201,6 +202,20 @@ def push_queue(uuid, jsondata):
# 执行模式 gui 或 api
exec_mode="gui"

# funasr模型
FUNASR_MODEL=['paraformer-zh','SenseVoiceSmall']
DEEPGRAM_MODEL=[
"whisper-large",
"whisper-medium",
"whisper-small",
"whisper-base",
"whisper-tiny",
"nova-2-general",
"enhanced-2-general",
"base-2-general",

]


# 支持的视频格式
VIDEO_EXTS = ["mp4", "mkv", "mpeg", "avi", "mov"]
Expand Down Expand Up @@ -675,10 +690,9 @@ def getset_params(obj=None):

"stt_source_language":0,
"stt_recogn_type":0,
"stt_model_name":0,
"stt_model_name":"",

"deepgram_apikey":"",
"deepgram_model":"whisper-large",
"deepgram_utt":200,

"trans_translate_type":0,
Expand Down
Loading

0 comments on commit 5e0d188

Please sign in to comment.