当前位置:   article > 正文

github项目复现-------FACEGOOD-Audio2Face(未成功)_facegood audio2face 教程

facegood audio2face 教程

一、项目介绍

项目网址:GitHub - FACEGOOD/FACEGOOD-Audio2Face: http://www.facegood.cchttps://github.com/FACEGOOD/FACEGOOD-Audio2Face

Audio2Face是一种语音驱动表情的技术,该技术可以将语音实时转换成表情blendshape动画。这样做的原因是在现行的产业中,用BS去驱动数字形象的动画表情仍然是主流。方便动画艺术家对最终动画产出最艺术调整,传输的数据量小,方便动画在不同的数字形象之间进行传递等等。

二、开始复现

该项目需要在Windows环境下运行,按照项目中的readme一步一步操作。

第一步:环境搭建

在conda中搭建一个虚拟环境用于运行此项目,由readme中的Dependences可得需要安装的软件和依赖库如下:

  1. tersorflow-gpu 1.15 cuda 10.0
  2. python-libs: pyaudio requests websocket websocket-client

       之后就一路next,完成后,打开Anaconda Promt输入nvcc -version或nvcc -V,查看安装         结果,出现如下显示则表示安装成功。

  1. nvcc: NVIDIA (R) Cuda compiler driver
  2. Copyright (c) 2005-2018 NVIDIA Corporation
  3. Built on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018
  4. Cuda compilation tools, release 10.0, V10.0.130
  • 安装对应的cuDNN,对应的版本号是7.4,进入下载地址cuDNN Archive | NVIDIA Developer ,选择对应的版本,下载完解压后,将下面的三个文件copy到刚刚下载的cuda的v10.0文件夹里
    之后添加如下的环境变量
    1. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp
    2. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin
    3. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\CUPTI\libx64
    4. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64
  • 新建一个环境
    conda create -n Audio2Face_env python=3.6

    命名为 Audio2Face_env,这里使用的Python版本为3.6,随后激活环境

    conda activate Audio2Face_env
  •  安装tersorflow-gpu 1.15
    conda install tensorflow-gpu=1.15.0

    安装完成后测试,依次输入以下命令

    1. //使用python
    2. python
    3. //测试代码,一行一行输入
    4. import tensorflow as tf
    5. a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name=‘a’)
    6. b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name=‘b’)
    7. c = tf.matmul(a, b)
    8. sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
    9. print(sess.run( c ))

    运行完的结果如下,则证明安装成功

    1. MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0
    2. 2022-05-12 01:55:15.573018: I tensorflow/core/common_runtime/placer.cc:54] MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0
    3. a: (Const): /job:localhost/replica:0/task:0/device:GPU:0
    4. 2022-05-12 01:55:15.579136: I tensorflow/core/common_runtime/placer.cc:54] a: (Const): /job:localhost/replica:0/task:0/device:GPU:0
    5. b: (Const): /job:localhost/replica:0/task:0/device:GPU:0
    6. 2022-05-12 01:55:15.590756: I tensorflow/core/common_runtime/placer.cc:54] b: (Const): /job:localhost/replica:0/task:0/device:GPU:0
    7. [[22. 28.]
    8. [49. 64.]]

  • 安装依赖库
    1. conda install pyaudio
    2. conda install requests
    3. conda install websocket
    4. conda install websocket-client
     在安装websocket时出现了如下错误
    1. UnsatisfiableError: The following specifications were found
    2. to be incompatible with the existing python installation in your environment:
    3. Specifications:
    4. - websocket -> python[version='2.6.*|2.7.*']
    5. Your python: python=3.6
    6. If python is on the left-most side of the chain, that's the version you've asked for.
    7. When python appears to the right, that indicates that the thing on the left is somehow
    8. not available for the python version you are constrained to. Note that conda will not
    9. change your python version to a different minor version unless you explicitly specify
    10. that.

    随后用pip安装试一试

    pip install websocket

 第二步:运行test

在anaconda prompt里依次输入如下命令

  1. //进入test目录里
  2. F:
  3. cd cd FACEGOOD-Audio2Face\code\test\AiSpeech
  4. //激活环境
  5. activate Audio2Face_env
  6. //运行测试脚本
  7. python zsmeif.py

随后出现了错误

ImportError: cannot import name 'create_connection'

网上查找发现这是因为未安装websocket-client,但是我已经安装,最后发现必须得先安装websocket再安装 websocket-client,故执行以下命令即可

  1. //卸载
  2. pip uninstall websocket
  3. pip uninstall websocket-client
  4. //重新安装
  5. pip install websocket
  6. pip install websocket-client

继续执行测试代码,又出现如下错误

 getaddrinfo failed

 发现是网络未连接,连上网络即可,继续执行测试代码,出现“run main”,运行FaceGoodLiveLink.exe(在/example/ueExample/文件夹内),按住左键录制声音,但是ai没有回复,返回到命令窗口,发现成功录制声音,但是出现如下错误

  1. (0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
  2. [[{{node conv2d/Conv2D}}]]
  3. [[dense_1/BiasAdd/_5]]
  4. (1) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
  5. [[{{node conv2d/Conv2D}}]]

网上查到这是cudnn内存开辟失败,随后在项目页面的issues里面发现同样的问题,作者回复显卡必须使用1060 6G以上才行,而笔者使用的电脑显卡配置是1050Ti 4G,无法满足要求,项目停滞。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/481280
推荐阅读
相关标签
  

闽ICP备14008679号