big sleep
0.9.1
人工智能
宇宙的爱和关注
天空中的火
冰金字塔
树林里一栋孤独的房子
山里结婚
雾蒙蒙的墓地里,一棵树上挂着灯笼
一个生动的梦
城市废墟上空的气球
孤独的天文学家之死——莫拉奇
与自己永恒对话的悲惨亲密——作者:moirage
恶魔之火- by WiseNat
Ryan Murdock 再次做到了这一点,结合了 OpenAI 的 CLIP 和 BigGAN 的生成器!这个存储库总结了他的工作,因此拥有 GPU 的任何人都可以轻松访问。
您将能够通过终端中的一行命令使用自然语言让 GAN 想象出图像。
原装笔记本
简化笔记本
用户制作的笔记本,修复了错误并添加了功能,例如谷歌驱动器集成
$ pip install big-sleep
$ dream " a pyramid made of ice "
图像将保存到调用命令的任何位置
您可以在代码中调用它
from big_sleep import Imagine
dream = Imagine (
text = "fire in the sky" ,
lr = 5e-2 ,
save_every = 25 ,
save_progress = True
)
dream ()
您现在可以使用分隔符“|”训练多个短语
在此示例中,我们训练三个短语:
an armchair in the form of pikachu
an armchair imitating pikachu
abstract
from big_sleep import Imagine
dream = Imagine (
text = "an armchair in the form of pikachu|an armchair imitating pikachu|abstract" ,
lr = 5e-2 ,
save_every = 25 ,
save_progress = True
)
dream ()
在这个例子中,我们训练之前的三个短语,
并惩罚以下短语:
blur
zoom
from big_sleep import Imagine
dream = Imagine (
text = "an armchair in the form of pikachu|an armchair imitating pikachu|abstract" ,
text_min = "blur|zoom" ,
)
dream ()
您还可以使用.set_text(<str>)
命令设置新文本
dream . set_text ( "a quiet pond underneath the midnight moon" )
并使用.reset()
重置潜在变量
dream . reset ()
要在训练期间保存图像的进度,您只需提供--save-progress
标志
$ dream " a bowl of apples next to the fireplace " --save-progress --save-every 100
由于 GAN 的类条件性质,Big Sleep 通常会避开流形而陷入噪声。您可以使用标志将最佳高分图像(根据 CLIP 评论家)保存到文件夹中的{filepath}.best.png
。
$ dream " a room with a view of the ocean " --save-best
如果你有足够的内存,你也可以尝试使用OpenAI发布的更大的视觉模型来改进世代。
$ dream " storm clouds rolling in over a white barnyard " --larger-model
您可以使用--max-classes
标志设置希望限制 Big Sleep 用于 Big GAN 的类别数量,如下所示(例如 15 个类别)。这可能会导致训练期间额外的稳定性,但代价是失去表达能力。
$ dream ' a single flower in a withered field ' --max-classes 15
Deep Daze - CLIP 和深度 SIREN 网络
@misc { unpublished2021clip ,
title = { CLIP: Connecting Text and Images } ,
author = { Alec Radford, Ilya Sutskever, Jong Wook Kim, Gretchen Krueger, Sandhini Agarwal } ,
year = { 2021 }
}
@misc { brock2019large ,
title = { Large Scale GAN Training for High Fidelity Natural Image Synthesis } ,
author = { Andrew Brock and Jeff Donahue and Karen Simonyan } ,
year = { 2019 } ,
eprint = { 1809.11096 } ,
archivePrefix = { arXiv } ,
primaryClass = { cs.LG }
}