python - 有没有人使用过语音驱动的动画,你能让它工作吗?

标签 python python-3.x ffmpeg artificial-intelligence

我说的是this repo .我安装了所有依赖项,但无法使其工作。非常感谢任何帮助(:
我正在运行 python 3.7.5。
这是我的代码:

import sda
import scipy.io.wavfile as wav
from PIL import Image

va = sda.VideoAnimator(gpu=0, model_path="crema")# Instantiate the animator
fs, audio_clip = wav.read("example/audio.wav")
still_frame = Image.open("example/image.bmp")
vid, aud = va(frame, audio_clip, fs=fs)
va.save_video(vid, aud, "generated.mp4")
可悲的是它似乎不起作用,它给了我这个错误:
Warning (from warnings module):
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python37\lib\site-packages\pydub\utils.py", line 170
    warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
Traceback (most recent call last):
  File "C:\Users\Alex\Desktop\test\test.py", line 8, in <module>
    vid, aud = va(frame, audio_clip, fs=fs)
NameError: name 'frame' is not defined
花了大约2个小时,我什么都做不了,我没有想法。
如果你花时间帮助我,我从心底里感谢你。

最佳答案

  • 修复变量名framestill_frame
  • 修复 RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work https://github.com/jiaaro/pydub/issues/348
  • 修复 AttributeError: 'BmpImageFile' object has no attribute 'ndim' https://github.com/DinoMan/speech-driven-animation/issues/11
  • 关于python - 有没有人使用过语音驱动的动画,你能让它工作吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63093114/

    相关文章:

    python - openpyxl 组列,其中 "Summary Columns to the Right of Detail"未选中

    python - 在 Python 3 下工作的文本到语音 (TTS) 模块

    ffmpeg - ffmpeg 更改生成文件的比特率和文件大小

    python - 使用 scipy 最小化多变量函数。导数未知

    python - 你可以在 colab notebook 中更改内核吗?

    python - 如何将 tkinter.StringVar 更改为整数类型

    python - Selenium 无法通过类名找到元素

    python - 替换Python中重复的连续字符

    c++ - FFmpeg:在 C++ 中生成 H264 视频

    ffmpeg - .WAV 文件的结束部分未转换为 .MP3 文件