(二十一) AI数字人技术、数字人直播、文字转语音、文字驱动数字人,单张图片即可

(二十一) AI数字人技术、数字人直播、文字转语音、文字驱动数字人、单张图片转数字人视频

本文应用的AI技术,包括文字转语音、wav2lip等。
代码可以把文字或语音,使用单张图片即可转换成人物的数字人视频。
加快处理效率,本文修改了一些依赖库的文件。
对此文感兴趣的可以加微深入探讨:herbert156

可运行的软件打包上传了网盘,下载使用说明如下:
1、先下载AI_Digital.part1.exe可执行文件,执行安装。注意:安装的目录不能包含中文;
2、如果您的电脑游可用的GPU,转换速度会快很多。如果没有可用的GPU,代码会使用CPU,速度极慢,要耐心等待
3、百度网盘链接: https://pan.baidu.com/s/10Y6ZFpBWGoDeY07hauBG9g?pwd=6nr2 提取码: 6nr2

软件界面:
在这里插入图片描述

话不多说上代码,
界面部分:

import asyncio
import traceback
import edge_tts
import numpy as np
import os, datetime, sys, time, threading
import win32gui
import cv2
import http.client, win32api, win32con
import configparser as configparser
from playsound import playsound
from PIL import Image,ImageDraw,ImageFont
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog, QApplication, QSlider
from PyQt5.QtCore import Qt, QTimer, QThread, pyqtSlot, pyqtSignal
from PyQt5.QtGui import QPixmap, QIntValidator, QIcon
from digital_human_UI import Ui_d_human

import shutil
import torch
from time import  strftime
from argparse import ArgumentParser
from src.utils.preprocess import CropAndExtract
from src.test_audio2coeff import Audio2Coeff
from src.facerender.animate import AnimateFromCoeff
from src.generate_batch import get_data
from src.generate_facerender_batch import get_facerender_data
from src.utils.init_path import init_path

copyright_chk = True

def is_contains_chinese():  #运行目录不能包含中文
    strs = os.getcwd()
    for _char in strs:
        if '\u4e00' <= _char <= '\u9fa5':
            win32api.MessageBox(0, f"软件安装目录【{strs}】不能包含中文,\n请移动到其他目录再运行......", '运行错误提示', win32con.MB_OK)
            sys.exit()

def get_web_time(host): #获取网络时间,并设置系统时间
    try:
        conn=http.client.HTTPConnection(host,timeout=20)
        conn.request("GET", "/")
        r=conn.getresponse()
    except:
        win32api.MessageBox(0, f"网络连接超时...", '运行错误提示', win32con.MB_OK); sys.exit()
    ts=  r.getheader('date') #获取http头date部分
    ltime= time.strptime(ts[5:25], "%d %b %Y %H:%M:%S")   #将GMT时间转换成北京时间
    ttime=time.localtime(time.mktime(ltime)+8*60*60)
    date = "%u%02u%02u" % (ttime.tm_year, ttime.tm_mon, ttime.tm_mday)
    return date

is_contains_chinese()

if not torch.cuda.is_available():
    win32api.MessageBox(0, f"您的GPU无法被本程序使用,将使用CPU进行处理,速度较慢...", '运行提示提示', win32con.MB_OK)

work_path = os.getcwd()
audio_input_path = work_path + '/input/test.mp3'
img_input_path = work_path + '/input/test.jpg'
out_dir=work_path + '/output'
rates = '+0%'
run_flag = 0
stop_flag = False
arg_size = 256
enhancer = None
bar = 0
output_file_name = ''
voices = "zh-CN-XiaoxiaoNeural"
voices_list = ['XiaoxiaoNeural', 'XiaoyiNeural', 'YunxiaNeural', 'liaoning-XiaobeiNeural', 'shaanxi-XiaoniNeural',
              'YunjianNeural', 'YunxiNeural', 'YunyangNeural']

