diff --git a/EVT_GUI/Components.py b/EVT_GUI/Components.py index 247ffe3..42f3ae7 100644 --- a/EVT_GUI/Components.py +++ b/EVT_GUI/Components.py @@ -57,6 +57,8 @@ def setStyleSheet(self, StyleSheet: str): ) def AddRow(self, Param: tuple): + ModelName, ModelType, ModelSize, ModelDate, DownloadParam = Param + RowHeight = 36 LabelStyle = ''' QLabel { @@ -80,59 +82,66 @@ def SetColumnLayout(ColumnLayout): ColumnLayout.setContentsMargins(0, 0, 0, 0) ColumnLayout.setSpacing(0) - Label0 = QLabel() - Label0.setStyleSheet(LabelStyle) - Function_SetText(Label0, Param[0]) - Column0Layout = QHBoxLayout() - SetColumnLayout(Column0Layout) - Column0Layout.addWidget(Label0) - - Label1 = QLabel() - Label1.setStyleSheet(LabelStyle) - Function_SetText(Label1, Param[1]) - Column1Layout = QHBoxLayout() - SetColumnLayout(Column1Layout) - Column1Layout.addWidget(Label1) - - Label2 = QLabel() - Label2.setStyleSheet(LabelStyle) - Function_SetText(Label2, Param[2]) - Column2Layout = QHBoxLayout() - SetColumnLayout(Column2Layout) - Column2Layout.addWidget(Label2) + Label_ModelName = QLabel() + Label_ModelName.setStyleSheet(LabelStyle) + Function_SetText(Label_ModelName, ModelName) + ColumnLayout_ModelName = QHBoxLayout() + SetColumnLayout(ColumnLayout_ModelName) + ColumnLayout_ModelName.addWidget(Label_ModelName) + + Label_ModelType = QLabel() + Label_ModelType.setStyleSheet(LabelStyle) + Function_SetText(Label_ModelType, ModelType) + ColumnLayout_ModelType = QHBoxLayout() + SetColumnLayout(ColumnLayout_ModelType) + ColumnLayout_ModelType.addWidget(Label_ModelType) + + Label_ModelSize = QLabel() + Label_ModelSize.setStyleSheet(LabelStyle) + Function_SetText(Label_ModelSize, ModelSize) + ColumnLayout_ModelSize = QHBoxLayout() + SetColumnLayout(ColumnLayout_ModelSize) + ColumnLayout_ModelSize.addWidget(Label_ModelSize) + + Label_ModelDate = QLabel() + Label_ModelDate.setStyleSheet(LabelStyle) + Function_SetText(Label_ModelDate, ModelDate) + ColumnLayout_ModelDate = QHBoxLayout() + SetColumnLayout(ColumnLayout_ModelDate) + ColumnLayout_ModelDate.addWidget(Label_ModelDate) StackedWidget = QStackedWidget() StackedWidget.setContentsMargins(0, 0, 0, 0) OpenButton = QPushButton() OpenButton.setStyleSheet(ButtonStyle + "QPushButton {image: url(:/Button_Icon/Sources/OpenedFolder.png);}") - OpenButton.clicked.connect(lambda: Function_OpenURL(Param[3] if isinstance(Param[3], str) else Param[3][1])) + OpenButton.clicked.connect(lambda: Function_OpenURL(DownloadParam if isinstance(DownloadParam, str) else DownloadParam[1])) DownloadButton = QPushButton() DownloadButton.setStyleSheet(ButtonStyle + "QPushButton {image: url(:/Button_Icon/Sources/Download.png);}") - DownloadButton.clicked.connect(lambda: self.Download.emit(Param[3]) if isinstance(Param[3], tuple) else None) + DownloadButton.clicked.connect(lambda: self.Download.emit(DownloadParam) if isinstance(DownloadParam, tuple) else None) DownloadButton.clicked.connect(lambda: StackedWidget.setCurrentWidget(OpenButton)) StackedWidget.addWidget(OpenButton) StackedWidget.addWidget(DownloadButton) - StackedWidget.setCurrentWidget(OpenButton) if isinstance(Param[3], str) else StackedWidget.setCurrentWidget(DownloadButton) + StackedWidget.setCurrentWidget(OpenButton) if isinstance(DownloadParam, str) else StackedWidget.setCurrentWidget(DownloadButton) CopyButton = QPushButton() CopyButton.setStyleSheet(ButtonStyle + "QPushButton {image: url(:/Button_Icon/Sources/Clipboard.png);}") - CopyButton.clicked.connect(lambda: self.Clipboard.setText(Param[3][0]) if isinstance(Param[3], tuple) else None) + CopyButton.clicked.connect(lambda: self.Clipboard.setText(DownloadParam[0]) if isinstance(DownloadParam, tuple) else None) CopyButton.clicked.connect(lambda: Function_ShowMessageBox(WindowTitle = "Tip", Text = "已复制链接到剪切板")) Function_SetRetainSizeWhenHidden(CopyButton) CopyButton.hide() if StackedWidget.currentWidget() == OpenButton else None StackedWidget.currentChanged.connect(lambda: CopyButton.hide() if StackedWidget.currentWidget() == OpenButton else None) - Column3Layout = QHBoxLayout() - SetColumnLayout(Column3Layout) - Column3Layout.addWidget(StackedWidget) - Column3Layout.addWidget(CopyButton) + ColumnLayout_Management = QHBoxLayout() + SetColumnLayout(ColumnLayout_Management) + ColumnLayout_Management.addWidget(StackedWidget) + ColumnLayout_Management.addWidget(CopyButton) super().AddRow( - [Column0Layout, Column1Layout, Column2Layout, Column3Layout], - [QHeaderView.Stretch, QHeaderView.Stretch, QHeaderView.Stretch, QHeaderView.Fixed], - [None, None, None, 2 * RowHeight], + [ColumnLayout_ModelName, ColumnLayout_ModelType, ColumnLayout_ModelSize, ColumnLayout_ModelDate, ColumnLayout_Management], + [QHeaderView.Stretch, QHeaderView.Interactive, QHeaderView.Interactive, QHeaderView.Stretch, QHeaderView.Fixed], + [None, None, None, None, 2 * RowHeight], RowHeight ) - def SetValue(self, Params: list = [['', '', '', 'url'], ]): + def SetValue(self, Params: list = [['name', 'type', 'size', 'date', 'url'], ]): self.ClearRows() for Param in Params: QApplication.processEvents() diff --git a/EVT_GUI/Functions.py b/EVT_GUI/Functions.py index 4951d8b..8d9f06f 100644 --- a/EVT_GUI/Functions.py +++ b/EVT_GUI/Functions.py @@ -479,22 +479,51 @@ def Function_SetWidgetValue( ): if isinstance(Widget, (QLineEdit, LineEditBase, QPlainTextEdit)): Function_SetText(Widget, Value, SetPlaceholderText = SetPlaceholderText, PlaceholderText = PlaceholderText) - Widget.textChanged.connect(lambda Value: Config.EditConfig(Section, Option, str(Value))) + def EditConfig(Value): + Config.EditConfig(Section, Option, str(Value)) + if Config is not None: + Widget.textChanged.connect(EditConfig) + EditConfig(Value) + if isinstance(Widget, QComboBox): Widget.setCurrentText(str(Value)) - Widget.currentTextChanged.connect(lambda Value: Config.EditConfig(Section, Option, str(Value))) + def EditConfig(Value): + Config.EditConfig(Section, Option, str(Value)) + if Config is not None: + Widget.currentTextChanged.connect(EditConfig) + EditConfig(Value) + if isinstance(Widget, (QSlider, QSpinBox)): Widget.setValue(int(eval(str(Value)) * Times)) - Widget.valueChanged.connect(lambda Value: Config.EditConfig(Section, Option, str(eval(str(Value)) / Times))) + def EditConfig(Value): + Config.EditConfig(Section, Option, str(eval(str(Value)) / Times)) + if Config is not None: + Widget.valueChanged.connect(EditConfig) + EditConfig(Value) + if isinstance(Widget, QDoubleSpinBox): Widget.setValue(float(eval(str(Value)) * Times)) - Widget.valueChanged.connect(lambda Value: Config.EditConfig(Section, Option, str(eval(str(Value)) / Times))) + def EditConfig(Value): + Config.EditConfig(Section, Option, str(eval(str(Value)) / Times)) + if Config is not None: + Widget.valueChanged.connect(EditConfig) + EditConfig(Value) + if isinstance(Widget, (QCheckBox, QRadioButton)): Widget.setChecked(eval(str(Value))) - Widget.toggled.connect(lambda Value: Config.EditConfig(Section, Option, str(Value))) + def EditConfig(Value): + Config.EditConfig(Section, Option, str(Value)) + if Config is not None: + Widget.toggled.connect(EditConfig) + EditConfig(Value) + if isinstance(Widget, Table_EditAudioSpeaker): Widget.SetValue(eval(str(Value))) - Widget.ValueChanged.connect(lambda Value: Config.EditConfig(Section, Option, str(Value))) + def EditConfig(Value): + Config.EditConfig(Section, Option, str(Value)) + if Config is not None: + Widget.ValueChanged.connect(EditConfig) + EditConfig(Value) class ParamsManager: @@ -527,20 +556,25 @@ def ResetParam(self, Widget: QWidget): value = self.RegistratedWidgets[Widget] Function_SetWidgetValue(Widget, self.Config, *value) + def ClearSettings(self): + with open(self.ConfigPath, 'w') as Config: + pass + self.Config = ManageConfig(self.ConfigPath) + def ResetSettings(self): + self.ClearSettings() for Widget in list(self.RegistratedWidgets.keys()): self.ResetParam(Widget) def ImportSettings(self, ReadPath: str): - ConfigParser = ManageConfig(ReadPath).ReadConfig() + ConfigParser = ManageConfig(ReadPath).Parser() with open(self.ConfigPath, 'w') as Config: ConfigParser.write(Config) for Widget, value in list(self.RegistratedWidgets.items()): self.SetParam(Widget, *value) def ExportSettings(self, SavePath: str): - ConfigParser = self.Config.ReadConfig() with open(SavePath, 'w') as Config: - ConfigParser.write(Config) + self.Config.Parser().write(Config) ############################################################################################################################## \ No newline at end of file diff --git a/EVT_GUI/UI_MainWindow.py b/EVT_GUI/UI_MainWindow.py index edd3372..88c9533 100644 --- a/EVT_GUI/UI_MainWindow.py +++ b/EVT_GUI/UI_MainWindow.py @@ -1960,33 +1960,21 @@ def setupUi(self, MainWindow): self.ScrollArea_Env_Manage.setWidgetResizable(True) self.ScrollAreaWidgetContents_Env_Manage = QWidget() self.ScrollAreaWidgetContents_Env_Manage.setObjectName(u"ScrollAreaWidgetContents_Env_Manage") - self.ScrollAreaWidgetContents_Env_Manage.setGeometry(QRect(0, 0, 246, 218)) + self.ScrollAreaWidgetContents_Env_Manage.setGeometry(QRect(0, 0, 81, 99)) self.verticalLayout_81 = QVBoxLayout(self.ScrollAreaWidgetContents_Env_Manage) self.verticalLayout_81.setSpacing(0) self.verticalLayout_81.setObjectName(u"verticalLayout_81") self.verticalLayout_81.setContentsMargins(0, 0, 0, 0) - self.GroupBox_Env_Manage_Pytorch = QGroupBox(self.ScrollAreaWidgetContents_Env_Manage) - self.GroupBox_Env_Manage_Pytorch.setObjectName(u"GroupBox_Env_Manage_Pytorch") - self.GroupBox_Env_Manage_Pytorch.setStyleSheet(u"QGroupBox {\n" -" font-size: 15px;\n" -" margin-top: 1.5ex;\n" -" background-color: transparent;\n" -" border-width: 1px;\n" -" border-style: solid;\n" -" border-color: transparent;\n" -"}\n" -"QGroupBox::title {\n" -" left: 9px;\n" -" margin-left: 0px;\n" -" subcontrol-origin: margin;\n" -" subcontrol-position: top left;\n" -" padding: 3px;\n" -"}") - self.verticalLayout_105 = QVBoxLayout(self.GroupBox_Env_Manage_Pytorch) + self.ToolBox_Env_Manage_Pytorch = ToolBoxBase(self.ScrollAreaWidgetContents_Env_Manage) + self.ToolBox_Env_Manage_Pytorch.setObjectName(u"ToolBox_Env_Manage_Pytorch") + self.ToolBox_Env_Manage_Pytorch_Page1Content = WidgetBase() + self.ToolBox_Env_Manage_Pytorch_Page1Content.setObjectName(u"ToolBox_Env_Manage_Pytorch_Page1Content") + self.ToolBox_Env_Manage_Pytorch_Page1Content.setGeometry(QRect(0, 0, 244, 204)) + self.verticalLayout_105 = QVBoxLayout(self.ToolBox_Env_Manage_Pytorch_Page1Content) self.verticalLayout_105.setSpacing(0) self.verticalLayout_105.setObjectName(u"verticalLayout_105") self.verticalLayout_105.setContentsMargins(0, 12, 0, 12) - self.Frame_Env_Manage_Pytorch_Version = QFrame(self.GroupBox_Env_Manage_Pytorch) + self.Frame_Env_Manage_Pytorch_Version = QFrame(self.ToolBox_Env_Manage_Pytorch_Page1Content) self.Frame_Env_Manage_Pytorch_Version.setObjectName(u"Frame_Env_Manage_Pytorch_Version") self.Frame_Env_Manage_Pytorch_Version.setMinimumSize(QSize(0, 90)) self.Frame_Env_Manage_Pytorch_Version.setStyleSheet(u"QFrame {\n" @@ -2026,7 +2014,7 @@ def setupUi(self, MainWindow): self.verticalLayout_105.addWidget(self.Frame_Env_Manage_Pytorch_Version) - self.Frame_Env_Manage_Pytorch_Install = QFrame(self.GroupBox_Env_Manage_Pytorch) + self.Frame_Env_Manage_Pytorch_Install = QFrame(self.ToolBox_Env_Manage_Pytorch_Page1Content) self.Frame_Env_Manage_Pytorch_Install.setObjectName(u"Frame_Env_Manage_Pytorch_Install") self.Frame_Env_Manage_Pytorch_Install.setMinimumSize(QSize(0, 90)) self.Frame_Env_Manage_Pytorch_Install.setStyleSheet(u"QFrame {\n" @@ -2067,8 +2055,9 @@ def setupUi(self, MainWindow): self.verticalLayout_105.addWidget(self.Frame_Env_Manage_Pytorch_Install) + self.ToolBox_Env_Manage_Pytorch.addItem(self.ToolBox_Env_Manage_Pytorch_Page1Content, u"") - self.verticalLayout_81.addWidget(self.GroupBox_Env_Manage_Pytorch) + self.verticalLayout_81.addWidget(self.ToolBox_Env_Manage_Pytorch) self.VerticalSpacer_Env_Manage = QSpacerItem(17, 250, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) @@ -13335,11 +13324,179 @@ def setupUi(self, MainWindow): self.ScrollArea_Settings_Tools.setWidgetResizable(True) self.ScrollAreaWidgetContents_Settings_Tools = QWidget() self.ScrollAreaWidgetContents_Settings_Tools.setObjectName(u"ScrollAreaWidgetContents_Settings_Tools") - self.ScrollAreaWidgetContents_Settings_Tools.setGeometry(QRect(0, 0, 235, 811)) + self.ScrollAreaWidgetContents_Settings_Tools.setGeometry(QRect(0, 0, 235, 901)) self.verticalLayout_34 = QVBoxLayout(self.ScrollAreaWidgetContents_Settings_Tools) self.verticalLayout_34.setSpacing(0) self.verticalLayout_34.setObjectName(u"verticalLayout_34") self.verticalLayout_34.setContentsMargins(0, 0, 0, 0) + self.GroupBox_Settings_Tools_Function = QGroupBox(self.ScrollAreaWidgetContents_Settings_Tools) + self.GroupBox_Settings_Tools_Function.setObjectName(u"GroupBox_Settings_Tools_Function") + self.GroupBox_Settings_Tools_Function.setStyleSheet(u"QGroupBox {\n" +" font-size: 15px;\n" +" margin-top: 1.5ex;\n" +" background-color: transparent;\n" +" border-width: 1px;\n" +" border-style: solid;\n" +" border-color: transparent;\n" +"}\n" +"QGroupBox::title {\n" +" left: 9px;\n" +" margin-left: 0px;\n" +" subcontrol-origin: margin;\n" +" subcontrol-position: top left;\n" +" padding: 3px;\n" +"}") + self.verticalLayout_76 = QVBoxLayout(self.GroupBox_Settings_Tools_Function) + self.verticalLayout_76.setSpacing(0) + self.verticalLayout_76.setObjectName(u"verticalLayout_76") + self.verticalLayout_76.setContentsMargins(0, 12, 0, 12) + self.Frame_Setting_AutoReset = QFrame(self.GroupBox_Settings_Tools_Function) + self.Frame_Setting_AutoReset.setObjectName(u"Frame_Setting_AutoReset") + self.Frame_Setting_AutoReset.setMinimumSize(QSize(0, 90)) + self.Frame_Setting_AutoReset.setStyleSheet(u"QFrame {\n" +" background-color: transparent;\n" +" border-width: 0px;\n" +" border-style: solid;\n" +"}\n" +"QFrame:hover {\n" +" background-color: rgba(36, 36, 36, 12);\n" +"}") + self.horizontalLayout_75 = QHBoxLayout(self.Frame_Setting_AutoReset) + self.horizontalLayout_75.setSpacing(12) + self.horizontalLayout_75.setObjectName(u"horizontalLayout_75") + self.horizontalLayout_75.setContentsMargins(21, 12, 21, 12) + self.Label_Setting_AutoReset = QLabel(self.Frame_Setting_AutoReset) + self.Label_Setting_AutoReset.setObjectName(u"Label_Setting_AutoReset") + sizePolicy4.setHeightForWidth(self.Label_Setting_AutoReset.sizePolicy().hasHeightForWidth()) + self.Label_Setting_AutoReset.setSizePolicy(sizePolicy4) + self.Label_Setting_AutoReset.setStyleSheet(u"QLabel {\n" +" font-size: 15px;\n" +" /*text-align: center;*/\n" +" background-color: transparent;\n" +" padding: 0px;\n" +" border-width: 0px;\n" +" border-radius: 0px;\n" +" border-style: solid;\n" +"}") + + self.horizontalLayout_75.addWidget(self.Label_Setting_AutoReset) + + self.CheckBox_Setting_AutoReset = QCheckBox(self.Frame_Setting_AutoReset) + self.CheckBox_Setting_AutoReset.setObjectName(u"CheckBox_Setting_AutoReset") + sizePolicy5.setHeightForWidth(self.CheckBox_Setting_AutoReset.sizePolicy().hasHeightForWidth()) + self.CheckBox_Setting_AutoReset.setSizePolicy(sizePolicy5) + self.CheckBox_Setting_AutoReset.setMinimumSize(QSize(0, 30)) + self.CheckBox_Setting_AutoReset.setStyleSheet(u"QCheckBox {\n" +" font-size: 15px;\n" +" spacing: 12.3px;\n" +" background-color: transparent;\n" +" padding: 0px;\n" +" border-width: 0px;\n" +" border-radius: 6px;\n" +" border-style: solid;\n" +"}\n" +"QCheckBox:hover {\n" +"}\n" +"\n" +"QCheckBox::indicator {\n" +" width: 30px;\n" +" height: 30px;\n" +" background-color: transparent;\n" +" padding: 0px;\n" +" border-width: 0px;\n" +" border-radius: 6px;\n" +" border-style: solid;\n" +"}\n" +"QCheckBox::indicator:hover {\n" +" background-color: rgba(255, 255, 255, 21);\n" +"}\n" +"QCheckBox::indicator:unchecked {\n" +" border-image: url(:/CheckBox_Icon/Sources/ToggleOff.png);\n" +"}\n" +"QCheckBox::indicator:checked {\n" +" border-image: url(:/CheckBox_Icon/Sources/ToggleOn.png);\n" +"}") + + self.horizontalLayout_75.addWidget(self.CheckBox_Setting_AutoReset) + + + self.verticalLayout_76.addWidget(self.Frame_Setting_AutoReset) + + self.Frame_Setting_Synchronizer = QFrame(self.GroupBox_Settings_Tools_Function) + self.Frame_Setting_Synchronizer.setObjectName(u"Frame_Setting_Synchronizer") + self.Frame_Setting_Synchronizer.setMinimumSize(QSize(0, 90)) + self.Frame_Setting_Synchronizer.setStyleSheet(u"QFrame {\n" +" background-color: transparent;\n" +" border-width: 0px;\n" +" border-style: solid;\n" +"}\n" +"QFrame:hover {\n" +" background-color: rgba(36, 36, 36, 12);\n" +"}") + self.horizontalLayout_74 = QHBoxLayout(self.Frame_Setting_Synchronizer) + self.horizontalLayout_74.setSpacing(12) + self.horizontalLayout_74.setObjectName(u"horizontalLayout_74") + self.horizontalLayout_74.setContentsMargins(21, 12, 21, 12) + self.Label_Setting_Synchronizer = QLabel(self.Frame_Setting_Synchronizer) + self.Label_Setting_Synchronizer.setObjectName(u"Label_Setting_Synchronizer") + sizePolicy4.setHeightForWidth(self.Label_Setting_Synchronizer.sizePolicy().hasHeightForWidth()) + self.Label_Setting_Synchronizer.setSizePolicy(sizePolicy4) + self.Label_Setting_Synchronizer.setStyleSheet(u"QLabel {\n" +" font-size: 15px;\n" +" /*text-align: center;*/\n" +" background-color: transparent;\n" +" padding: 0px;\n" +" border-width: 0px;\n" +" border-radius: 0px;\n" +" border-style: solid;\n" +"}") + + self.horizontalLayout_74.addWidget(self.Label_Setting_Synchronizer) + + self.CheckBox_Setting_Synchronizer = QCheckBox(self.Frame_Setting_Synchronizer) + self.CheckBox_Setting_Synchronizer.setObjectName(u"CheckBox_Setting_Synchronizer") + sizePolicy5.setHeightForWidth(self.CheckBox_Setting_Synchronizer.sizePolicy().hasHeightForWidth()) + self.CheckBox_Setting_Synchronizer.setSizePolicy(sizePolicy5) + self.CheckBox_Setting_Synchronizer.setMinimumSize(QSize(0, 30)) + self.CheckBox_Setting_Synchronizer.setStyleSheet(u"QCheckBox {\n" +" font-size: 15px;\n" +" spacing: 12.3px;\n" +" background-color: transparent;\n" +" padding: 0px;\n" +" border-width: 0px;\n" +" border-radius: 6px;\n" +" border-style: solid;\n" +"}\n" +"QCheckBox:hover {\n" +"}\n" +"\n" +"QCheckBox::indicator {\n" +" width: 30px;\n" +" height: 30px;\n" +" background-color: transparent;\n" +" padding: 0px;\n" +" border-width: 0px;\n" +" border-radius: 6px;\n" +" border-style: solid;\n" +"}\n" +"QCheckBox::indicator:hover {\n" +" background-color: rgba(255, 255, 255, 21);\n" +"}\n" +"QCheckBox::indicator:unchecked {\n" +" border-image: url(:/CheckBox_Icon/Sources/ToggleOff.png);\n" +"}\n" +"QCheckBox::indicator:checked {\n" +" border-image: url(:/CheckBox_Icon/Sources/ToggleOn.png);\n" +"}") + + self.horizontalLayout_74.addWidget(self.CheckBox_Setting_Synchronizer) + + + self.verticalLayout_76.addWidget(self.Frame_Setting_Synchronizer) + + + self.verticalLayout_34.addWidget(self.GroupBox_Settings_Tools_Function) + self.GroupBox_Settings_Tools_Path = QGroupBox(self.ScrollAreaWidgetContents_Settings_Tools) self.GroupBox_Settings_Tools_Path.setObjectName(u"GroupBox_Settings_Tools_Path") self.GroupBox_Settings_Tools_Path.setStyleSheet(u"QGroupBox {\n" @@ -13725,102 +13882,6 @@ def setupUi(self, MainWindow): self.verticalLayout_34.addItem(self.VerticalSpacer_Settings_Tools) - self.GroupBox_Settings_Tools_Function = QGroupBox(self.ScrollAreaWidgetContents_Settings_Tools) - self.GroupBox_Settings_Tools_Function.setObjectName(u"GroupBox_Settings_Tools_Function") - self.GroupBox_Settings_Tools_Function.setStyleSheet(u"QGroupBox {\n" -" font-size: 15px;\n" -" margin-top: 1.5ex;\n" -" background-color: transparent;\n" -" border-width: 1px;\n" -" border-style: solid;\n" -" border-color: transparent;\n" -"}\n" -"QGroupBox::title {\n" -" left: 9px;\n" -" margin-left: 0px;\n" -" subcontrol-origin: margin;\n" -" subcontrol-position: top left;\n" -" padding: 3px;\n" -"}") - self.verticalLayout_82 = QVBoxLayout(self.GroupBox_Settings_Tools_Function) - self.verticalLayout_82.setSpacing(0) - self.verticalLayout_82.setObjectName(u"verticalLayout_82") - self.verticalLayout_82.setContentsMargins(0, 12, 0, 12) - self.Frame_Setting_Synchronizer = QFrame(self.GroupBox_Settings_Tools_Function) - self.Frame_Setting_Synchronizer.setObjectName(u"Frame_Setting_Synchronizer") - self.Frame_Setting_Synchronizer.setMinimumSize(QSize(0, 90)) - self.Frame_Setting_Synchronizer.setStyleSheet(u"QFrame {\n" -" background-color: transparent;\n" -" border-width: 0px;\n" -" border-style: solid;\n" -"}\n" -"QFrame:hover {\n" -" background-color: rgba(36, 36, 36, 12);\n" -"}") - self.horizontalLayout_74 = QHBoxLayout(self.Frame_Setting_Synchronizer) - self.horizontalLayout_74.setSpacing(12) - self.horizontalLayout_74.setObjectName(u"horizontalLayout_74") - self.horizontalLayout_74.setContentsMargins(21, 12, 21, 12) - self.Label_Setting_Synchronizer = QLabel(self.Frame_Setting_Synchronizer) - self.Label_Setting_Synchronizer.setObjectName(u"Label_Setting_Synchronizer") - sizePolicy4.setHeightForWidth(self.Label_Setting_Synchronizer.sizePolicy().hasHeightForWidth()) - self.Label_Setting_Synchronizer.setSizePolicy(sizePolicy4) - self.Label_Setting_Synchronizer.setStyleSheet(u"QLabel {\n" -" font-size: 15px;\n" -" /*text-align: center;*/\n" -" background-color: transparent;\n" -" padding: 0px;\n" -" border-width: 0px;\n" -" border-radius: 0px;\n" -" border-style: solid;\n" -"}") - - self.horizontalLayout_74.addWidget(self.Label_Setting_Synchronizer) - - self.CheckBox_Setting_Synchronizer = QCheckBox(self.Frame_Setting_Synchronizer) - self.CheckBox_Setting_Synchronizer.setObjectName(u"CheckBox_Setting_Synchronizer") - sizePolicy5.setHeightForWidth(self.CheckBox_Setting_Synchronizer.sizePolicy().hasHeightForWidth()) - self.CheckBox_Setting_Synchronizer.setSizePolicy(sizePolicy5) - self.CheckBox_Setting_Synchronizer.setMinimumSize(QSize(0, 30)) - self.CheckBox_Setting_Synchronizer.setStyleSheet(u"QCheckBox {\n" -" font-size: 15px;\n" -" spacing: 12.3px;\n" -" background-color: transparent;\n" -" padding: 0px;\n" -" border-width: 0px;\n" -" border-radius: 6px;\n" -" border-style: solid;\n" -"}\n" -"QCheckBox:hover {\n" -"}\n" -"\n" -"QCheckBox::indicator {\n" -" width: 30px;\n" -" height: 30px;\n" -" background-color: transparent;\n" -" padding: 0px;\n" -" border-width: 0px;\n" -" border-radius: 6px;\n" -" border-style: solid;\n" -"}\n" -"QCheckBox::indicator:hover {\n" -" background-color: rgba(255, 255, 255, 21);\n" -"}\n" -"QCheckBox::indicator:unchecked {\n" -" border-image: url(:/CheckBox_Icon/Sources/ToggleOff.png);\n" -"}\n" -"QCheckBox::indicator:checked {\n" -" border-image: url(:/CheckBox_Icon/Sources/ToggleOn.png);\n" -"}") - - self.horizontalLayout_74.addWidget(self.CheckBox_Setting_Synchronizer) - - - self.verticalLayout_82.addWidget(self.Frame_Setting_Synchronizer) - - - self.verticalLayout_34.addWidget(self.GroupBox_Settings_Tools_Function) - self.ScrollArea_Settings_Tools.setWidget(self.ScrollAreaWidgetContents_Settings_Tools) self.gridLayout_93.addWidget(self.ScrollArea_Settings_Tools, 0, 0, 1, 1) @@ -14423,8 +14484,8 @@ def retranslateUi(self, MainWindow): self.Label_Env_Install_PyReqs.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) self.Label_Env_Install_Pytorch_Status.setText(QCoreApplication.translate("MainWindow", u"--", None)) self.Label_Env_Install_Pytorch.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) - self.GroupBox_Env_Manage_Pytorch.setTitle(QCoreApplication.translate("MainWindow", u"GroupBox", None)) self.Label_Env_Manage_Pytorch_Version.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) + self.ToolBox_Env_Manage_Pytorch.setItemText(self.ToolBox_Env_Manage_Pytorch.indexOf(self.ToolBox_Env_Manage_Pytorch_Page1Content), "") self.ToolButton_Models_Process_Title.setText(QCoreApplication.translate("MainWindow", u"Label", None)) self.ToolButton_Models_ASR_Title.setText(QCoreApplication.translate("MainWindow", u"Label", None)) self.ToolButton_Models_STT_Title.setText(QCoreApplication.translate("MainWindow", u"Label", None)) @@ -14690,6 +14751,11 @@ def retranslateUi(self, MainWindow): self.Label_Setting_AutoUpdate.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) self.CheckBox_Setting_AutoUpdate.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None)) self.GroupBox_Settings_Client_Operation.setTitle(QCoreApplication.translate("MainWindow", u"GroupBox", None)) + self.GroupBox_Settings_Tools_Function.setTitle(QCoreApplication.translate("MainWindow", u"GroupBox", None)) + self.Label_Setting_AutoReset.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) + self.CheckBox_Setting_AutoReset.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None)) + self.Label_Setting_Synchronizer.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) + self.CheckBox_Setting_Synchronizer.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None)) self.GroupBox_Settings_Tools_Path.setTitle(QCoreApplication.translate("MainWindow", u"GroupBox", None)) self.Label_Process_OutputRoot.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) self.Label_ASR_VPR_OutputRoot.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) @@ -14698,9 +14764,6 @@ def retranslateUi(self, MainWindow): self.Label_DAT_VITS_OutputRoot.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) self.Label_Train_GPTSoVITS_OutputRoot.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) self.Label_Train_VITS_OutputRoot.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) - self.GroupBox_Settings_Tools_Function.setTitle(QCoreApplication.translate("MainWindow", u"GroupBox", None)) - self.Label_Setting_Synchronizer.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) - self.CheckBox_Setting_Synchronizer.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None)) self.ToolButton_Info_Title.setText(QCoreApplication.translate("MainWindow", u"Label", None)) self.Button_Console_Title.setText(QCoreApplication.translate("MainWindow", u"Label", None)) self.Label_ToolsStatus.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) diff --git a/Run.py b/Run.py index 7004d4b..cd414a7 100644 --- a/Run.py +++ b/Run.py @@ -20,7 +20,7 @@ ############################################################################################################################## # Set current version -CurrentVersion = "v1.0.8" +CurrentVersion = "v1.0.9" ############################################################################################################################## @@ -557,22 +557,24 @@ def GetModelInfo_Cloud(ModelDict): Name = ModelDict["name"] for Model, ModelSHA in ModelDict["SHA"].items(): ModelName = Model + ModelName, ModelType = ModelName.rsplit('.', 1) ModelSize = ModelDict["size"][Model] ModelDate = ModelDict["date"][Model] ModelSHA = ModelSHA ModelURL = ModelDict["downloadurl"][Model] ModelDir = Path(ModelsDir).joinpath("Downloaded", Name) DownloadParam = (ModelURL, ModelDir, ModelName, Path(ModelURL).suffix, ModelSHA) - ModelsInfo[ModelSHA] = [str(f"[{Name}]{ModelName}"), str(ModelSize), str(ModelDate), tuple(DownloadParam)] + ModelsInfo[ModelSHA] = [str(f"[{Name}]{ModelName}"), str(ModelType), str(ModelSize), str(ModelDate), tuple(DownloadParam)] else: ModelName = ModelDict["name"] + ModelName, ModelType = ModelName.rsplit('.', 1) ModelSize = ModelDict["size"] ModelDate = ModelDict["date"] ModelSHA = ModelDict["SHA"] ModelURL = ModelDict["downloadurl"] ModelDir = Path(ModelsDir).joinpath("Downloaded") DownloadParam = (ModelURL, ModelDir, ModelName, Path(ModelURL).suffix, ModelSHA) - ModelsInfo[ModelSHA] = [str(ModelName), str(ModelSize), str(ModelDate), tuple(DownloadParam)] + ModelsInfo[ModelSHA] = [str(ModelName), str(ModelType), str(ModelSize), str(ModelDate), tuple(DownloadParam)] with ThreadPoolExecutor(max_workers = os.cpu_count()) as Executor: Executor.map( GetModelInfo_Cloud, @@ -587,14 +589,15 @@ def GetModelInfo_Cloud(ModelDict): ModelPaths_Local = list(set(ModelPaths_Local)) def GetModelInfo_Local(ModelPath): Name = Path(ModelPath).parts[-2] if Path(ModelPath).parent.__str__() not in Path(ModelsDir).joinpath("Downloaded").__str__() else None - ModelName = Path(ModelPath).stem + ModelName = Path(ModelPath).name + ModelName, ModelType = ModelName.rsplit('.', 1) ModelSize = round(Path(ModelPath).stat().st_size / (1024 ** 2), 1) ModelDate = datetime.fromtimestamp(Path(ModelPath).stat().st_mtime) with open(ModelPath, "rb") as m: ModelBytes = m.read() ModelSHA = hashlib.sha256(ModelBytes).hexdigest() ModelDir = Path(ModelPath).parent - ModelsInfo[ModelSHA] = [str(f"[{Name}]{ModelName}" if Name is not None else ModelName), str(ModelSize)+'MB', str(ModelDate), str(ModelDir)] + ModelsInfo[ModelSHA] = [str(f"[{Name}]{ModelName}" if Name is not None else ModelName), str(ModelType), str(ModelSize)+'MB', str(ModelDate), str(ModelDir)] with ThreadPoolExecutor(max_workers = os.cpu_count()) as Executor: Executor.map( GetModelInfo_Local, @@ -1479,7 +1482,7 @@ def SetPic(): ) self.ui.TabWidget_Models_Process.setTabText(0, 'UVR(人声分离)') - self.ui.Table_Models_Process_UVR.SetHorizontalHeaders(['名字', '大小', '日期', '操作']) + self.ui.Table_Models_Process_UVR.SetHorizontalHeaders(['名字', '类型', '大小', '日期', '操作']) ModelViewSignals.Signal_Process_UVR.connect(self.ui.Table_Models_Process_UVR.SetValue) self.ui.Table_Models_Process_UVR.Download.connect( lambda Params: self.Function_SetMethodExecutor( @@ -1503,7 +1506,7 @@ def SetPic(): ) self.ui.TabWidget_Models_ASR.setTabText(0, 'VPR(声纹识别)') - self.ui.Table_Models_ASR_VPR.SetHorizontalHeaders(['名字', '大小', '日期', '操作']) + self.ui.Table_Models_ASR_VPR.SetHorizontalHeaders(['名字', '类型', '大小', '日期', '操作']) ModelViewSignals.Signal_ASR_VPR.connect(self.ui.Table_Models_ASR_VPR.SetValue) self.ui.Table_Models_ASR_VPR.Download.connect( lambda Params: self.Function_SetMethodExecutor( @@ -1527,7 +1530,7 @@ def SetPic(): ) self.ui.TabWidget_Models_STT.setTabText(0, 'Whisper') - self.ui.Table_Models_STT_Whisper.SetHorizontalHeaders(['名字', '大小', '日期', '操作']) + self.ui.Table_Models_STT_Whisper.SetHorizontalHeaders(['名字', '类型', '大小', '日期', '操作']) ModelViewSignals.Signal_STT_Whisper.connect(self.ui.Table_Models_STT_Whisper.SetValue) self.ui.Table_Models_STT_Whisper.Download.connect( lambda Params: self.Function_SetMethodExecutor( @@ -1551,7 +1554,7 @@ def SetPic(): ) self.ui.TabWidget_Models_TTS.setTabText(0, 'GPT-SoVITS') - self.ui.Table_Models_TTS_GPTSoVITS.SetHorizontalHeaders(['名字', '大小', '日期', '操作']) + self.ui.Table_Models_TTS_GPTSoVITS.SetHorizontalHeaders(['名字', '类型', '大小', '日期', '操作']) ModelViewSignals.Signal_TTS_GPTSoVITS.connect(self.ui.Table_Models_TTS_GPTSoVITS.SetValue) self.ui.Table_Models_TTS_GPTSoVITS.Download.connect( lambda Params: self.Function_SetMethodExecutor( @@ -1561,7 +1564,7 @@ def SetPic(): ) self.ui.TabWidget_Models_TTS.setTabText(1, 'VITS') - self.ui.Table_Models_TTS_VITS.SetHorizontalHeaders(['名字', '大小', '日期', '操作']) + self.ui.Table_Models_TTS_VITS.SetHorizontalHeaders(['名字', '类型', '大小', '日期', '操作']) ModelViewSignals.Signal_TTS_VITS.connect(self.ui.Table_Models_TTS_VITS.SetValue) self.ui.Table_Models_TTS_VITS.Download.connect( lambda Params: self.Function_SetMethodExecutor( @@ -1674,7 +1677,7 @@ def AppendModel(): ) ParamsManager_Process.SetParam( Widget = self.ui.LineEdit_Process_MediaDirInput, - Section = 'AudioProcessor', + Section = 'Input Params', Option = 'Media_Dir_Input', DefaultValue = '', SetPlaceholderText = True @@ -1699,7 +1702,7 @@ def AppendModel(): ) ParamsManager_Process.SetParam( Widget = self.ui.CheckBox_Process_DenoiseAudio, - Section = 'AudioProcessor', + Section = 'Denoiser Params', Option = 'Denoise_Audio', DefaultValue = True ) @@ -1744,7 +1747,7 @@ def AppendModel(): Process_DenoiseModelPath_Default = Path(ModelsDir).joinpath('Process', 'UVR', 'Downloaded', 'HP5_only_main_vocal.pth').as_posix() ParamsManager_Process.SetParam( Widget = self.ui.LineEdit_Process_DenoiseModelPath, - Section = 'AudioProcessor', + Section = 'Denoiser Params', Option = 'Denoise_Model_Path', DefaultValue = Process_DenoiseModelPath_Default, SetPlaceholderText = True @@ -1770,7 +1773,7 @@ def AppendModel(): self.ui.ComboBox_Process_DenoiseTarget.addItems([QCA.translate("ComboBox", '人声'), QCA.translate("ComboBox", '背景声')]) ParamsManager_Process.SetParam( Widget = self.ui.ComboBox_Process_DenoiseTarget, - Section = 'AudioProcessor', + Section = 'Denoiser Params', Option = 'Denoise_Target', DefaultValue = '人声' ) @@ -1790,7 +1793,7 @@ def AppendModel(): ) ParamsManager_Process.SetParam( Widget = self.ui.CheckBox_Process_SliceAudio, - Section = 'AudioProcessor', + Section = 'Slicer Params', Option = 'Slice_Audio', DefaultValue = True ) @@ -1847,7 +1850,7 @@ def AppendModel(): #self.ui.DoubleSpinBox_Process_RMSThreshold.setSingleStep(0.01) ParamsManager_Process.SetParam( Widget = self.ui.DoubleSpinBox_Process_RMSThreshold, - Section = 'AudioProcessor', + Section = 'Slicer Params', Option = 'RMS_Threshold', DefaultValue = -34. ) @@ -1868,7 +1871,7 @@ def AppendModel(): self.ui.SpinBox_Process_HopSize.setSingleStep(1) ParamsManager_Process.SetParam( Widget = self.ui.SpinBox_Process_HopSize, - Section = 'AudioProcessor', + Section = 'Slicer Params', Option = 'Hop_Size', DefaultValue = 10 ) @@ -1888,7 +1891,7 @@ def AppendModel(): self.ui.SpinBox_Process_SilentIntervalMin.setSingleStep(1) ParamsManager_Process.SetParam( Widget = self.ui.SpinBox_Process_SilentIntervalMin, - Section = 'AudioProcessor', + Section = 'Slicer Params', Option = 'Silent_Interval_Min', DefaultValue = 300 ) @@ -1909,7 +1912,7 @@ def AppendModel(): self.ui.SpinBox_Process_SilenceKeptMax.setSingleStep(1) ParamsManager_Process.SetParam( Widget = self.ui.SpinBox_Process_SilenceKeptMax, - Section = 'AudioProcessor', + Section = 'Slicer Params', Option = 'Silence_Kept_Max', DefaultValue = 500 ) @@ -1930,7 +1933,7 @@ def AppendModel(): self.ui.SpinBox_Process_AudioLengthMin.setSingleStep(1) ParamsManager_Process.SetParam( Widget = self.ui.SpinBox_Process_AudioLengthMin, - Section = 'AudioProcessor', + Section = 'Slicer Params', Option = 'Audio_Length_Min', DefaultValue = 4000 ) @@ -1951,7 +1954,7 @@ def AppendModel(): self.ui.ComboBox_Process_MediaFormatOutput.addItems(['flac', 'wav', 'mp3', 'aac', 'm4a', 'wma', 'aiff', 'au', 'ogg', 'None']) ParamsManager_Process.SetParam( Widget = self.ui.ComboBox_Process_MediaFormatOutput, - Section = 'AudioProcessor', + Section = 'Output Params', Option = 'Media_Format_Output', DefaultValue = 'wav' ) @@ -1970,7 +1973,7 @@ def AppendModel(): Process_OutputDirName_Default = str(date.today()) ParamsManager_Process.SetParam( Widget = self.ui.LineEdit_Process_OutputDirName, - Section = 'AudioProcessor', + Section = 'Output Params', Option = 'Output_Dir_Name', DefaultValue = '', SetPlaceholderText = True, @@ -1994,10 +1997,8 @@ def SetText_LineEdit_Process_OutputDir(): LineEdit_Process_OutputDir.setText(DirText) Alert = Path(DirText).exists() and list(Path(DirText).iterdir()) != [] self.ui.LineEdit_Process_OutputDirName.Alert(True if Alert else False, "注意:目录已包含文件") - self.ui.LineEdit_Process_OutputDirName.textChanged.connect(SetText_LineEdit_Process_OutputDir) - self.ui.LineEdit_Process_OutputDirName.focusedOut.connect(SetText_LineEdit_Process_OutputDir) - self.ui.LineEdit_Process_OutputRoot.textChanged.connect(SetText_LineEdit_Process_OutputDir) - self.ui.LineEdit_Process_OutputRoot.focusedOut.connect(SetText_LineEdit_Process_OutputDir) + self.ui.LineEdit_Process_OutputDirName.interacted.connect(SetText_LineEdit_Process_OutputDir) + self.ui.LineEdit_Process_OutputRoot.interacted.connect(SetText_LineEdit_Process_OutputDir) #SetText_LineEdit_Process_OutputDir() self.ui.ToolBox_Process_OutputParams_AdvanceSettings.widget(0).setText(QCA.translate("ToolBox", "高级设置")) @@ -2011,7 +2012,7 @@ def SetText_LineEdit_Process_OutputDir(): ) ParamsManager_Process.SetParam( Widget = self.ui.CheckBox_Process_ToMono, - Section = 'AudioProcessor', + Section = 'Output Params', Option = 'ToMono', DefaultValue = False ) @@ -2040,7 +2041,7 @@ def SetText_LineEdit_Process_OutputDir(): self.ui.ComboBox_Process_SampleRate.addItems(['22050', '44100', '48000', '96000', '192000', 'None']) ParamsManager_Process.SetParam( Widget = self.ui.ComboBox_Process_SampleRate, - Section = 'AudioProcessor', + Section = 'Output Params', Option = 'SampleRate', DefaultValue = None ) @@ -2059,7 +2060,7 @@ def SetText_LineEdit_Process_OutputDir(): self.ui.ComboBox_Process_SampleWidth.addItems(['8', '16', '24', '32', '32 (Float)', 'None']) ParamsManager_Process.SetParam( Widget = self.ui.ComboBox_Process_SampleWidth, - Section = 'AudioProcessor', + Section = 'Output Params', Option = 'SampleWidth', DefaultValue = None ) @@ -2272,7 +2273,7 @@ def SetText_LineEdit_Process_OutputDir(): ) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.LineEdit_ASR_VPR_AudioDirInput, - Section = 'VPR', + Section = 'Input Params', Option = 'Audio_Dir_Input', DefaultValue = '', SetPlaceholderText = True @@ -2297,7 +2298,7 @@ def SetText_LineEdit_Process_OutputDir(): self.ui.Table_ASR_VPR_StdAudioSpeaker.SetHorizontalHeaders(['人物姓名', '音频路径', '增删']) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.Table_ASR_VPR_StdAudioSpeaker, - Section = 'VPR', + Section = 'Input Params', Option = 'StdAudioSpeaker', DefaultValue = {"": ""} ) @@ -2317,7 +2318,7 @@ def SetText_LineEdit_Process_OutputDir(): self.ui.DoubleSpinBox_ASR_VPR_DecisionThreshold.setSingleStep(0.01) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.DoubleSpinBox_ASR_VPR_DecisionThreshold, - Section = 'VPR', + Section = 'VPR Params', Option = 'DecisionThreshold', DefaultValue = 0.75 ) @@ -2336,7 +2337,7 @@ def SetText_LineEdit_Process_OutputDir(): ASR_VPR_ModelPath_Default = Path(ModelsDir).joinpath('ASR', 'VPR', 'Downloaded', 'Ecapa-Tdnn_spectrogram.pth').as_posix() ParamsManager_ASR_VPR.SetParam( Widget = self.ui.LineEdit_ASR_VPR_ModelPath, - Section = 'VPR', + Section = 'VPR Params', Option = 'Model_Path', DefaultValue = ASR_VPR_ModelPath_Default, SetPlaceholderText = True, @@ -2366,7 +2367,7 @@ def SetText_LineEdit_Process_OutputDir(): self.ui.ComboBox_ASR_VPR_ModelType.addItems(['Ecapa-Tdnn']) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.ComboBox_ASR_VPR_ModelType, - Section = 'VPR', + Section = 'VPR Params', Option = 'Model_Type', DefaultValue = 'Ecapa-Tdnn' ) @@ -2385,7 +2386,7 @@ def SetText_LineEdit_Process_OutputDir(): self.ui.ComboBox_ASR_VPR_FeatureMethod.addItems(['spectrogram', 'melspectrogram']) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.ComboBox_ASR_VPR_FeatureMethod, - Section = 'VPR', + Section = 'VPR Params', Option = 'Feature_Method', DefaultValue = 'spectrogram' ) @@ -2405,7 +2406,7 @@ def SetText_LineEdit_Process_OutputDir(): #self.ui.DoubleSpinBox_ASR_VPR_DurationOfAudio.setSingleStep(0.01) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.DoubleSpinBox_ASR_VPR_DurationOfAudio, - Section = 'VPR', + Section = 'VPR Params', Option = 'Duration_of_Audio', DefaultValue = 3.00 ) @@ -2426,7 +2427,7 @@ def SetText_LineEdit_Process_OutputDir(): ) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.CheckBox_ASR_VPR_FilterResult, - Section = 'VPR', + Section = 'Output Params', Option = 'FilterResult', DefaultValue = False ) @@ -2456,7 +2457,7 @@ def SetText_LineEdit_Process_OutputDir(): ASR_VPR_OutputDirName_Default = str(date.today()) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.LineEdit_ASR_VPR_OutputDirName, - Section = 'VPR', + Section = 'Output Params', Option = 'Audio_Dir_Output', DefaultValue = '', SetPlaceholderText = True, @@ -2482,7 +2483,7 @@ def SetText_LineEdit_Process_OutputDir(): ASR_VPR_AudioSpeakersDataName_Default = "Recgonition_" + str(date.today()) ParamsManager_ASR_VPR.SetParam( Widget = self.ui.LineEdit_ASR_VPR_AudioSpeakersDataName, - Section = 'VPR', + Section = 'Output Params', Option = 'FileList_Name', DefaultValue = ASR_VPR_AudioSpeakersDataName_Default, SetPlaceholderText = True, @@ -2506,10 +2507,8 @@ def SetText_LineEdit_ASR_VPR_OutputDir(): LineEdit_ASR_VPR_OutputDir.setText(DirText) Alert = Path(DirText).exists() and list(Path(DirText).iterdir()) != [] self.ui.LineEdit_ASR_VPR_OutputDirName.Alert(True if Alert else False, "注意:目录已包含文件") - self.ui.LineEdit_ASR_VPR_OutputDirName.textChanged.connect(SetText_LineEdit_ASR_VPR_OutputDir) - self.ui.LineEdit_ASR_VPR_OutputDirName.focusedOut.connect(SetText_LineEdit_ASR_VPR_OutputDir) - self.ui.LineEdit_ASR_VPR_OutputRoot.textChanged.connect(SetText_LineEdit_ASR_VPR_OutputDir) - self.ui.LineEdit_ASR_VPR_OutputRoot.focusedOut.connect(SetText_LineEdit_ASR_VPR_OutputDir) + self.ui.LineEdit_ASR_VPR_OutputDirName.interacted.connect(SetText_LineEdit_ASR_VPR_OutputDir) + self.ui.LineEdit_ASR_VPR_OutputRoot.interacted.connect(SetText_LineEdit_ASR_VPR_OutputDir) #SetText_LineEdit_ASR_VPR_OutputDir() LineEdit_ASR_VPR_AudioSpeakersDataPath = QLineEdit() @@ -2522,8 +2521,7 @@ def SetText_LineEdit_ASR_VPR_AudioSpeakersDataPath(): LineEdit_ASR_VPR_AudioSpeakersDataPath.setText(PathText) Alert = Path(PathText).exists() self.ui.LineEdit_ASR_VPR_AudioSpeakersDataName.Alert(True if Alert else False, "注意:路径已存在") - self.ui.LineEdit_ASR_VPR_AudioSpeakersDataName.textChanged.connect(SetText_LineEdit_ASR_VPR_AudioSpeakersDataPath) - self.ui.LineEdit_ASR_VPR_AudioSpeakersDataName.focusedOut.connect(SetText_LineEdit_ASR_VPR_AudioSpeakersDataPath) + self.ui.LineEdit_ASR_VPR_AudioSpeakersDataName.interacted.connect(SetText_LineEdit_ASR_VPR_AudioSpeakersDataPath) LineEdit_ASR_VPR_OutputDir.textChanged.connect(SetText_LineEdit_ASR_VPR_AudioSpeakersDataPath) #SetText_LineEdit_ASR_VPR_AudioSpeakersDataPath() @@ -2805,7 +2803,7 @@ def EditASRResult(): ) ParamsManager_STT_Whisper.SetParam( Widget = self.ui.LineEdit_STT_Whisper_AudioDir, - Section = 'Whisper', + Section = 'Input Params', Option = 'Audio_Dir', DefaultValue = '', SetPlaceholderText = True @@ -2830,7 +2828,7 @@ def EditASRResult(): ) ParamsManager_STT_Whisper.SetParam( Widget = self.ui.CheckBox_STT_Whisper_AddLanguageInfo, - Section = 'Whisper', + Section = 'Whisper Params', Option = 'Add_LanguageInfo', DefaultValue = True ) @@ -2859,7 +2857,7 @@ def EditASRResult(): STT_Whisper_ModelPath_Default = Path(ModelsDir).joinpath('STT', 'Whisper', 'Downloaded', 'small.pt').as_posix() ParamsManager_STT_Whisper.SetParam( Widget = self.ui.LineEdit_STT_Whisper_ModelPath, - Section = 'Whisper', + Section = 'Whisper Params', Option = 'Model_Path', DefaultValue = STT_Whisper_ModelPath_Default, SetPlaceholderText = True, @@ -2888,7 +2886,7 @@ def EditASRResult(): ) ParamsManager_STT_Whisper.SetParam( Widget = self.ui.CheckBox_STT_Whisper_Verbose, - Section = 'Whisper', + Section = 'Whisper Params', Option = 'Verbose', DefaultValue = True ) @@ -2916,7 +2914,7 @@ def EditASRResult(): ) ParamsManager_STT_Whisper.SetParam( Widget = self.ui.CheckBox_STT_Whisper_fp16, - Section = 'Whisper', + Section = 'Whisper Params', Option = 'fp16', DefaultValue = True ) @@ -2944,7 +2942,7 @@ def EditASRResult(): ) ParamsManager_STT_Whisper.SetParam( Widget = self.ui.CheckBox_STT_Whisper_ConditionOnPreviousText, - Section = 'Whisper', + Section = 'Whisper Params', Option = 'Condition_on_Previous_Text', DefaultValue = False ) @@ -2975,7 +2973,7 @@ def EditASRResult(): STT_Whisper_OutputDirName_Default = str(date.today()) ParamsManager_STT_Whisper.SetParam( Widget = self.ui.LineEdit_STT_Whisper_OutputDirName, - Section = 'Whisper', + Section = 'Output Params', Option = 'SRT_Dir_Name', DefaultValue = '', SetPlaceholderText = True, @@ -2999,10 +2997,8 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): LineEdit_STT_Whisper_OutputDir.setText(DirText) Alert = Path(DirText).exists() and list(Path(DirText).iterdir()) != [] self.ui.LineEdit_STT_Whisper_OutputDirName.Alert(True if Alert else False, "注意:目录已包含文件") - self.ui.LineEdit_STT_Whisper_OutputDirName.textChanged.connect(SetText_LineEdit_STT_Whisper_OutputDir) - self.ui.LineEdit_STT_Whisper_OutputDirName.focusedOut.connect(SetText_LineEdit_STT_Whisper_OutputDir) - self.ui.LineEdit_STT_Whisper_OutputRoot.textChanged.connect(SetText_LineEdit_STT_Whisper_OutputDir) - self.ui.LineEdit_STT_Whisper_OutputRoot.focusedOut.connect(SetText_LineEdit_STT_Whisper_OutputDir) + self.ui.LineEdit_STT_Whisper_OutputDirName.interacted.connect(SetText_LineEdit_STT_Whisper_OutputDir) + self.ui.LineEdit_STT_Whisper_OutputRoot.interacted.connect(SetText_LineEdit_STT_Whisper_OutputDir) #SetText_LineEdit_STT_Whisper_OutputDir() # ChildWindow @@ -3263,7 +3259,7 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): ) ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_DAT_GPTSoVITS_AudioSpeakersDataPath, - Section = 'GPT-SoVITS', + Section = 'Input Params', Option = 'WAV_Dir', DefaultValue = '', SetPlaceholderText = True @@ -3286,7 +3282,7 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): ) ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_DAT_GPTSoVITS_SRTDir, - Section = 'GPT-SoVITS', + Section = 'Input Params', Option = 'SRT_Dir', DefaultValue = '', SetPlaceholderText = True @@ -3313,7 +3309,7 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): DAT_GPTSoVITS_DataFormat_Default = '路径|人名|语言|文本' ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_DAT_GPTSoVITS_DataFormat, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'DataFormat_Path', DefaultValue = DAT_GPTSoVITS_DataFormat_Default, SetPlaceholderText = True, @@ -3346,7 +3342,7 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): ) ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.CheckBox_DAT_GPTSoVITS_AddAuxiliaryData, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Add_AuxiliaryData', DefaultValue = False ) @@ -3389,7 +3385,7 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): DAT_GPTSoVITS_AuxiliaryDataPath_Default = Path(CurrentDir).joinpath('AuxiliaryData', 'GPT-SoVITS', 'AuxiliaryData.txt').as_posix() ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_DAT_GPTSoVITS_AuxiliaryDataPath, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Add_AuxiliaryData', DefaultValue = False, SetPlaceholderText = True, @@ -3419,7 +3415,7 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): DAT_GPTSoVITS_OutputDirName_Default = str(date.today()) ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_DAT_GPTSoVITS_OutputDirName, - Section = 'GPT-SoVITS', + Section = 'Output Params', Option = 'Output_Dir_Name', DefaultValue = '', SetPlaceholderText = True, @@ -3445,7 +3441,7 @@ def SetText_LineEdit_STT_Whisper_OutputDir(): DAT_GPTSoVITS_FileListName_Default = "Train_" + str(date.today()) ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_DAT_GPTSoVITS_FileListName, - Section = 'GPT-SoVITS', + Section = 'Output Params', Option = 'FileList_Name', DefaultValue = DAT_GPTSoVITS_FileListName_Default, SetPlaceholderText = True, @@ -3469,10 +3465,8 @@ def SetText_LineEdit_DAT_GPTSoVITS_OutputDir(): LineEdit_DAT_GPTSoVITS_OutputDir.setText(DirText) Alert = Path(DirText).exists() and list(Path(DirText).iterdir()) != [] self.ui.LineEdit_DAT_GPTSoVITS_OutputDirName.Alert(True if Alert else False, "注意:目录已包含文件") - self.ui.LineEdit_DAT_GPTSoVITS_OutputDirName.textChanged.connect(SetText_LineEdit_DAT_GPTSoVITS_OutputDir) - self.ui.LineEdit_DAT_GPTSoVITS_OutputDirName.focusedOut.connect(SetText_LineEdit_DAT_GPTSoVITS_OutputDir) - self.ui.LineEdit_DAT_GPTSoVITS_OutputRoot.textChanged.connect(SetText_LineEdit_DAT_GPTSoVITS_OutputDir) - self.ui.LineEdit_DAT_GPTSoVITS_OutputRoot.focusedOut.connect(SetText_LineEdit_DAT_GPTSoVITS_OutputDir) + self.ui.LineEdit_DAT_GPTSoVITS_OutputDirName.interacted.connect(SetText_LineEdit_DAT_GPTSoVITS_OutputDir) + self.ui.LineEdit_DAT_GPTSoVITS_OutputRoot.interacted.connect(SetText_LineEdit_DAT_GPTSoVITS_OutputDir) #SetText_LineEdit_DAT_GPTSoVITS_OutputDir() LineEdit_DAT_GPTSoVITS_FileListPath = QLineEdit() @@ -3485,8 +3479,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): LineEdit_DAT_GPTSoVITS_FileListPath.setText(PathText) Alert = Path(PathText).exists() self.ui.LineEdit_DAT_GPTSoVITS_FileListName.Alert(True if Alert else False, "注意:路径已存在") - self.ui.LineEdit_DAT_GPTSoVITS_FileListName.textChanged.connect(SetText_LineEdit_DAT_GPTSoVITS_FileListPath) - self.ui.LineEdit_DAT_GPTSoVITS_FileListName.focusedOut.connect(SetText_LineEdit_DAT_GPTSoVITS_FileListPath) + self.ui.LineEdit_DAT_GPTSoVITS_FileListName.interacted.connect(SetText_LineEdit_DAT_GPTSoVITS_FileListPath) LineEdit_DAT_GPTSoVITS_OutputDir.textChanged.connect(SetText_LineEdit_DAT_GPTSoVITS_FileListPath) #SetText_LineEdit_DAT_GPTSoVITS_FileListPath() @@ -3724,7 +3717,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): ) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_AudioSpeakersDataPath, - Section = 'VITS', + Section = 'Input Params', Option = 'WAV_Dir', DefaultValue = '', SetPlaceholderText = True @@ -3747,7 +3740,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): ) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_SRTDir, - Section = 'VITS', + Section = 'Input Params', Option = 'SRT_Dir', DefaultValue = '', SetPlaceholderText = True @@ -3774,7 +3767,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): DAT_VITS_DataFormat_Default = '路径|人名|[语言]文本[语言]' ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_DataFormat, - Section = 'VITS', + Section = 'VITS Params', Option = 'DataFormat_Path', DefaultValue = DAT_VITS_DataFormat_Default, SetPlaceholderText = True, @@ -3806,7 +3799,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): ) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.CheckBox_DAT_VITS_AddAuxiliaryData, - Section = 'VITS', + Section = 'VITS Params', Option = 'Add_AuxiliaryData', DefaultValue = False ) @@ -3849,7 +3842,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): DAT_VITS_AuxiliaryDataPath_Default = Path(CurrentDir).joinpath('AuxiliaryData', 'VITS', 'AuxiliaryData.txt').as_posix() ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_AuxiliaryDataPath, - Section = 'VITS', + Section = 'VITS Params', Option = 'AuxiliaryData_Path', DefaultValue = DAT_VITS_AuxiliaryDataPath_Default, SetPlaceholderText = True, @@ -3880,7 +3873,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): self.ui.DoubleSpinBox_DAT_VITS_TrainRatio.setSingleStep(0.1) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.DoubleSpinBox_DAT_VITS_TrainRatio, - Section = 'VITS', + Section = 'VITS Params', Option = 'TrainRatio', DefaultValue = 0.7 ) @@ -3899,7 +3892,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): self.ui.ComboBox_DAT_VITS_SampleRate.addItems(['22050', '44100', '48000', '96000', '192000', 'None']) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.ComboBox_DAT_VITS_SampleRate, - Section = 'VITS', + Section = 'VITS Params', Option = 'SampleRate', DefaultValue = 22050 ) @@ -3918,7 +3911,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): self.ui.ComboBox_DAT_VITS_SampleWidth.addItems(['8', '16', '24', '32', '32 (Float)', 'None']) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.ComboBox_DAT_VITS_SampleWidth, - Section = 'VITS', + Section = 'VITS Params', Option = 'SampleWidth', DefaultValue = 16 ) @@ -3936,7 +3929,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): ) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.CheckBox_DAT_VITS_ToMono, - Section = 'VITS', + Section = 'VITS Params', Option = 'ToMono', DefaultValue = True ) @@ -3967,7 +3960,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): DAT_VITS_OutputDirName_Default = str(date.today()) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_OutputDirName, - Section = 'VITS', + Section = 'Output Params', Option = 'Output_Dir_Name', DefaultValue = '', SetPlaceholderText = True, @@ -3993,7 +3986,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): DAT_VITS_FileListNameTraining_Default = "Train_" + str(date.today()) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_FileListNameTraining, - Section = 'VITS', + Section = 'Output Params', Option = 'FileList_Name_Training', DefaultValue = DAT_VITS_FileListNameTraining_Default, SetPlaceholderText = True, @@ -4016,7 +4009,7 @@ def SetText_LineEdit_DAT_GPTSoVITS_FileListPath(): DAT_VITS_FileListNameValidation_Default = "Val_" + str(date.today()) ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_FileListNameValidation, - Section = 'VITS', + Section = 'Output Params', Option = 'FileList_Name_Validation', DefaultValue = DAT_VITS_FileListNameValidation_Default, SetPlaceholderText = True, @@ -4040,10 +4033,8 @@ def SetText_LineEdit_DAT_VITS_OutputDir(): LineEdit_DAT_VITS_OutputDir.setText(DirText) Alert = Path(DirText).exists() and list(Path(DirText).iterdir()) != [] self.ui.LineEdit_DAT_VITS_OutputDirName.Alert(True if Alert else False, "注意:目录已包含文件") - self.ui.LineEdit_DAT_VITS_OutputDirName.textChanged.connect(SetText_LineEdit_DAT_VITS_OutputDir) - self.ui.LineEdit_DAT_VITS_OutputDirName.focusedOut.connect(SetText_LineEdit_DAT_VITS_OutputDir) - self.ui.LineEdit_DAT_VITS_OutputRoot.textChanged.connect(SetText_LineEdit_DAT_VITS_OutputDir) - self.ui.LineEdit_DAT_VITS_OutputRoot.focusedOut.connect(SetText_LineEdit_DAT_VITS_OutputDir) + self.ui.LineEdit_DAT_VITS_OutputDirName.interacted.connect(SetText_LineEdit_DAT_VITS_OutputDir) + self.ui.LineEdit_DAT_VITS_OutputRoot.interacted.connect(SetText_LineEdit_DAT_VITS_OutputDir) #SetText_LineEdit_DAT_VITS_OutputDir() LineEdit_DAT_VITS_FileListPathTraining = QLineEdit() @@ -4056,8 +4047,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathTraining(): LineEdit_DAT_VITS_FileListPathTraining.setText(PathText) Alert = Path(PathText).exists() self.ui.LineEdit_DAT_VITS_FileListNameTraining.Alert(True if Alert else False, "注意:路径已存在") - self.ui.LineEdit_DAT_VITS_FileListNameTraining.textChanged.connect(SetText_LineEdit_DAT_VITS_FileListPathTraining) - self.ui.LineEdit_DAT_VITS_FileListNameTraining.focusedOut.connect(SetText_LineEdit_DAT_VITS_FileListPathTraining) + self.ui.LineEdit_DAT_VITS_FileListNameTraining.interacted.connect(SetText_LineEdit_DAT_VITS_FileListPathTraining) LineEdit_DAT_VITS_OutputDir.textChanged.connect(SetText_LineEdit_DAT_VITS_FileListPathTraining) #SetText_LineEdit_DAT_VITS_FileListPathTraining() @@ -4071,8 +4061,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): LineEdit_DAT_VITS_FileListPathValidation.setText(PathText) Alert = Path(PathText).exists() self.ui.LineEdit_DAT_VITS_FileListNameValidation.Alert(True if Alert else False, "注意:路径已存在") - self.ui.LineEdit_DAT_VITS_FileListNameValidation.textChanged.connect(SetText_LineEdit_DAT_VITS_FileListPathValidation) - self.ui.LineEdit_DAT_VITS_FileListNameValidation.focusedOut.connect(SetText_LineEdit_DAT_VITS_FileListPathValidation) + self.ui.LineEdit_DAT_VITS_FileListNameValidation.interacted.connect(SetText_LineEdit_DAT_VITS_FileListPathValidation) LineEdit_DAT_VITS_OutputDir.textChanged.connect(SetText_LineEdit_DAT_VITS_FileListPathValidation) #SetText_LineEdit_DAT_VITS_FileListPathValidation() @@ -4329,7 +4318,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): ) ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_FileListPath, - Section = 'GPT-SoVITS', + Section = 'Input Params', Option = 'FileList_Path', DefaultValue = '', SetPlaceholderText = True @@ -4359,7 +4348,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): self.ui.SpinBox_Train_GPTSoVITS_S1Epochs.setSingleStep(1) ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.SpinBox_Train_GPTSoVITS_S1Epochs, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Epochs', DefaultValue = 8 ) @@ -4379,7 +4368,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): self.ui.SpinBox_Train_GPTSoVITS_S2Epochs.setSingleStep(1) ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.SpinBox_Train_GPTSoVITS_S2Epochs, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Epochs', DefaultValue = 15 ) @@ -4399,7 +4388,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): Train_GPTSoVITS_ModelPathPretrainedS1_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 's1&s2', 's1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt').as_posix() ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_ModelPathPretrainedS1, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Model_Path_Pretrained_s1', DefaultValue = Train_GPTSoVITS_ModelPathPretrainedS1_Default, SetPlaceholderText = True, @@ -4426,7 +4415,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): Train_GPTSoVITS_ModelPathPretrainedS2G_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 's1&s2', 's2G488k.pth').as_posix() ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_ModelPathPretrainedS2G, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Model_Path_Pretrained_s2G', DefaultValue = Train_GPTSoVITS_ModelPathPretrainedS2G_Default, SetPlaceholderText = True, @@ -4453,7 +4442,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): Train_GPTSoVITS_ModelPathPretrainedS2D_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 's1&s2', 's2D488k.pth').as_posix() ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_ModelPathPretrainedS2D, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Model_Path_Pretrained_s2D', DefaultValue = Train_GPTSoVITS_ModelPathPretrainedS2D_Default, SetPlaceholderText = True, @@ -4480,7 +4469,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): Train_GPTSoVITS_ModelDirPretrainedBert_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 'chinese-roberta-wwm-ext-large').as_posix() ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_ModelDirPretrainedBert, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Model_Dir_Pretrained_bert', DefaultValue = Train_GPTSoVITS_ModelDirPretrainedBert_Default, SetPlaceholderText = True, @@ -4506,7 +4495,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): Train_GPTSoVITS_ModelDirPretrainedSSL_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 'chinese-hubert-base').as_posix() ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_ModelDirPretrainedSSL, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'Model_Dir_Pretrained_ssl', DefaultValue = Train_GPTSoVITS_ModelDirPretrainedSSL_Default, SetPlaceholderText = True, @@ -4534,7 +4523,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): ) ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.CheckBox_Train_GPTSoVITS_FP16Run, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'FP16_Run', DefaultValue = False ) @@ -4565,7 +4554,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): Train_GPTSoVITS_OutputDirName_Default = str(date.today()) ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_OutputDirName, - Section = 'GPT-SoVITS', + Section = 'Output Params', Option = 'Output_Dir_Name', DefaultValue = '', SetPlaceholderText = True, @@ -4591,7 +4580,7 @@ def SetText_LineEdit_DAT_VITS_FileListPathValidation(): Train_GPTSoVITS_LogDir_Default = Path(Path(CurrentDir).root).joinpath('EVT_TrainLog', 'GPT-SoVITS', str(date.today())).as_posix() ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_LogDir, - Section = 'GPT-SoVITS', + Section = 'Output Params', Option = 'Output_LogDir', DefaultValue = Train_GPTSoVITS_LogDir_Default, SetPlaceholderText = True, @@ -4628,10 +4617,8 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): LineEdit_Train_GPTSoVITS_OutputDir.setText(DirText) Alert = Path(DirText).exists() and list(Path(DirText).iterdir()) != [] self.ui.LineEdit_Train_GPTSoVITS_OutputDirName.Alert(True if Alert else False, "注意:目录已包含文件") - self.ui.LineEdit_Train_GPTSoVITS_OutputDirName.textChanged.connect(SetText_LineEdit_Train_GPTSoVITS_OutputDir) - self.ui.LineEdit_Train_GPTSoVITS_OutputDirName.focusedOut.connect(SetText_LineEdit_Train_GPTSoVITS_OutputDir) - self.ui.LineEdit_Train_GPTSoVITS_OutputRoot.textChanged.connect(SetText_LineEdit_Train_GPTSoVITS_OutputDir) - self.ui.LineEdit_Train_GPTSoVITS_OutputRoot.focusedOut.connect(SetText_LineEdit_Train_GPTSoVITS_OutputDir) + self.ui.LineEdit_Train_GPTSoVITS_OutputDirName.interacted.connect(SetText_LineEdit_Train_GPTSoVITS_OutputDir) + self.ui.LineEdit_Train_GPTSoVITS_OutputRoot.interacted.connect(SetText_LineEdit_Train_GPTSoVITS_OutputDir) #SetText_LineEdit_Train_GPTSoVITS_OutputDir() # GPTSo-VITS - Left @@ -4811,7 +4798,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): ) ParamsManager_Train_VITS.SetParam( Widget = self.ui.LineEdit_Train_VITS_FileListPathTraining, - Section = 'VITS', + Section = 'Input Params', Option = 'FileList_Path_Training', DefaultValue = '', SetPlaceholderText = True @@ -4836,7 +4823,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): ) ParamsManager_Train_VITS.SetParam( Widget = self.ui.LineEdit_Train_VITS_FileListPathValidation, - Section = 'VITS', + Section = 'Input Params', Option = 'FileList_Path_Validation', DefaultValue = '', SetPlaceholderText = True @@ -4853,42 +4840,6 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): } ) - Function_SetText( - Widget = self.ui.Label_Train_VITS_LogDir, - Text = SetRichText( - Body = QCA.translate("Label", "日志输出目录\n训练时生成的日志的存放目录。") - ) - ) - Train_VITS_LogDir_Default = Path(Path(CurrentDir).root).joinpath('EVT_TrainLog', 'VITS', str(date.today())).as_posix() - ParamsManager_Train_VITS.SetParam( - Widget = self.ui.LineEdit_Train_VITS_LogDir, - Section = 'VITS', - Option = 'Output_LogDir', - DefaultValue = Train_VITS_LogDir_Default, - SetPlaceholderText = True, - PlaceholderText = Train_VITS_LogDir_Default - ) - self.ui.LineEdit_Train_VITS_LogDir.textChanged.connect( - lambda Value: ( - Function_ShowMessageBox(self, - MessageType = QMessageBox.Warning, - WindowTitle = "Warning", - Text = "保存路径不支持非ASCII字符,请使用英文路径以避免训练报错", - ), - self.ui.LineEdit_Train_VITS_LogDir.clear() - ) if not all(Char.isascii() for Char in Value) else None - ) - self.ui.LineEdit_Train_VITS_LogDir.SetFileDialog( - Mode = "SelectFolder", - Directory = NormPath(Path(Train_VITS_LogDir_Default).parent) - ) - self.ui.Button_Train_VITS_LogDir_MoreActions.SetMenu( - ActionEvents = { - "重置": lambda: ParamsManager_Train_VITS.ResetParam(self.ui.LineEdit_Train_VITS_LogDir), - "复制": lambda: self.Clipboard.setText(self.ui.LineEdit_Train_VITS_LogDir.text()) - } - ) - self.ui.GroupBox_Train_VITS_VITSParams.setTitle(QCA.translate("GroupBox", "训练参数")) Function_SetText( @@ -4901,7 +4852,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): self.ui.SpinBox_Train_VITS_Epochs.setSingleStep(1) ParamsManager_Train_VITS.SetParam( Widget = self.ui.SpinBox_Train_VITS_Epochs, - Section = 'VITS', + Section = 'VITS Params', Option = 'Epochs', DefaultValue = 1000 ) @@ -4921,7 +4872,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): self.ui.SpinBox_Train_VITS_BatchSize.setSingleStep(1) ParamsManager_Train_VITS.SetParam( Widget = self.ui.SpinBox_Train_VITS_BatchSize, - Section = 'VITS', + Section = 'VITS Params', Option = 'Batch_Size', DefaultValue = 4 ) @@ -4940,7 +4891,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): ) ParamsManager_Train_VITS.SetParam( Widget = self.ui.CheckBox_Train_VITS_UsePretrainedModels, - Section = 'VITS', + Section = 'VITS Params', Option = 'Use_PretrainedModels', DefaultValue = True ) @@ -4989,7 +4940,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): Train_VITS_ModelPathPretrainedG_Default = Path(ModelsDir).joinpath('TTS', 'VITS', 'Downloaded', 'standard_G.pth').as_posix() ParamsManager_Train_VITS.SetParam( Widget = self.ui.LineEdit_Train_VITS_ModelPathPretrainedG, - Section = 'VITS', + Section = 'VITS Params', Option = 'Model_Path_Pretrained_G', DefaultValue = Train_VITS_ModelPathPretrainedG_Default, SetPlaceholderText = True, @@ -5016,7 +4967,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): Train_VITS_ModelPathPretrainedD_Default = Path(ModelsDir).joinpath('TTS', 'VITS', 'Downloaded', 'standard_D.pth').as_posix() ParamsManager_Train_VITS.SetParam( Widget = self.ui.LineEdit_Train_VITS_ModelPathPretrainedD, - Section = 'VITS', + Section = 'VITS Params', Option = 'Model_Path_Pretrained_D', DefaultValue = Train_VITS_ModelPathPretrainedD_Default, SetPlaceholderText = True, @@ -5076,7 +5027,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): ) ParamsManager_Train_VITS.SetParam( Widget = self.ui.CheckBox_Train_VITS_KeepOriginalSpeakers, - Section = 'VITS', + Section = 'VITS Params', Option = 'Keep_Original_Speakers', DefaultValue = False ) @@ -5126,7 +5077,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): Train_VITS_ConfigPathLoad_Default = Path(ModelsDir).joinpath('TTS', 'VITS', 'Downloaded', 'standard_Config.json').as_posix() ParamsManager_Train_VITS.SetParam( Widget = self.ui.LineEdit_Train_VITS_ConfigPathLoad, - Section = 'VITS', + Section = 'VITS Params', Option = 'Config_Path_Load', DefaultValue = Train_VITS_ConfigPathLoad_Default, SetPlaceholderText = True, @@ -5161,7 +5112,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): self.ui.SpinBox_Train_VITS_NumWorkers.setSingleStep(2) ParamsManager_Train_VITS.SetParam( Widget = self.ui.SpinBox_Train_VITS_NumWorkers, - Section = 'VITS', + Section = 'VITS Params', Option = 'Num_Workers', DefaultValue = 4 ) @@ -5179,7 +5130,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): ) ParamsManager_Train_VITS.SetParam( Widget = self.ui.CheckBox_Train_VITS_FP16Run, - Section = 'VITS', + Section = 'VITS Params', Option = 'FP16_Run', DefaultValue = False ) @@ -5211,7 +5162,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): self.ui.SpinBox_Train_VITS_EvalInterval.setSingleStep(1) ParamsManager_Train_VITS.SetParam( Widget = self.ui.SpinBox_Train_VITS_EvalInterval, - Section = 'VITS', + Section = 'Output Params', Option = 'Eval_Interval', DefaultValue = 1000 ) @@ -5234,7 +5185,7 @@ def SetText_LineEdit_Train_GPTSoVITS_OutputDir(): Train_VITS_OutputDirName_Default = str(date.today()) ParamsManager_Train_VITS.SetParam( Widget = self.ui.LineEdit_Train_VITS_OutputDirName, - Section = 'VITS', + Section = 'Output Params', Option = 'Output_Dir_Name', DefaultValue = '', SetPlaceholderText = True, @@ -5258,12 +5209,46 @@ def SetText_LineEdit_Train_VITS_OutputDir(): LineEdit_Train_VITS_OutputDir.setText(DirText) Alert = Path(DirText).exists() and list(Path(DirText).iterdir()) != [] self.ui.LineEdit_Train_VITS_OutputDirName.Alert(True if Alert else False, "注意:目录已包含文件") - self.ui.LineEdit_Train_VITS_OutputDirName.textChanged.connect(SetText_LineEdit_Train_VITS_OutputDir) - self.ui.LineEdit_Train_VITS_OutputDirName.focusedOut.connect(SetText_LineEdit_Train_VITS_OutputDir) - self.ui.LineEdit_Train_VITS_OutputRoot.textChanged.connect(SetText_LineEdit_Train_VITS_OutputDir) - self.ui.LineEdit_Train_VITS_OutputRoot.focusedOut.connect(SetText_LineEdit_Train_VITS_OutputDir) + self.ui.LineEdit_Train_VITS_OutputDirName.interacted.connect(SetText_LineEdit_Train_VITS_OutputDir) + self.ui.LineEdit_Train_VITS_OutputRoot.interacted.connect(SetText_LineEdit_Train_VITS_OutputDir) #SetText_LineEdit_Train_VITS_OutputDir() + Function_SetText( + Widget = self.ui.Label_Train_VITS_LogDir, + Text = SetRichText( + Body = QCA.translate("Label", "日志输出目录\n训练时生成的日志的存放目录。") + ) + ) + Train_VITS_LogDir_Default = Path(Path(CurrentDir).root).joinpath('EVT_TrainLog', 'VITS', str(date.today())).as_posix() + ParamsManager_Train_VITS.SetParam( + Widget = self.ui.LineEdit_Train_VITS_LogDir, + Section = 'Output Params', + Option = 'Output_LogDir', + DefaultValue = Train_VITS_LogDir_Default, + SetPlaceholderText = True, + PlaceholderText = Train_VITS_LogDir_Default + ) + self.ui.LineEdit_Train_VITS_LogDir.textChanged.connect( + lambda Value: ( + Function_ShowMessageBox(self, + MessageType = QMessageBox.Warning, + WindowTitle = "Warning", + Text = "保存路径不支持非ASCII字符,请使用英文路径以避免训练报错", + ), + self.ui.LineEdit_Train_VITS_LogDir.clear() + ) if not all(Char.isascii() for Char in Value) else None + ) + self.ui.LineEdit_Train_VITS_LogDir.SetFileDialog( + Mode = "SelectFolder", + Directory = NormPath(Path(Train_VITS_LogDir_Default).parent) + ) + self.ui.Button_Train_VITS_LogDir_MoreActions.SetMenu( + ActionEvents = { + "重置": lambda: ParamsManager_Train_VITS.ResetParam(self.ui.LineEdit_Train_VITS_LogDir), + "复制": lambda: self.Clipboard.setText(self.ui.LineEdit_Train_VITS_LogDir.text()) + } + ) + # VITS - Left Function_SetTreeWidget( TreeWidget = self.ui.TreeWidget_Catalogue_Train_VITS, @@ -5473,7 +5458,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): TTS_GPTSoVITS_ModelPathLoadS1_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 's1&s2', 's1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt').as_posix() ParamsManager_TTS_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_TTS_GPTSoVITS_ModelPathLoadS1, - Section = 'GPT-SoVITS', + Section = 'Input Params', Option = 'Model_Path_Load_s1', DefaultValue = TTS_GPTSoVITS_ModelPathLoadS1_Default, SetPlaceholderText = True, @@ -5500,7 +5485,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): TTS_GPTSoVITS_ModelPathLoadS2G_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 's1&s2', 's2G488k.pth').as_posix() ParamsManager_TTS_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_TTS_GPTSoVITS_ModelPathLoadS2G, - Section = 'GPT-SoVITS', + Section = 'Input Params', Option = 'Model_Path_Load_s2G', DefaultValue = TTS_GPTSoVITS_ModelPathLoadS2G_Default, SetPlaceholderText = True, @@ -5527,7 +5512,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): TTS_GPTSoVITS_ModelDirLoadBert_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 'chinese-roberta-wwm-ext-large').as_posix() ParamsManager_TTS_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_TTS_GPTSoVITS_ModelDirLoadBert, - Section = 'GPT-SoVITS', + Section = 'Input Params', Option = 'Model_Dir_Load_bert', DefaultValue = TTS_GPTSoVITS_ModelDirLoadBert_Default, SetPlaceholderText = True, @@ -5553,7 +5538,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): TTS_GPTSoVITS_ModelDirLoadSSL_Default = Path(ModelsDir).joinpath('TTS', 'GPT-SoVITS', 'Downloaded', 'chinese-hubert-base').as_posix() ParamsManager_TTS_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_TTS_GPTSoVITS_ModelDirLoadSSL, - Section = 'GPT-SoVITS', + Section = 'Input Params', Option = 'Model_Dir_Load_ssl', DefaultValue = TTS_GPTSoVITS_ModelDirLoadSSL_Default, SetPlaceholderText = True, @@ -5580,7 +5565,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): ) ParamsManager_TTS_GPTSoVITS.SetParam( Widget = self.ui.CheckBox_TTS_GPTSoVITS_FP16Run, - Section = 'GPT-SoVITS', + Section = 'GPT-SoVITS Params', Option = 'FP16_Run', DefaultValue = False ) @@ -5609,6 +5594,31 @@ def SetText_LineEdit_Train_VITS_OutputDir(): ) ) + self.ui.Button_ResetSettings_TTS_GPTSoVITS.setText(QCA.translate("Button", "全部重置")) + self.ui.Button_ResetSettings_TTS_GPTSoVITS.clicked.connect( + lambda: ParamsManager_TTS_GPTSoVITS.ResetSettings() + ) + + self.ui.Button_ImportSettings_TTS_GPTSoVITS.setText(QCA.translate("Button", "导入配置")) + self.ui.Button_ImportSettings_TTS_GPTSoVITS.clicked.connect( + lambda: ParamsManager_TTS_GPTSoVITS.ImportSettings( + Function_GetFileDialog( + Mode = "SelectFile", + FileType = "ini类型 (*.ini)" + ) + ) + ) + + self.ui.Button_ExportSettings_TTS_GPTSoVITS.setText(QCA.translate("Button", "导出配置")) + self.ui.Button_ExportSettings_TTS_GPTSoVITS.clicked.connect( + lambda: ParamsManager_TTS_GPTSoVITS.ExportSettings( + Function_GetFileDialog( + Mode = "SaveFile", + FileType = "ini类型 (*.ini)" + ) + ) + ) + ''' self.ui.Button_CheckOutput_TTS_GPTSoVITS.setText(QCA.translate("Button", "查看输出文件")) Function_SetURL( @@ -5699,7 +5709,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): TTS_VITS_ConfigPathLoad_Default = Path(ModelsDir).joinpath('TTS', 'VITS', 'Downloaded', 'standard_Config.json').as_posix() ParamsManager_TTS_VITS.SetParam( Widget = self.ui.LineEdit_TTS_VITS_ConfigPathLoad, - Section = 'VITS', + Section = 'Input Params', Option = 'Config_Path_Load', DefaultValue = '', SetPlaceholderText = True, @@ -5732,7 +5742,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): TTS_VITS_ModelPathLoad_Default = Path(ModelsDir).joinpath('TTS', 'VITS', 'Downloaded', 'standard_G.pth').as_posix() ParamsManager_TTS_VITS.SetParam( Widget = self.ui.LineEdit_TTS_VITS_ModelPathLoad, - Section = 'VITS', + Section = 'Input Params', Option = 'Model_Path_Load', DefaultValue = '', SetPlaceholderText = True, @@ -5760,7 +5770,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): ) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.PlainTextEdit_TTS_VITS_Text, - Section = 'VITS', + Section = 'VITS Params', Option = 'Text', DefaultValue = '', SetPlaceholderText = True, @@ -5776,7 +5786,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): self.ui.ComboBox_TTS_VITS_Language.addItems(['None', QCA.translate("ComboBox", '中'), QCA.translate("ComboBox", '英'), QCA.translate("ComboBox", '日')]) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.ComboBox_TTS_VITS_Language, - Section = 'VITS', + Section = 'VITS Params', Option = 'Language', DefaultValue = None ) @@ -5798,7 +5808,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): ''' ParamsManager_TTS_VITS.SetParam( Widget = self.ui.ComboBox_TTS_VITS_Speaker, - Section = 'VITS', + Section = 'VITS Params', Option = 'Speaker', DefaultValue = '' ) @@ -5819,7 +5829,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): self.ui.HorizontalSlider_TTS_VITS_EmotionStrength.setTickInterval(1) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.HorizontalSlider_TTS_VITS_EmotionStrength, - Section = 'VITS', + Section = 'VITS Params', Option = 'EmotionStrength', DefaultValue = 0.67, Times = 100 @@ -5835,7 +5845,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): self.ui.DoubleSpinBox_TTS_VITS_EmotionStrength.setSingleStep(0.01) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.DoubleSpinBox_TTS_VITS_EmotionStrength, - Section = 'VITS', + Section = 'VITS Params', Option = 'EmotionStrength', DefaultValue = 0.67 ) @@ -5863,7 +5873,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): self.ui.HorizontalSlider_TTS_VITS_PhonemeDuration.setTickInterval(1) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.HorizontalSlider_TTS_VITS_PhonemeDuration, - Section = 'VITS', + Section = 'VITS Params', Option = 'PhonemeDuration', DefaultValue = 0.8, Times = 10 @@ -5879,7 +5889,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): self.ui.DoubleSpinBox_TTS_VITS_PhonemeDuration.setSingleStep(0.1) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.DoubleSpinBox_TTS_VITS_PhonemeDuration, - Section = 'VITS', + Section = 'VITS Params', Option = 'PhonemeDuration', DefaultValue = 0.8 ) @@ -5907,7 +5917,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): self.ui.HorizontalSlider_TTS_VITS_SpeechRate.setTickInterval(1) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.HorizontalSlider_TTS_VITS_SpeechRate, - Section = 'VITS', + Section = 'VITS Params', Option = 'SpeechRate', DefaultValue = 1., Times = 10 @@ -5923,7 +5933,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): self.ui.DoubleSpinBox_TTS_VITS_SpeechRate.setSingleStep(0.1) ParamsManager_TTS_VITS.SetParam( Widget = self.ui.DoubleSpinBox_TTS_VITS_SpeechRate, - Section = 'VITS', + Section = 'VITS Params', Option = 'SpeechRate', DefaultValue = 1. ) @@ -5951,7 +5961,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): TTS_VITS_AudioPathSave_Default = Path(CurrentDir).joinpath('语音合成结果', 'VITS', f"{date.today()}.wav").as_posix() ParamsManager_TTS_VITS.SetParam( Widget = self.ui.LineEdit_TTS_VITS_AudioPathSave, - Section = 'VITS', + Section = 'Output Params', Option = 'Audio_Path_Save', DefaultValue = '', SetPlaceholderText = True, @@ -6030,7 +6040,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): ) ) - # Right + # VITS - Right MonitorFile_Config_VoiceConverter_VITS = MonitorFile(Path_Config_TTS_VITS) MonitorFile_Config_VoiceConverter_VITS.start() MonitorFile_Config_VoiceConverter_VITS.Signal_FileContent.connect( @@ -6268,13 +6278,102 @@ def SetText_LineEdit_Train_VITS_OutputDir(): ) ) + self.ui.GroupBox_Settings_Tools_Function.setTitle(QCA.translate("GroupBox", "功能设置")) + + self.ui.Label_Setting_AutoReset.setText(QCA.translate("Label", "启动时重置所有工具的参数设置")) + self.ui.CheckBox_Setting_AutoReset.setChecked( + { + 'Enabled': True, + 'Disabled': False + }.get(Config.GetValue('Tools', 'AutoReset', 'Enabled')) + ) + Function_ConfigureCheckBox( + CheckBox = self.ui.CheckBox_Setting_AutoReset, + CheckedText = "已启用", + CheckedEvents = [ + lambda: Config.EditConfig('Tools', 'AutoReset', 'Enabled'), + lambda: MainWindowSignals.Signal_MainWindowShown.connect( + lambda: ( + ParamsManager_Process.ResetSettings(), + ParamsManager_ASR_VPR.ResetSettings(), + ParamsManager_STT_Whisper.ResetSettings(), + ParamsManager_DAT_GPTSoVITS.ResetSettings(), + ParamsManager_DAT_VITS.ResetSettings(), + ParamsManager_Train_GPTSoVITS.ResetSettings(), + ParamsManager_Train_VITS.ResetSettings(), + ParamsManager_TTS_GPTSoVITS.ResetSettings(), + ParamsManager_TTS_VITS.ResetSettings() + ) + ) + ], + UncheckedText = "未启用", + UncheckedEvents = [ + lambda: Config.EditConfig('Tools', 'AutoReset', 'Disabled'), + ], + TakeEffect = True + ) + + self.ui.Label_Setting_Synchronizer.setText(QCA.translate("Label", "自动关联前后工具的部分参数设置")) + self.ui.CheckBox_Setting_Synchronizer.setChecked( + { + 'Enabled': True, + 'Disabled': False + }.get(Config.GetValue('Tools', 'Synchronizer', 'Enabled')) + ) + Function_ConfigureCheckBox( + CheckBox = self.ui.CheckBox_Setting_Synchronizer, + CheckedText = "已启用", + CheckedEvents = [ + lambda: Config.EditConfig('Tools', 'Synchronizer', 'Enabled'), + lambda: Function_ParamsSynchronizer( + LineEdit_Process_OutputDir, + {LineEdit_Process_OutputDir: self.ui.LineEdit_ASR_VPR_AudioDirInput} + ), + lambda: Function_ParamsSynchronizer( + LineEdit_ASR_VPR_AudioSpeakersDataPath, + {LineEdit_ASR_VPR_AudioSpeakersDataPath: [self.ui.LineEdit_DAT_GPTSoVITS_AudioSpeakersDataPath, self.ui.LineEdit_DAT_VITS_AudioSpeakersDataPath]} + ), + lambda: Function_ParamsSynchronizer( + ChildWindow_ASR.ui.LineEdit, + {ChildWindow_ASR.ui.LineEdit: self.ui.LineEdit_STT_Whisper_AudioDir} + ), + lambda: Function_ParamsSynchronizer( + LineEdit_STT_Whisper_OutputDir, + {LineEdit_STT_Whisper_OutputDir: [self.ui.LineEdit_DAT_GPTSoVITS_SRTDir, self.ui.LineEdit_DAT_VITS_SRTDir]} + ), + lambda: Function_ParamsSynchronizer( + LineEdit_DAT_GPTSoVITS_FileListPath, + {LineEdit_DAT_GPTSoVITS_FileListPath: self.ui.LineEdit_Train_GPTSoVITS_FileListPath} + ), + lambda: Function_ParamsSynchronizer( + [LineEdit_DAT_VITS_FileListPathTraining, LineEdit_DAT_VITS_FileListPathValidation], + {LineEdit_DAT_VITS_FileListPathTraining: self.ui.LineEdit_Train_VITS_FileListPathTraining, LineEdit_DAT_VITS_FileListPathValidation: self.ui.LineEdit_Train_VITS_FileListPathValidation} + ) + ], + UncheckedText = "未启用", + UncheckedEvents = [ + lambda: Config.EditConfig('Tools', 'Synchronizer', 'Disabled'), + ], + TakeEffect = True + ) + Function_ConfigureCheckBox( + CheckBox = self.ui.CheckBox_Setting_Synchronizer, + UncheckedEvents = [ + lambda: Function_ShowMessageBox(self, + QMessageBox.Information, "Tip", + "该设置将于重启之后生效" + ) + ], + TakeEffect = False + ) + self.ui.GroupBox_Settings_Tools_Path.setTitle(QCA.translate("GroupBox", "路径设置")) self.ui.Label_Process_OutputRoot.setText(QCA.translate("Label", "音频处理输出目录")) Process_OutputRoot_Default = Path(CurrentDir).joinpath('音频处理结果').as_posix() ParamsManager_Process.SetParam( Widget = self.ui.LineEdit_Process_OutputRoot, - Section = 'AudioProcessor', + Section = 'Output Params', Option = 'Output_Root', DefaultValue = Process_OutputRoot_Default, SetPlaceholderText = True, @@ -6294,7 +6393,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): ASR_VPR_AudioSpeakersDataRoot_Default = Path(CurrentDir).joinpath('语音识别结果', 'VPR').as_posix() ParamsManager_ASR_VPR.SetParam( Widget = self.ui.LineEdit_ASR_VPR_OutputRoot, - Section = 'VPR', + Section = 'Output Params', Option = 'Audio_Root_Output', DefaultValue = ASR_VPR_AudioSpeakersDataRoot_Default, SetPlaceholderText = True, @@ -6315,7 +6414,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): STT_Whisper_OutputRoot_Default = Path(CurrentDir).joinpath('语音转录结果', 'Whisper').as_posix() ParamsManager_STT_Whisper.SetParam( Widget = self.ui.LineEdit_STT_Whisper_OutputRoot, - Section = 'Whisper', + Section = 'Output Params', Option = 'Output_Root', DefaultValue = STT_Whisper_OutputRoot_Default, SetPlaceholderText = True, @@ -6336,7 +6435,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): DAT_GPTSoVITS_OutputRoot_Default = Path(CurrentDir).joinpath('数据集制作结果', 'GPT-SoVITS').as_posix() ParamsManager_DAT_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_DAT_GPTSoVITS_OutputRoot, - Section = 'GPT-SoVITS', + Section = 'Output Params', Option = 'Output_Root', DefaultValue = DAT_GPTSoVITS_OutputRoot_Default, SetPlaceholderText = True, @@ -6357,7 +6456,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): DAT_VITS_OutputRoot_Default = Path(CurrentDir).joinpath('数据集制作结果', 'VITS').as_posix() ParamsManager_DAT_VITS.SetParam( Widget = self.ui.LineEdit_DAT_VITS_OutputRoot, - Section = 'VITS', + Section = 'Output Params', Option = 'Output_Root', DefaultValue = DAT_VITS_OutputRoot_Default, SetPlaceholderText = True, @@ -6378,7 +6477,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): Train_GPTSoVITS_OutputRoot_Default = Path(CurrentDir).joinpath('模型训练结果', 'GPT-SoVITS').as_posix() ParamsManager_Train_GPTSoVITS.SetParam( Widget = self.ui.LineEdit_Train_GPTSoVITS_OutputRoot, - Section = 'GPT-SoVITS', + Section = 'Output Params', Option = 'Output_Root', DefaultValue = Train_GPTSoVITS_OutputRoot_Default, SetPlaceholderText = True, @@ -6399,7 +6498,7 @@ def SetText_LineEdit_Train_VITS_OutputDir(): Train_VITS_OutputRoot_Default = Path(CurrentDir).joinpath('模型训练结果', 'VITS').as_posix() ParamsManager_Train_VITS.SetParam( Widget = self.ui.LineEdit_Train_VITS_OutputRoot, - Section = 'VITS', + Section = 'Output Params', Option = 'Output_Root', DefaultValue = Train_VITS_OutputRoot_Default, SetPlaceholderText = True, @@ -6416,62 +6515,6 @@ def SetText_LineEdit_Train_VITS_OutputDir(): } ) - self.ui.GroupBox_Settings_Tools_Function.setTitle(QCA.translate("GroupBox", "功能设置")) - - self.ui.Label_Setting_Synchronizer.setText(QCA.translate("Label", "自动关联前后工具的部分参数设置")) - self.ui.CheckBox_Setting_Synchronizer.setChecked( - { - 'Enabled': True, - 'Disabled': False - }.get(Config.GetValue('Tools', 'Synchronizer', 'Enabled')) - ) - Function_ConfigureCheckBox( - CheckBox = self.ui.CheckBox_Setting_Synchronizer, - CheckedText = "已启用", - CheckedEvents = [ - lambda: Config.EditConfig('Tools', 'Synchronizer', 'Enabled'), - lambda: Function_ParamsSynchronizer( - LineEdit_Process_OutputDir, - {LineEdit_Process_OutputDir: self.ui.LineEdit_ASR_VPR_AudioDirInput} - ), - lambda: Function_ParamsSynchronizer( - LineEdit_ASR_VPR_AudioSpeakersDataPath, - {LineEdit_ASR_VPR_AudioSpeakersDataPath: [self.ui.LineEdit_DAT_GPTSoVITS_AudioSpeakersDataPath, self.ui.LineEdit_DAT_VITS_AudioSpeakersDataPath]} - ), - lambda: Function_ParamsSynchronizer( - ChildWindow_ASR.ui.LineEdit, - {ChildWindow_ASR.ui.LineEdit: self.ui.LineEdit_STT_Whisper_AudioDir} - ), - lambda: Function_ParamsSynchronizer( - LineEdit_STT_Whisper_OutputDir, - {LineEdit_STT_Whisper_OutputDir: [self.ui.LineEdit_DAT_GPTSoVITS_SRTDir, self.ui.LineEdit_DAT_VITS_SRTDir]} - ), - lambda: Function_ParamsSynchronizer( - LineEdit_DAT_GPTSoVITS_FileListPath, - {LineEdit_DAT_GPTSoVITS_FileListPath: self.ui.LineEdit_Train_GPTSoVITS_FileListPath} - ), - lambda: Function_ParamsSynchronizer( - [LineEdit_DAT_VITS_FileListPathTraining, LineEdit_DAT_VITS_FileListPathValidation], - {LineEdit_DAT_VITS_FileListPathTraining: self.ui.LineEdit_Train_VITS_FileListPathTraining, LineEdit_DAT_VITS_FileListPathValidation: self.ui.LineEdit_Train_VITS_FileListPathValidation} - ) - ], - UncheckedText = "未启用", - UncheckedEvents = [ - lambda: Config.EditConfig('Tools', 'Synchronizer', 'Disabled'), - ], - TakeEffect = True - ) - Function_ConfigureCheckBox( - CheckBox = self.ui.CheckBox_Setting_Synchronizer, - UncheckedEvents = [ - lambda: Function_ShowMessageBox(self, - QMessageBox.Information, "Tip", - "该设置将于重启之后生效" - ) - ], - TakeEffect = False - ) - ############################################################# ####################### Content: Info ####################### ############################################################# @@ -6562,13 +6605,9 @@ def SetText_LineEdit_Train_VITS_OutputDir(): # Display Usage self.MonitorUsage.Signal_UsageInfo.connect( - lambda Usage_CPU, Usage_GPU: self.ui.Label_Usage_CPU.setText( - f"CPU: {Usage_CPU}" - ) - ) - self.MonitorUsage.Signal_UsageInfo.connect( - lambda Usage_CPU, Usage_GPU: self.ui.Label_Usage_GPU.setText( - f"GPU: {Usage_GPU}" + lambda Usage_CPU, Usage_GPU: ( + self.ui.Label_Usage_CPU.setText(f"CPU: {Usage_CPU}"), + self.ui.Label_Usage_GPU.setText(f"GPU: {Usage_GPU}") ) ) diff --git a/manifest.json b/manifest.json index 10f038d..4d77595 100644 --- a/manifest.json +++ b/manifest.json @@ -50,7 +50,7 @@ "ASR", "VPR" ], - "name": "Ecapa-Tdnn_spectrogram", + "name": "Ecapa-Tdnn_spectrogram.pth", "size": "35.0MB", "date": "2022-08-11 08:03:36", "SHA": "a7c689599e616f03a339bfd11a27ae7cf7a975ac1713c5b85564a70a2e0c469f", @@ -62,7 +62,7 @@ "ASR", "VPR" ], - "name": "Ecapa-Tdnn_melspectrogram", + "name": "Ecapa-Tdnn_melspectrogram.pth", "size": "33.8MB", "date": "2022-08-09 22:21:25", "SHA": "812c2758805dc7e9d7c2a5b0cd87b342a081f4d9a20513e246a3281ccd8f9bb7", @@ -74,7 +74,7 @@ "STT", "Whisper" ], - "name": "base", + "name": "base.pt", "size": "138.5MB", "date": "2024-02-03 15:54:08.871705", "SHA": "ed3a0b6b1c0edf879ad9b11b1af5a0e6ab5db9205f891f668f8b0e6c6326e34e", @@ -86,7 +86,7 @@ "STT", "Whisper" ], - "name": "small", + "name": "small.pt", "size": "461.2MB", "date": "2023-06-09 14:38:54.527018", "SHA": "9ecf779972d90ba49c06d968637d720dd632c55bbf19d441fb42bf17a411e794", @@ -98,7 +98,7 @@ "STT", "Whisper" ], - "name": "medium", + "name": "medium.pt", "size": "1457.2MB", "date": "2024-02-03 16:19:31.529325", "SHA": "345ae4da62f9b3d59415adc60127b97c714f32e89e936602e85993674d08dcb1",