DeepFaceLab
DeepFaceLab copied to clipboard
DeepFaceLab is the leading software for creating deepfakes.
[https://zhuanlan.zhihu.com/p/165589205](https://zhuanlan.zhihu.com/p/165589205) # How to use it 最近这几年视频换脸十分流行,在B站常有up主上传自己恶搞的AI换脸视频。当然,PS修图一直都是热点,但PS常用于P一张图。而网上看到的,比如将迪丽热巴演的某片段换成了鹿晗的脸(没有其他意思,确实有这些恶搞)??以至于以假乱真,这些都是咋做到的呢?其实就是使用到了强大的AI技术:AI+“造假”混合,就产生了“深度造假”。 Deepfakes,一种混合“深度学习”和“造假” 的合成技术 ,其中一人的现有图像或视频被替换为其他人的肖像。Deepfakes利用了机器学习和人工智能中的强大技术来生成具有极高欺骗力的视觉和音频内容。用于创建的主要机器学习方法是基于深度学习的训练生成神经网络,如生成对抗网络GAN。 按照维基的资料,Deepfakes这个词起源于2017年底,来自Reddit用户分享了他们创建的“深度造假”产品。2018年1月,启动了名为FakeApp的桌面应用程序。此应用程序使用户可以轻松创建和共享彼此交换脸部的视频。截至2019年,FakeApp已被Faceswap和基于命令行的DeepFaceLab等开源替代产品所取代。较大的公司也开始使用Deepfake。 本文介绍使用DeepFaceLab这款开源产品,它基于python和tensorflow。 说明,基于本文掌握的内容不得用于非法违法目的以及违背道德的行为以及用于商业利益,否则本人概不负责。 开始前,需要在[https://github.com/iperov/DeepFaceLab](https://link.zhihu.com/?target=https%3A//github.com/iperov/DeepFaceLab)上获取下载地址,并进行安装(想要我文章版本链接的,私聊我,人多的话那回不过来!记得赞赞一下嘛!)。 这里要说下,使用DeepFaceLab最好需要足够好的电脑配置,因为AI深度训练的过程基于cpu以及gpu,显卡性能越好意味着其速度越快效果越好。但这不是绝对,如果有足够的耐心也是能够合成出一定效果的,一切都只是娱乐嘛。(ps:我写本文时用到的是win7电脑,非高配置,这不重要) 安装完毕后,你会在DeepFaceLab_NVIDIA\下看到类似下图的文件: 安装后会看到的一些文件 其中,workplace存放我们的视频素材以及图片。在这之前,你需要准备两个视频,源视频是你想换过去的人脸的视频(比如你自己),目标视频是被换掉的人脸的视频(比如星爷)。本文把吴孟达老师的一段“你在教我做事啊”的视频片段换成沈腾,所以使用的源视频素材是沈腾,而目标视频就是“你在教我做事啊”小片段。将源视频重命名为data_src.mp4,目标视频重命名为data_dst.mp4并放置于workplace。(确保选择的源视频素材人脸清晰、正脸、表情丰富但不要遮挡、模糊,时长不需要长) 视频放置于workplace下 然后双击2) extract images from video data_src.bat,此命令将data_src视频每一帧提取为图片,回车,再回车默认选择图片格式为png。 等待将data_src视频分帧 等待命令行窗口运行完毕便可关掉,以上是deepfacelab使用ffmpeg提取帧。然后,在workplace/data_src文件夹下就会看到data_src.mp4的每一帧图片,如图: 提取data_src.mp4后的每一帧 删除data_src文件夹下没有沈腾的图片以及模糊的图片。随后再执行3) extract...
## Expected behavior SAEHD trains when you run the file [6) train SAEHD.bat] ## Actual behavior `cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\core\src\alloc.cpp:55: error: (-4:Insufficient memory) Failed to allocate 1048576 bytes in function 'cv::OutOfMemoryError'`...
Hey there, Wanted to check with you first, currently in `requirements-cuda.txt` we find `tensorflow-gpu=2.4.0` which if I am not mistaken is legacy, and `tensorflow=2.4.0` would just work as well, this...
After training model, in the merge_SAEHD.sh process, black dots appear in the background of merged result while the super-resolution param is set 5. The dots disappear when the super-resolution param...
## Expected behavior When running `6) train SAEHD.bat` again after having ran it once and saved the model, I would expect it to continue training. ## Actual behavior Throws the...
When i try to start/resume an XSeg training it gives me several Python/Tensorflow errors. Here's the log: ` Traceback (most recent call last): Traceback (most recent call last): Traceback (most...
Hello, I use deepfacelive and it does not work. The exe is starting but as soon as it started I get 1-2 frames in the video field and that´s it....
Hello, This seems like a bug or other incompatibility. I am seeing an issue using the sample videos. Columns 2,4, and 5 of the preview window are either blank or...
Here's the code. Please help me realize what I have to fix. I am just learning the software and not familiar with code language so please be patient with me....