my_title = "AI虚拟数字人系统"
pil_img = Image.open(".\src\start_img.jpg")
ImageDraw.Draw(pil_img).text((140,140), my_title+' v1.0', (255,255,255),font=ImageFont.truetype("msyh.ttc", 36))
ImageDraw.Draw(pil_img).text((410,330), "正在加载AI模型,请稍后 ......", (255,255,255),font=ImageFont.truetype("msyh.ttc", 16))
img_s = cv2.cvtColor(np.array(pil_img), cv2.COLOR_RGB2BGR)
def showpic():  # 以下代码显示软件初始界面
    global ret, frame
    cv2_title =  "Digital Human v1.0"
    cv2.namedWindow(cv2_title, flags = cv2.WINDOW_AUTOSIZE)
    hwnd = win32gui.FindWindow(None, cv2_title)
    # icon_path = ".\damo\logo.ico"
    # win32gui.SendMessage(hwnd, win32con.WM_SETICON, win32con.ICON_BIG,
    #                     win32gui.LoadImage(None, icon_path, win32con.IMAGE_ICON, 0, 0,
    #                     win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE))
    win32gui.SetWindowLong(hwnd, win32con.GWL_STYLE, win32gui.GetWindowLong(hwnd, win32con.GWL_EXSTYLE) | win32con.WS_EX_TOPMOST)
    # win32gui.SetWindowLong(hwnd, win32con.GWL_STYLE, win32gui.GetWindowLong(hwnd, win32con.GWL_STYLE) & ~win32con.WS_CAPTION)
    win32gui.SetWindowPos(hwnd, None, 0, 0, 0, 0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE | win32con.SWP_FRAMECHANGED)
    win32gui.ShowWindow(hwnd, win32con.SW_SHOW)
    while run_flag == 0: cv2.imshow(cv2_title, img_s); cv2.waitKey(100)
    cv2.destroyAllWindows()
t = threading.Thread(target=showpic)
t.start()

class TransRrun(QThread):
    sinout = pyqtSignal(str)
    def __init__(self, audio_file):
        super(TransRrun, self).__init__()
        self.audio_file = audio_file
    def run(self):
        try:
            trans_run(self.audio_file)  # must be coded by youself...
            self.sinout.emit('OK')
        except: self.sinout.emit('ERROR')

class EdgeTTSTrans(QThread):
    def __init__(self, winshot, texts):
        super(EdgeTTSTrans, self).__init__()
        self.main_win = winshot
        self.rates = rates
        self.texts = texts

    def run(self):
        asyncio.run(self.edge_tts_trans(self.texts))

    async def edge_tts_trans(self, text):
        communicate = edge_tts.Communicate(text=text, rate=self.rates, voice=voices)
        await communicate.save('temp_audio.mp3')

class PlayAudioWav(QThread):
    def __init__(self, winshot, texts):
        super(PlayAudioWav, self).__init__()
        self.rates = rates
        self.texts = texts
    def run(self):
        asyncio.run(self.edge_tts_trans(self.texts))
        playsound("temp_audio.mp3")
    async def edge_tts_trans(self, text):
        communicate = edge_tts.Communicate(text=text, rate=self.rates, voice=voices)
        try: await communicate.save('temp_audio.mp3')
        except: traceback.print_exc()

