MakeItTalk用一段语音让一张照片动起来

MakeItTalk用一段语音让一张照片动起来

flyfish

输入是语音和照片,输出是照片中人说话的视频。

[En]

The input is a voice and a photo, and the output is a video of the person in the photo talking.

模型与源码一起提供,拖到文章末尾出有下载地址。

看例子

原始图片

MakeItTalk用一段语音让一张照片动起来
AI模型让它动起来后
MakeItTalk用一段语音让一张照片动起来

; 实现

以下是最初的教程,由于添加了一些易于使用的代码,因此比官方网站更详细。

[En]

Here is the initial tutorial that is a little more detailed than the official website because of the addition of some easy-to-use code.

因为下载模型有些困难,所以这里提供了模型的源代码,点击这里下载。而且他们都有自己的岗位,各司其职。

[En]

Because it is slightly difficult to download the model, so here the model is provided with the source code, click here to download. And they all have their own positions and perform their own duties.

总共需要三部

第一步下载

模型与源码一起提供
链接:https://pan.baidu.com/s/1WvlRVUVbTOahpNedl9EUQA
提取码:hrvp

第二步看自然人脸的效果

为了一键执行,原始文件没动,增加了执行程序quick_demo.py可以什么都不用操心了,等着程序完成就行了。
在Python环境一条一条的执行

sudo apt-get install ffmpeg
pip install -r requirements.txt
python quick_demo.py

您还可以使用以下命令查看效果

[En]

You can also use the following command to see the effect

python main_end2end.py

第三步看卡通脸的效果

卡通人说话

python main_end2end_cartoon.py --jpg wilk.png --jpg_bg wilk_bg.png

如果出现结果是

libswresample   2.  9.100 /  2.  9.100
libpostproc    54.  7.100 / 54.  7.100
[image2 @ 0x55e0ebefab40] Could find no file with path '%06d.tga' and index in the range 0-4
%06d.tga: No such file or directory

官网提供的方法是在Ubuntu16.04安装winehq-stable运行facewarp.exe。这里是把facewarp.exe放在windows系统运行。出现这种错误不用担心。
把源码中windows文件夹放到windows操作系统中运行
运行命令如下 这里放置的E盘

E:\facewarp>facewarp.exe examples_cartoon/wilk.png out/triangulation.txt out/reference_points.txt out/warped_points.txt examples_cartoon/wilk_bg.jpg -novsync -dump

生成了一堆tga图片
写一段代码将tga图片合并成gif

import imageio as iio, os
def merge_gif(source_path,target_path):
    lst = os.listdir(source_path)
    with iio.get_writer(target_path+"result.gif", mode='I') as writer:
        for i in lst:
            tmp=source_path + i
            print("process",tmp)
            writer.append_data(iio.imread(tmp))

if __name__ == "__main__":
    source_path = "./2/"
    target_path = "./1/"
    merge_gif(source_path,target_path)

出处

论文题目是《MakeItTalk: Speaker-Aware Talking-Head Animation》
框架流程

MakeItTalk用一段语音让一张照片动起来

原始的代码地址
https://github.com/adobe-research/MakeItTalk.git
更容易使用的代码地址
链接:https://pan.baidu.com/s/1WvlRVUVbTOahpNedl9EUQA
提取码:hrvp

Original: https://blog.csdn.net/flyfish1986/article/details/121698184
Author: 西西弗Sisyphus
Title: MakeItTalk用一段语音让一张照片动起来

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/498242/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球