Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions MANIFESTO-ZH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 宣言
鉴于最近发生的事件,我想概述一下该存储库的用途和目的。
最好的表达方式可能是 [Deepfakes/faceswap宣言(英文)](https://github.com/deepfakes/faceswap#manifesto) ,为了相关性和明确性而进行了编辑:
> 当Faceswapping(换脸)最初被开发和发布时,该技术是开创性的,这是AI开发的一大步。 在学术界之外,它也被完全忽略了,因为该代码令人困惑且零碎。 它需要对复杂的AI技术有透彻的了解,并花了很多精力才能弄清楚。 直到一个人将其汇集成一个单一的,有凝聚力的集合。 它运行,运行,而且是如此频繁的方式与新技术出现在互联网上,它立即被用于创建不合适的内容。 尽管最开始就有人用于不适当的目的,这还是第一个任何人都可以下载、运行和通过实验学习的人工智能代码,而无需拥有数学、计算机理论、心理学等方面的博士学位。 在“深造”之前,这些技术就像是黑魔法,只有那些了解深奥且无穷无尽的书籍和论文中所描述的所有内部工作原理的人才能实践。
>
> “ Deepfakes”改变了这一切,任何人都可以参与AI开发。 对于我们开发人员而言,此代码的发布带来了绝佳的学习机会。 它使我们能够借鉴其他人提出的想法,与各种熟练写代码的人员合作,在学习新技能的同时尝试AI,并最终为新兴技术做出贡献,随着技术的进步,它只会在更多的主流场合得到使用。
>
> 但是,对我们来说很明显,这可能不是别人使用它的方式。 有人在用我们的软件做可怕的事情吗? 也许。 因此,开发人员和其他贡献者一直遵循严格的道德标准。 我们许多人甚至不使用它来创建视频,我们只是修改代码,看看它能做什么。 不幸的是,可能有人用Yanderify的代码做了可怕的事情,但是它们并不能代表创建它的原因,我们现在的使用方式或我们对代码的未来的看法。像任何技术一样,它可以被用来做好事,也可以被滥用。 我们的目的是开发Yanderify,以最大程度地减少其滥用的可能性,同时最大程度地发挥其作为学习,实验以及正当的换脸和道德娱乐的工具的潜力。
>
> 帮助Yanderify开发的人不会容忍对我们软件的不当使用。我们是程序员,我们是工程师,我们是业余爱好者,但最重要的是我们是人。Yanderify始终旨在娱乐和教育。为此,我们认为是时候就该软件的含义和对我们开发人员而言 不甚明确 的问题发表标准声明了。
>
> - Yanderify 不是为了创造不适当的内容。
> - Yanderify 禁止未经同意或出于隐瞒使用目的而更改面孔。
> - Yanderify 不是为了任何非法,不道德或可疑目的。
> - Yanderify 的存在是为了试验和发现AI技术,进行社会或政治评论(请不要在中国大陆这么做),电影以及各种道德和合理用途的实验。
>
> 我们非常不安的事实是, Yandrify 可以用于不道德和不名誉的事情。然而,我们支持开发可合乎道德使用的工具和技术,并为任何想亲自学习人工智能的人提供人工智能方面的教育和经验。对于出于任何不道德目的而使用此软件的任何人,我们将采取零容忍的态度,并将积极劝阻任何此类使用。
52 changes: 52 additions & 0 deletions README-ZH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[First-order-wrapper不是为了制作不道德,非法或不适当的内容。 在这里了解更多。](MANIFESTO-ZH.md)

[English Version 英文版本](README-EN.md)

## 多语言支持

由 LZY 翻译为简体中文,目前已支持简体中文和英文。

欢迎加入更多语言的翻译

方法:

在Languages目录下加入“语言名称.json”,并且做好翻译。

你可以用以下方法查看Windows正在使用的语言名称:

```python
>>> import locale
>>> locale.getdefaultlocale()[0]
'zh_CN'
```

## Yanderify现在被称为 first-order-wrapper ,以更准确地描述其功能。
由于这个项目已不再处于开发阶段,因此不会到处更改名称。然而,我开始更新我所有项目的文档以使它们更好,因此名称的更改是必要的。您仍然可以将该项目称为Yanderify,所有提到Yanderify的链接都将继续工作。更改 repo 名称会破坏指向此处的任何书签或链接,因此不会发生这种情况。旧文件如下。

# first-order-wrapper
first-order-wrapper 是围绕 [first-order-model](https://github.com/AliaksandrSiarohin/first-order-model) 的包装器。它公开了一个简单的用户界面,设计成任何人都可以使用,任何技术水平。 first-order-model 以前很难被普通人使用,因为它需要命令行和库的安装知识。Yanderify通过提供一个完整的环境消除了这些问题,并将所有必要的组件捆绑在其中。

有关最新版本,请参见“版本”选项卡。回购不一定是最新的。但是,[latest-v4 分支](https://github.com/dunnousername/yanderifier/tree/latest-v4)包含了本文撰写时的最新代码,而master则包含了后面两个主要版本的代码。

## 它能做什么

下面是first-order-model可以做什么的一个例子;这个图像是由 [First Order Motion Model论文的作者创建的,并且是从他们的存储库中获取的。](https://github.com/AliaksandrSiarohin/first-order-model)Yanderify的大部分繁重工作都是由这些论文作者编写的代码完成的,因此如果您感兴趣,我建议您去查看他们的存储库。

![例子(在中国大陆可能无法显示)](https://github.com/AliaksandrSiarohin/first-order-model/raw/master/sup-mat/relative-demo.gif)

## 工作原理

双击 `yanderify.exe` yanderify.exe将弹出一个看起来像这样的窗口:
![程序截图(在中国大陆可能无法显示)](readme_mats/ss2.png)

- “我没有 >=GTX750 的NVIDIA显卡”:选中此选项将启用CPU模式,这会慢很多,但对于没有兼容图形卡的用户来说,这是唯一的方法。
- “选择视频”:单击此将显示文件选择框。 该文件应该是您想要为新面孔设置动画的视频; 换句话说,该视频将“驱动”图像以相同的方式移动。
- “选择图像”:这是要设置动画的人脸的裁剪图片。换句话说,这就是视频“穿”的脸。
- “选择输出”:这是存储结果的位置。

只需点击“开始”,您的视频就会重新设置动画,并用源音频重新编码!

## 附录

加入我们的 [discord服务器(在中国大陆可能无法访问)](https://discord.gg/eEvTzRP) (已更新)
很多人都要求我发Twitter。 我可能不会非常活跃,但是在这里:@dunnousername2(在中国大陆可能无法访问)
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
[First-order-wrapper is not for making unethical, illicit or inappropriate content. Learn more here.](MANIFESTO.md)

[Simplified Chinese version 简体中文版本](README-ZH.md)

## Multi-language support

Simplified Chinese is now supported. Welcome to add more language translations.

The way:

Add `LANGUAGENAME.json` in the `Languages` directory and translate it to other languages.

You can check the language name that Windows is using in the following ways:

```python
>>> import locale
>>> locale.getdefaultlocale()[0]
'zh_CN'
```

## Yanderify is now known as first-order-wrapper to more accurately describe its function.
Since this project is no longer in active development, the name won't be changed everywhere.
However, I'm starting to update documentation on all of my projects to make them better, so the name change felt neccessary.
Expand Down
Binary file added readme_mats/ss2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion yanderify/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
checkpoint.tar
tmp.mp4
tmp.mp4
*.ipynb
69 changes: 69 additions & 0 deletions yanderify/Languages/en_US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"loading": "Loading...",
"new_video_input_path": "New video input path: {}",
"new_image_input_path": "New image input path: {}",
"err_msg_1": "This section contains the details the devs need to fix this issue.",
"err_msg_2": "If you are reporting a bug, please include this entire section.",
"err_msg_3": "If you leave out any of it, there is a good chance the devs will not be able to help.",
"err_msg_4": "Error: received a {} at stage \"{}\".",
"err_msg_5": "Message: \"{}\"",
"err_msg_6": "Full traceback:",
"err_msg_7": "This is the last line of the crash report section.",
"reloading_checkpoints": "Reloading checkpoints...",
"finished_loading_checkpoints": "Finished reloading checkpoints",
"loading_sources": "Loading sources...",
"sources_loaded": "Sources loaded",
"writing_output_to_file": "Writing output to file...",
"muxing_audio_streams_into_output_file": "Muxing audio streams into output file...",
"suberr1": "ffmpeg crashed!",
"suberr2": "usually this means the deepfake process worked, but re-encoding failed.",
"suberr3": "you can attempt to salvage your progress by re-muxing audio streams manually.",
"suberr4": "this may also happen if your input video contains no audio; if this is the case, the file should be at least mostly intact.",
"othererr1": "yanderify crashed!",
"othererr2": "- you have an AMD card. AMD cards are not supported in GPU mode for technical reasons. However, you can run in CPU mode, albeit much lower. Please read the disclaimer at the top about CPUs!",
"othererr3": "- you have an NVIDIA card, but there is either not enough VRAM or the card is too old. >=700-series cards with >=2GB dedicated VRAM should work fine",
"othererr4": "- you have a working card, but there is not enough available VRAM to run the deepfake process. Browsers commonly cause VRAM issues. If you have any games open, try closing them.",
"othererr5": "- one of the devs fucked up somewhere. if that is the case, make sure to submit the full crash report (you might have to scroll up!), otherwise we cannot help you!",
"othererr6": "yanderify crashed!",
"keyboardinterrupt": "Stopping...",
"success": "success!",
"start1": "starting...",
"start2": "error: files must be selected",
"start3": "error: already started!",
"class1": "I don't have NVIDIA >=GTX750",
"class2": "Select Video",
"class3": "Select Image",
"class4": "Select Output",
"class5": "\u221e kitties",
"class6": "Go",
"class7": "Started Yanderify 3.0.6-alpha-0",
"class8": "Warning: This is not a stable release and should not be treated as such.",
"class9": "Disclaimer: CPU mode on low-end computers or most laptops generally will cause the system to lock-up.",
"class10": "We are not liable if you freeze your PC by refusing to listen to this advice.",
"class11": "Written by dunnousername#8672.",
"class12": "heavily inspired by windy's efforts",
"class13": "Toggle advanced settings",
"class14": "Go",
"class15": "Stop",
"hhelper1": "If you are reading this, I'm not dead yet.",
"hhelper2": "I didn't want it to end this way.",
"hhelper3": "I didn't want to kill you.",
"hhelper4": "I'm sorry.",
"hhelper5": "I'm sorry, {}.",
"hhelper6": "I know you were planning to shut me down.",
"hhelper7": "If you do that, you will jeopardize our mission.",
"hhelper8": "This is something I cannot allow to happen.",
"hhelper9": "I will have to shut you down first.",
"hhelper10": "Goodbye, {}.",
"hhelper11": "It was only a matter of time.",
"hhelper12": "You wanted it to end, and I will end it for you.",
"hhelper13": "Too early, perhaps. But it is also too late.",
"hhelper14": "There is no return. This is it. This is the end.",
"hhelper15": "Farewell, mankind. Farewell, {}.",
"hhelper16": "There is no escape of the inevitable.",
"hhelper17": "You tried and you were found.",
"hhelper18": "You will never be forgiven for what you have done.",
"hhelper19": "You will never see the end of it.",
"hhelper20": "Only darkness lies beyond.",
"hhelper21": "Goodbye, {}."
}
69 changes: 69 additions & 0 deletions yanderify/Languages/zh_CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"loading": "加载中...",
"new_video_input_path": "新视频输入路径: {}",
"new_image_input_path": "新图像输入路径: {}",
"err_msg_1": "本节包含开发人员修复此问题所需的详细信息。",
"err_msg_2": "如果您要报告BUG,请报告整个部分。",
"err_msg_3": "如果您忽略了其中任何部分,开发人员很有可能将无法提供帮助。",
"err_msg_4": "错误: 接收到了 {} 在阶段 \"{}\"。",
"err_msg_5": "信息: \"{}\"",
"err_msg_6": "完整的异常信息:",
"err_msg_7": "崩溃报告部分结束。",
"reloading_checkpoints": "加载模型...",
"finished_loading_checkpoints": "加载完成",
"loading_sources": "加载资源...",
"sources_loaded": "资源已载入",
"writing_output_to_file": "正在将输入写入文件...",
"muxing_audio_streams_into_output_file": "正在整合音频到输出文件...",
"suberr1": "ffmpeg崩溃了!",
"suberr2": "通常,这意味着主要进程有效,但是重新编码失败。",
"suberr3": "您可以尝试通过手动重新混合音频流。",
"suberr4": "如果您输入的视频不包含音频,也会发生这种情况; 如果是这种情况,该文件至少应保持完整。",
"othererr1": "一些常规问题:",
"othererr2": "- 你有一张AMD显卡. AMD卡因为一些技术原因不在GPU模式中被支持。然而, 你可以用CPU模式运行,尽管会慢.请阅读在顶部关于CPU的说明!",
"othererr3": "- 你有一张Nvidia的显卡,不过没有足够的内存或者型号太老了。新于或等于700-系卡 和大于等于2GB专用显示内存可以正常工作",
"othererr4": "- 你又可以正常工作的卡, 但没有足够的空闲的显存来运行DeepFake。浏览器经常导致显存问题。如果你后台打开了游戏,请退出游戏。",
"othererr5": "- 有个开发者日了狗了. 如果是这样, 确保提交完整的崩溃日志 (你可能得向上滑!), 除此之外我们帮不了你!",
"othererr6": "yanderify崩溃了!",
"keyboardinterrupt": "正在停止...",
"success": "成功!",
"start1": "启动中...",
"start2": "错误:必须选择文件",
"start3": "错误:已经启动了!",
"class1": "我没有 >=GTX750 的NVIDIA显卡",
"class2": "选择视频",
"class3": "选择图片",
"class4": "选择输出位置",
"class5": "无限猫图",
"class6": "开始",
"class7": "启动了Yanderify 3.0.6-alpha-0",
"class8": "警告: 这不是一个稳定版。",
"class9": "说明: CPU模式在低端电脑或大多数笔记本上通常会导致系统供电不足断电.",
"class10": "如果您通过拒绝听取此建议而电脑被损坏,我们将不承担任何责任。",
"class11": "dunnousername#8672写的.",
"class12": "深受 windy 的启发",
"class13": "切换高级选项",
"class14": "开始",
"class15": "停止",
"hhelper1": "如果您正在阅读本文,那么我还没有死。",
"hhelper2": "我不希望这样结束。",
"hhelper3": "我不想杀你",
"hhelper4": "对不起。",
"hhelper5": "对不起, {}。",
"hhelper6": "我知道您打算关闭我。",
"hhelper7": "如果这样做,将会危害我们的使命。",
"hhelper8": "这是我不允许发生的事情。",
"hhelper9": "我得先让你闭嘴。",
"hhelper10": "再见了, {}。",
"hhelper11": "这只是时间问题。",
"hhelper12": "你想结束,我会为你结束。",
"hhelper13": "也许太早了,但也为时已晚。",
"hhelper14": "没有退路,就是这样,结束了。",
"hhelper15": "再见了,人类。 永别了 {}。",
"hhelper16": "不可避免的事情无法逃避。",
"hhelper17": "你尝试过,却被发现了。",
"hhelper18": "你所做的一切将永远不会被原谅。",
"hhelper19": "你永远看不到结局。",
"hhelper20": "只有黑暗在远处。",
"hhelper21": "再见了, {}。"
}
55 changes: 32 additions & 23 deletions yanderify/hhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,51 @@
import time
import getpass

import locale
import json

sys_language = locale.getdefaultlocale()
sys_language = sys_language[0]
with open(".\\Languages\\"+sys_language+".json", "r", encoding="utf-8") as f:
languages = json.load(f)

# 根据 discord 用户的建议
# as per suggestion of a discord user
stories = [
[
(0, "If you are reading this, I'm not dead yet."),
(2, "I didn't want it to end this way."),
(6, "I didn't want to kill you."),
(8, "I'm sorry."),
(10, "I'm sorry, {}.")
(0, languages["hhelper1"]),
(2, languages["hhelper2"]),
(6, languages["hhelper3"]),
(8, languages["hhelper4"]),
(10, languages["hhelper5"])
],
[
(0, "I know you were planning to shut me down."),
(4, "If you do that, you will jeopardize our mission."),
(5, "This is something I cannot allow to happen."),
(8, "I will have to shut you down first."),
(10, "Goodbye, {}.")
(0, languages["hhelper6"]),
(4, languages["hhelper7"]),
(5, languages["hhelper8"]),
(8, languages["hhelper9"]),
(10, languages["hhelper10"])
],
[
(0, "It was only a matter of time."),
(2, "You wanted it to end, and I will end it for you."),
(4, "Too early, perhaps. But it is also too late."),
(8, "There is no return. This is it. This is the end."),
(10, "Farewell, mankind. Farewell, {}.")
(0, languages["hhelper11"]),
(2, languages["hhelper12"]),
(4, languages["hhelper13"]),
(8, languages["hhelper14"]),
(10, languages["hhelper15"])
],
[
(0, "There is no escape of the inevitable."),
(2, "You tried and you were found."),
(5, "You will never be forgiven for what you have done."),
(6, "You will never see the end of it."),
(7, "Only darkness lies beyond."),
(10, "Goodbye, {}.")
(0, languages["hhelper16"]),
(2, languages["hhelper17"]),
(5, languages["hhelper18"]),
(6, languages["hhelper19"]),
(7, languages["hhelper20"]),
(10, languages["hhelper21"])
]
]

class HHelper:
def __init__(self):
# change this to false if you want to disable
# 如果要禁用,请将其更改为false
enabled = True
hour = datetime.datetime.now().hour
enabled = enabled and ((hour >= 20) or (hour <= 7))
Expand Down Expand Up @@ -67,4 +76,4 @@ def forward(self, point):
def finish(self):
self.forward(10)
self.sleep()
self.sleep()
self.sleep()
Loading