class Winshot(QWidget, Ui_d_human):
    def __init__(self):
        super(Winshot, self).__init__()
        self.setupUi(self)
        global hwnd, run_flag

        self.createLayout()
        self.setWindowTitle(my_title)
        self.setWindowIcon(QIcon("./src/ican48.ico"))
        self.setFixedSize(self.size())
        self.setWindowFlags(Qt.WindowMinimizeButtonHint)
        self.my_timer = QTimer(self)
        self.show(); run_flag = 1

    def CV2toPIL(self, img):  # cv2转PIL
        return Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGRA2RGBA))
    def PILtoCV2(self, img):  # PIL转cv2
        return cv2.cvtColor(np.array(img), cv2.COLOR_RGBA2BGRA)
    def two_pic_combine_PIL(self, back_img, fore_img): #2个图片合并Image.composite
        back_img = self.CV2toPIL(back_img); fore_img = self.CV2toPIL(fore_img); r,g,b,alpha = fore_img.split()
        return cv2.cvtColor(self.PILtoCV2(Image.composite(fore_img, back_img, alpha)), cv2.COLOR_BGRA2BGR)
    def two_pic_combine_PIL_Paste(self, back_img, fore_img):    #Image.alpha_composite
        back_img = self.CV2toPIL(back_img); fore_img = self.CV2toPIL(fore_img)
        return cv2.cvtColor(self.PILtoCV2(Image.alpha_composite(back_img, fore_img)), cv2.COLOR_BGRA2BGR)
    def CvMatToQImage(self, ptr):  # Converts an opencv MAT format into a QImage
        ptr = cv2.cvtColor(ptr, cv2.COLOR_BGRA2RGBA)  # 颜色格式转换
        QtImg = QtGui.QImage(ptr.data, ptr.shape[1], ptr.shape[0], QtGui.QImage.Format_RGBA8888)
        return QtGui.QPixmap.fromImage(QtImg)

    def show_error(self,str):
        r_button = QMessageBox.question(self, my_title,'\n\n'+str+'\n\n', QMessageBox.Ok)
    def set_False_Btn(self):
        self.outButton.setEnabled(False)
        self.model_select.setEnabled(False)
        self.startButton.setEnabled(False)
        self.face_enhance.setEnabled(False)
        self.quitButton.setEnabled(False)
        self.out_path.setEnabled(False)
        self.lbl_2.setEnabled(False)
    def set_True_Btn(self):
        self.outButton.setEnabled(True)
        self.model_select.setEnabled(True)
        self.startButton.setEnabled(True)
        self.face_enhance.setEnabled(True)
        self.quitButton.setEnabled(True)
        self.out_path.setEnabled(True)
        self.lbl_2.setEnabled(True)

    def start_run(self):
        global stop_flag
        stop_flag = False; self.set_False_Btn()

        try: tmp_img = cv2.imread(img_input_path)
        except: self.show_error('\n读取人物图片文件异常:文件不存在!   \n'); self.set_True_Btn(); return
        if tmp_img is None:
            self.show_error('读取人物图片文件异常!\n原因:目录/文件名不能包含中文...... ')
            self.set_True_Btn(); return

        if self.checkBox_txt.isChecked():
            text = self.textEdit.toPlainText()
            if text == "" :
                self.show_error('文本框里的文字不能为空... ');
                self.set_True_Btn()
                stop_flag = 1; return
            print(text)
            self.tts_thread = EdgeTTSTrans(self, text)  # 启动TTS线程
            self.tts_thread.start()
            trans_file ='temp_audio.mp3'
        else: trans_file = audio_input_path

        self.my_thread = TransRrun(trans_file)
        self.my_thread.sinout.connect(self.signal_coming)
        self.my_thread.start()

        self.my_timer.start(500)
        self.my_timer.timeout.connect(self.running)

    def signal_coming(self, str):
        global stop_flag
        if str == 'OK':
            self.progressBar.setValue(100)
            cv2.waitKey(10)
            r_button = QMessageBox.question(self, my_title, "\n\n\n完成转换...\n\n需要播放吗?\n\n\n",
                                            QMessageBox.Yes | QMessageBox.No)
            if r_button == QMessageBox.Yes: os.startfile(output_file_name)
        else:
            stop_flag = 1
            self.show_error('转换过程中发生错误...\n可能原因:\n文件或目录不能包含中文...\n网络不通...\n网络不能使用代理...')

        self.set_True_Btn()
        self.progressBar.setValue(0)

    def running(self):
        global bar
        bar += 2
        self.progressBar.setValue(bar)
        if bar >= 100: bar = 0
        if stop_flag: self.my_timer.stop()

    def helpWin(self):
        str="\n\n\n      本软件著作权归属:XXX        网址:www.xxx.com  \n\n\n"
        QMessageBox.question(self, my_title, str, QMessageBox.Ok)
    def quitWin(self):
        r_button = QMessageBox.question(self, "my_title",
                                        "\n\n\n退出将终止本程序......\n\n确认退出吗?\n\n\n", QMessageBox.Yes | QMessageBox.No)
        if r_button == QMessageBox.Yes:
            sys.exit()

    def audioButton_fuc(self):
        global audio_input_path
        tmp_path = audio_input_path
        audio_input_path, ok1 = QFileDialog.getOpenFileName(self,"请选择音视频文件",os.path.split(audio_input_path)[0],
                                                            "*.mp3;*.wav;*.mp4")
        if audio_input_path == '': audio_input_path = tmp_path
        self.audio_file_path_txt.setText(os.path.split(audio_input_path)[1])
        print('选择的音频文件:', audio_input_path)
    def humanButton_fuc(self):
        global img_input_path
        tmp_path = img_input_path
        img_input_path, ok1 = QFileDialog.getOpenFileName(self,"请选择音视频文件",os.path.split(img_input_path)[0],
                                                            "*.jpg;*.png;*.gif")
        if img_input_path == '': img_input_path = tmp_path
        self.human_file_path_txt.setText(os.path.split(img_input_path)[1])
        print('选择的人物图像:', img_input_path)

        self.img_label.setAlignment(Qt.AlignCenter)
        self.img_label.setPixmap(QPixmap(img_input_path).scaled(311, 175, Qt.KeepAspectRatio))

    def outButton_fuc(self):
        global out_dir
        tmp_path = out_dir
        out_dir = QFileDialog.getExistingDirectory(self,'选择转换后的输出文件夹', work_path)
        if out_dir == '': out_dir = tmp_path
        self.out_path.setText(out_dir)
        print('选择的保存目录:', out_dir)

    def open_fold_fuc(self):
        try: os.startfile(out_dir)
        except:pass
    def rates_slider_fuc(self):
        global rates
        self.audio_rates.setText(f'{self.rates_slider.value()}%')
        _rates = self.rates_slider.value()
        if _rates >= 0: rates = f'+{_rates}%'
        else: rates = f'{_rates}%'

    def click_model_select(self):
        global arg_size
        if self.model_select.currentIndex() == 1:
            arg_size = 512
            self.show_error('选择【512x512】的模型,可能会导致转换的速度超慢,\n请谨慎选择...')
        else: arg_size = 256
    def click_audio_select(self, str1):
        global voices
        voices = 'zh-CN-' + voices_list[self.audio_select.currentIndex()]
        print('选择的声音:', voices)
    def click_try_lisson(self, str1):
        text = "感谢您选择我的声音"
        self.play_thread = PlayAudioWav(self,text)   #启动Play线程
        self.play_thread.start()
    def click_face_enhance(self):
        global enhancer
        if self.face_enhance.isChecked():
            self.show_error('选择【人脸增强】,会导致转换的速度超慢,\n请谨慎选择...')
            enhancer = 'gfpgan'
        else: enhancer = None
    def click_checkBox_txt(self):
        if self.checkBox_txt.isChecked():
            self.audioButton.setEnabled(False)
            self.audio_file_path_txt.setEnabled(False)
            self.textEdit.setEnabled(True)
        else:
            self.audioButton.setEnabled(True)
            self.audio_file_path_txt.setEnabled(True)
            self.textEdit.setEnabled(False)
    def click_checkBox_audio(self):
        if self.checkBox_audio.isChecked():
            self.textEdit.setEnabled(False)
        else:
            self.audioButton.setEnabled(True)
            self.audio_file_path_txt.setEnabled(True)

    def createLayout(self):
        # self.img_label.setPixmap(self.CvMatToQImage(cv2.resize(cv2.imread(img_input_path), (311, 175))))
        self.img_label.setAlignment(Qt.AlignCenter)
        self.img_label.setPixmap(QPixmap(img_input_path).scaled(311, 175, Qt.KeepAspectRatio))

        self.checkBox_txt.setChecked(True)
        self.checkBox_txt.stateChanged.connect(self.click_checkBox_txt)
        self.audioButton.setEnabled(False)
        self.audio_file_path_txt.setEnabled(False)
        self.textEdit.setText("数字人是运用数字技术创造出来的、与人类形象接近的数字化人物形象。")

        self.audio_file_path_txt.setText(os.path.split(audio_input_path)[1])
        self.human_file_path_txt.setText(os.path.split(img_input_path)[1])
        self.out_path.setText(out_dir)

        self.audioButton.clicked.connect(self.audioButton_fuc)
        self.humanButton.clicked.connect(self.humanButton_fuc)
        self.outButton.clicked.connect(self.outButton_fuc)
        self.chk_outputfile.clicked.connect(self.open_fold_fuc)
        self.try_lisson.clicked.connect(self.click_try_lisson)

        self.startButton.clicked.connect(self.start_run)
        self.helpButton.clicked.connect(self.helpWin)
        self.quitButton.clicked.connect(self.quitWin)

        self.rates_slider.setTickPosition(QSlider.TicksAbove)
        self.rates_slider.valueChanged.connect(self.rates_slider_fuc)

        self.audio_select.addItems(['晓晓:女', '晓依:女', '云霞:女', '东北:女', '陕西:女', '云剑:男', '云溪:男','云阳:男'])
        self.model_select.addItems(['256x256', '512x512'])
        self.model_select.activated[str].connect(self.click_model_select)
        self.audio_select.activated[str].connect(self.click_audio_select)
        self.face_enhance.stateChanged.connect(self.click_face_enhance)

#if __name__ == '__main__':
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
app = QtWidgets.QApplication(sys.argv)
winshot = Winshot()
sys.exit(app.exec_())

运行代码:

# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'digital_human_UI.ui'
# Created by: PyQt5 UI code generator 5.15.2
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_d_human(object):
    def setupUi(self, d_human):
        d_human.setObjectName("d_human")
        d_human.resize(681, 429)
        self.startButton = QtWidgets.QPushButton(d_human)
        self.startButton.setGeometry(QtCore.QRect(290, 390, 91, 23))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.startButton.setFont(font)
        self.startButton.setObjectName("startButton")
        self.helpButton = QtWidgets.QPushButton(d_human)
        self.helpButton.setGeometry(QtCore.QRect(510, 390, 61, 23))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.helpButton.setFont(font)
        self.helpButton.setObjectName("helpButton")
        self.quitButton = QtWidgets.QPushButton(d_human)
        self.quitButton.setGeometry(QtCore.QRect(598, 390, 61, 23))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.quitButton.setFont(font)
        self.quitButton.setObjectName("quitButton")
        self.img_label = QtWidgets.QLabel(d_human)
        self.img_label.setGeometry(QtCore.QRect(350, 49, 311, 175))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.img_label.setFont(font)
        self.img_label.setObjectName("img_label")
        self.textEdit = QtWidgets.QTextEdit(d_human)
        self.textEdit.setGeometry(QtCore.QRect(20, 49, 311, 175))
        self.textEdit.setObjectName("textEdit")
        self.checkBox_txt = QtWidgets.QCheckBox(d_human)
        self.checkBox_txt.setGeometry(QtCore.QRect(60, 19, 68, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.checkBox_txt.setFont(font)
        self.checkBox_txt.setObjectName("checkBox_txt")
        self.buttonGroup = QtWidgets.QButtonGroup(d_human)
        self.buttonGroup.setObjectName("buttonGroup")
        self.buttonGroup.addButton(self.checkBox_txt)
        self.audioButton = QtWidgets.QPushButton(d_human)
        self.audioButton.setGeometry(QtCore.QRect(20, 239, 61, 21))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.audioButton.setFont(font)
        self.audioButton.setObjectName("audioButton")
        self.audio_file_path_txt = QtWidgets.QLabel(d_human)
        self.audio_file_path_txt.setGeometry(QtCore.QRect(90, 241, 241, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.audio_file_path_txt.setFont(font)
        self.audio_file_path_txt.setObjectName("audio_file_path_txt")
        self.chk_outputfile = QtWidgets.QPushButton(d_human)
        self.chk_outputfile.setGeometry(QtCore.QRect(88, 390, 61, 23))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.chk_outputfile.setFont(font)
        self.chk_outputfile.setObjectName("chk_outputfile")
        self.model_select = QtWidgets.QComboBox(d_human)
        self.model_select.setGeometry(QtCore.QRect(510, 306, 71, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.model_select.setFont(font)
        self.model_select.setObjectName("model_select")
        self.lbl_2 = QtWidgets.QLabel(d_human)
        self.lbl_2.setGeometry(QtCore.QRect(450, 306, 51, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.lbl_2.setFont(font)
        self.lbl_2.setObjectName("lbl_2")
        self.outButton = QtWidgets.QPushButton(d_human)
        self.outButton.setGeometry(QtCore.QRect(20, 269, 61, 21))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.outButton.setFont(font)
        self.outButton.setObjectName("outButton")
        self.out_path = QtWidgets.QLabel(d_human)
        self.out_path.setGeometry(QtCore.QRect(90, 269, 541, 20))
        self.out_path.setObjectName("out_path")
        self.face_enhance = QtWidgets.QCheckBox(d_human)
        self.face_enhance.setGeometry(QtCore.QRect(595, 306, 68, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.face_enhance.setFont(font)
        self.face_enhance.setObjectName("face_enhance")
        self.lbl_3 = QtWidgets.QLabel(d_human)
        self.lbl_3.setGeometry(QtCore.QRect(26, 306, 51, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.lbl_3.setFont(font)
        self.lbl_3.setObjectName("lbl_3")
        self.audio_select = QtWidgets.QComboBox(d_human)
        self.audio_select.setGeometry(QtCore.QRect(86, 305, 71, 18))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.audio_select.setFont(font)
        self.audio_select.setObjectName("audio_select")
        self.rates_slider = QtWidgets.QSlider(d_human)
        self.rates_slider.setGeometry(QtCore.QRect(271, 307, 131, 20))
        self.rates_slider.setMinimum(-99)
        self.rates_slider.setTracking(True)
        self.rates_slider.setOrientation(QtCore.Qt.Horizontal)
        self.rates_slider.setInvertedAppearance(False)
        self.rates_slider.setInvertedControls(False)
        self.rates_slider.setObjectName("rates_slider")
        self.aud = QtWidgets.QLabel(d_human)
        self.aud.setGeometry(QtCore.QRect(211, 304, 61, 20))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.aud.setFont(font)
        self.aud.setObjectName("aud")
        self.lbl_4 = QtWidgets.QLabel(d_human)
        self.lbl_4.setGeometry(QtCore.QRect(27, 343, 61, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.lbl_4.setFont(font)
        self.lbl_4.setObjectName("lbl_4")
        self.checkBox_audio = QtWidgets.QCheckBox(d_human)
        self.checkBox_audio.setGeometry(QtCore.QRect(210, 19, 71, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.checkBox_audio.setFont(font)
        self.checkBox_audio.setObjectName("checkBox_audio")
        self.buttonGroup.addButton(self.checkBox_audio)
        self.progressBar = QtWidgets.QProgressBar(d_human)
        self.progressBar.setGeometry(QtCore.QRect(87, 347, 571, 9))
        self.progressBar.setProperty("value", 0)
        self.progressBar.setTextVisible(False)
        self.progressBar.setInvertedAppearance(False)
        self.progressBar.setObjectName("progressBar")
        self.humanButton = QtWidgets.QPushButton(d_human)
        self.humanButton.setGeometry(QtCore.QRect(350, 239, 61, 21))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.humanButton.setFont(font)
        self.humanButton.setObjectName("humanButton")
        self.human_file_path_txt = QtWidgets.QLabel(d_human)
        self.human_file_path_txt.setGeometry(QtCore.QRect(420, 241, 241, 16))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.human_file_path_txt.setFont(font)
        self.human_file_path_txt.setObjectName("human_file_path_txt")
        self.audio_rates = QtWidgets.QLabel(d_human)
        self.audio_rates.setGeometry(QtCore.QRect(407, 303, 31, 20))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.audio_rates.setFont(font)
        self.audio_rates.setObjectName("audio_rates")
        self.try_lisson = QtWidgets.QPushButton(d_human)
        self.try_lisson.setGeometry(QtCore.QRect(160, 304, 31, 21))
        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(9)
        self.try_lisson.setFont(font)
        self.try_lisson.setObjectName("try_lisson")

        self.retranslateUi(d_human)
        QtCore.QMetaObject.connectSlotsByName(d_human)

    def retranslateUi(self, d_human):
        _translate = QtCore.QCoreApplication.translate
        d_human.setWindowTitle(_translate("d_human", "AI"))
        self.startButton.setText(_translate("d_human", "开始生成"))
        self.helpButton.setText(_translate("d_human", "帮助"))
        self.quitButton.setText(_translate("d_human", "退出"))
        self.img_label.setText(_translate("d_human", "人物图片"))
        self.checkBox_txt.setText(_translate("d_human", "文本"))
        self.audioButton.setText(_translate("d_human", "音频文件"))
        self.audio_file_path_txt.setText(_translate("d_human", "音频文件"))
        self.chk_outputfile.setText(_translate("d_human", "查看结果"))
        self.lbl_2.setText(_translate("d_human", "模型选择:"))
        self.outButton.setText(_translate("d_human", "输出目录"))
        self.out_path.setText(_translate("d_human", "生成完成的视频输出目录"))
        self.face_enhance.setText(_translate("d_human", "脸部增强"))
        self.lbl_3.setText(_translate("d_human", "语音选择:"))
        self.aud.setText(_translate("d_human", "语速选择:"))
        self.lbl_4.setText(_translate("d_human", "转换进度:"))
        self.checkBox_audio.setText(_translate("d_human", "音视频"))
        self.humanButton.setText(_translate("d_human", "人物图"))
        self.human_file_path_txt.setText(_translate("d_human", "人物图片文件"))
        self.audio_rates.setText(_translate("d_human", "0%"))
        self.try_lisson.setText(_translate("d_human", "试听"))
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值