您现在的位置是:热点 >>正文
20分钟,这个AI就能创造复杂艺术作品!1080显卡就能跑
热点7568人已围观
简介...
本文经AI新媒体量子位(公众号ID:QbitAI)授权转载,转载请联系出处。
20分钟生成复杂的艺术作品,而且还是用英伟达上上代的1080显卡?
现在神经网络上手门槛这么亲民了吗?
没错,这是一个叫做neural-style-pt的风格迁移模型,基于Pytorch实现,而且20刚刚开源!
有关这个算法模型的话题在Reddit上才发布一天,热度接近2000。
neural-style-pt,真的酷炫又亲民吗?
丰富的融合方式
neural-style-pt是论文A Neural Algorithm of Artistic Style的Pytorch实现。
论文介绍了分钟一种利用卷积神经网络将一张图片的内容,与另一张图片的风格相结合的算法,就是我们熟知的“风格迁移”网络。
比如,将《星空》的艺术风格映射到一张斯坦福校园的夜景照片上:
或者根据给定图像的不同艺术风格,分别融合进目标图片:
除了“分别”融合,还能把多个艺术风格融进一张图片:
从左上角,这顺时针开始风格分别为”星空 “+”呐喊”、”呐喊 “+”构图七(瓦西里·康定斯基油画)“、”坐着的裸女(莫蒂里安尼油画) “+”构图七”、”坐着的裸体 “+”星空”。
在进行风格迁移时,添加“-original_colors 1”指令,还可以只改变风格,不改变原图颜色:
10个A80卡就能跑?
根据后台和优化器的不同,算法运行速度会有很大差异。
在Tesla K80上使用512像素图片迭代500次时间参考:
后台nn、优化器L-BFGS: 117秒 后台nn、优化器 ADAM: 100秒 后台cudnn -优化器L-BFGS: 124秒 后台cudnn -优化器ADAM:10I就7秒 后台cudnn -cudnn_autotune -优化器L-BFGS: 109秒 后台cudnn -cudnn_autotune -优化器ADAM: 91秒
而在GTX 1080上,相同基准下时间更快:
后端nn -优化器L-BFGS: 56秒 后台nn -优化器 ADAM: 38秒 后台cudn能创n -优化器L-BFGS: 40秒 后台cudnn -优化器ADAM:40秒 后台cudnn -cudnn_autotune -优化器 lbfgs: 23秒 后台cudnn -cudnn_autotune -优化器ADAM: 24秒
结合当下1080卡的售价,不得不说,这样的门槛,对于机器学习来说,已经很造复香了。
默认情况下,neural-style-pt使用后端进行卷积,L-BFGS进行优化。但会使用大量的内存,可以通过以下方法来减少内存的使用。
使用cuDNN,添加-backend cudnn来使用cuDNN后端。而使用ADAM时,添加-optimizer adam来使用ADAM而不杂艺是L-BFGS。
在默认设置下,neural-style-pt在系统上使用了大约3.7GB的GPU内存;切换到ADAM和cuDNN可以将GPU内存占用减少到大约1GB。
如何上手试玩
安装neural-style-pt,首先要准备好Pytorch。
然后,使用下方一句话指令就能安装已经术作训练好的模型:
python models/download_models.py
安装完以后,上手试玩也很简单,一行代码就能实现:
python neural_style.py -style_image-content_image&品!nbsp;
如果要载入多种风格,需要分隔不同的图片文件名:
-style_image starry_night.jpg,the_scream.jpg
注意,图片名称要包含完整的地址路径。
基本操作就是这些。
neural-style-pt还有一点强大的功能,就10是可以使用多个不同的计算设备来处理高分辨率图像。
不同的设备会输出不同网络层的计算结果。
你可以用-gpu指令控制使用哪些GPU和CPU设备,你也可以用-multidevice_strategy控制如何在不同设备上分割层。
例如,在一个有四个GPU的服务器中,指令“-gpu 0,180,2,3”,指按顺序在GPU 0、1、2和3上进行处理。
同时给出 -multidevice_strategy 3,6,12指令,表示前两层应该在GPU 0上计算,第3到5层应该在GPU 1上计算,第6到11层应该在GPU 2上计算,其余的层应该在GPU 3上计算。
根据你的需求调整-mul显卡tidevice_strategy,可以达到输出的最大分辨率。
下面是一张4016x2213分辨率图像,是在使用8个Tesla K80 GPU的服务器上生成的:
1080显卡入门,还能“分布式”计算,这么酷炫好玩低门槛的风格迁移网络,赶快来试试吧~
传送门:
https://gith就能ub.com/ProGamerGov/neural-style-pt
Tags:
相关文章
标签: 联想集团 Infinidat 企业级存储 AI数据基础设施
热点云梦级4月10日云梦级消息,2026年4月9日,联想集团(HKSE:992)(ADR:LNVGY)正式宣布,已完成对全球高端企业级存储解决方案提供商Infinidat的收购。本次交易将巩固联想在企业存...
【热点】
阅读更多标签: 小米通话 米聊 王化 小爱音响
热点云梦级11月6日云梦级消息,小米通话将于 2025 年 12 月 3 日停止服务,引发网友热议。 对此,小米公关负责人王化今日表示:不知道还有多少老米粉记得,2010 年 12 月 10 日发布的米聊...
【热点】
阅读更多Google Gemini CLI开放第三方扩展:Figma和Stripe率先入驻,命令行AI迎来生态之战
热点命令行AI工具的竞争正在升温。Google在周三正式为其命令行AI系统Gemini CLI推出了一项新功能,允许外部公司直接集成到这款AI产品中。这个名为Gemini CLI Extensions的功...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://m.shoppinghow.kakao.com/m/search/q/谷歌霸屏外推技术【tg:seogoogle987】fOQ
- https://dict.naver.com/dict.search?dicQuery&query=谷歌霸屏外推技术【tg:seogoogle987】rsC
- https://www.vet-direct.com/search?cat=72&term=谷歌霸屏外推技术【tg:seogoogle987】,Syl
- https://www.rea.govt.nz/search?searchterm=谷歌霸屏外推技术【tg:seogoogle987】,yy5
- https://www.zalora.sg/catalog/?cat=112&q=谷歌霸屏外推技术【tg:seogoogle987】,5I6
- https://www.tarleton.edu/?s=谷歌霸屏外推技术【tg:seogoogle987】,thb
- https://www.kores.com/?s=谷歌霸屏外推技术【tg:seogoogle987】,f7t
- https://www.youthforum.org/search-results?cx=4f5236218ab5e8ef9&ie=UTF-8&q=谷歌霸屏外推技术【tg:seogoogle987】,RUU
- https://www.resopal.de/catalogsearch/result/?action=SEARCH&q=谷歌霸屏外推技术【tg:seogoogle987】,SoB
- https://jihoon471.cafe24.com/product/search.html?banner_action=&keyword=谷歌霸屏外推技术【tg:seogoogle987】6sa
- https://www.welshmountainzoo.org/shop/index.php?routeproduct/search&tag=谷歌霸屏外推技术【tg:seogoogle987】,i1p
- https://www.whiterock2008.com.tw/search?q=谷歌霸屏外推技术【tg:seogoogle987】,z7t
- https://www.kuaikanmanhua.com/sou/谷歌霸屏外推技术【tg:seogoogle987】,4xA
- https://www.sic-info.org/en/?s=谷歌霸屏外推技术【tg:seogoogle987】,2gj
- https://www.southmeadows.co.uk/2019/07/?s=谷歌霸屏外推技术【tg:seogoogle987】,6ED
- https://www.nyif.com/catalogsearch/result/?q=谷歌霸屏外推技术【tg:seogoogle987】,LuH
- https://blvdseafood.com/?s=谷歌霸屏外推技术【tg:seogoogle987】kDz
- https://www.nslcleaders.org/?s=谷歌霸屏外推技术【tg:seogoogle987】,jg1
- https://www.kubb-tool.bfs.admin.ch/en/search?action=CHECK&q=谷歌霸屏外推技术【tg:seogoogle987】,I8E
- https://www.kawainter.com/catalogsearch/result/?q=谷歌霸屏外推技术【tg:seogoogle987】,fli
- https://www.universal-music.co.jp/search/?q=谷歌霸屏外推技术【tg:seogoogle987】,mS5
- https://store.line.me/search/sticker/ja?q=谷歌霸屏外推技术【tg:seogoogle987】0M7
- https://www.terramania.nl/catalogsearch/result/index/?q=谷歌霸屏外推技术【tg:seogoogle987】,BT5
- https://www.roberthalf.com/us/en/jobs/all/谷歌霸屏外推技术【tg:seogoogle987】gBe
- https://www.remit.co.jp/en/?s=谷歌霸屏外推技术【tg:seogoogle987】,WYs
- https://www.flickr.com/photos/tags/谷歌霸屏外推技术【tg:seogoogle987】laQ
- https://www.yidian51.com/taobao/谷歌霸屏外推技术【tg:seogoogle987】,5sF
- https://www.goodreads.com/quotes/tag/谷歌霸屏外推技术【tg:seogoogle987】2q2
- https://www.kissthekangaroo.com.au/index.php?route=product/search&tag=谷歌霸屏外推技术【tg:seogoogle987】,MAT
- https://www.therapeuticassociates.com/?cat=5&s=谷歌霸屏外推技术【tg:seogoogle987】,LEF
- https://www.quarterjacksurgery.co.uk/?AT=3rBy&s=谷歌霸屏外推技术【tg:seogoogle987】,DQR
- https://www.sbaad.no/search/谷歌霸屏外推技术【tg:seogoogle987】,MWv
- https://www.urmc.rochester.edu/news/search?q=谷歌霸屏外推技术【tg:seogoogle987】,r3G
- https://www.tailoy.com.pe/catalogsearch/result/?q=谷歌霸屏外推技术【tg:seogoogle987】,Ols
- https://store.line.me/search/sticker/ja?q=谷歌霸屏外推技术【tg:seogoogle987】QtY
- https://www.zutari.com/?s=谷歌霸屏外推技术【tg:seogoogle987】,F84
- https://search.danawa.com/dsearch.php?query=谷歌霸屏外推技术【tg:seogoogle987】T62
- https://www.impactpool.org/search/?type=79&q=谷歌霸屏外推技术【tg:seogoogle987】0ng
- https://www.resilienz-akademie.com/?cat=71&s=谷歌霸屏外推技术【tg:seogoogle987】,Kyb
- https://www.mintos.org/?s=谷歌霸屏外推技术【tg:seogoogle987】,816
- https://www.seforall.org/search?keywords=谷歌霸屏外推技术【tg:seogoogle987】,L1V
- https://www.televes.com/es/catalogsearch/result/?q=谷歌霸屏外推技术【tg:seogoogle987】,wpz
- https://www.ng-slo.si/si/iskanje?cat=114&q=谷歌霸屏外推技术【tg:seogoogle987】,km0
- https://hsmoa.com/search?query=谷歌霸屏外推技术【tg:seogoogle987】Gs3
- https://www.remit.co.jp/zh/?s=谷歌霸屏外推技术【tg:seogoogle987】,6Av
- https://www.nss.nhs.scot/search?q=谷歌霸屏外推技术【tg:seogoogle987】,iSs
- https://www.nonsolocap.it/cap?action=SEARCH&k=谷歌霸屏外推技术【tg:seogoogle987】,Wck
- https://www.tombow.com/en/search/谷歌霸屏外推技术【tg:seogoogle987】,0Vm
- https://www.reginatangoshoes.com/en/catalogsearch/result/index/?T=1686132113407&q=谷歌霸屏外推技术【tg:seogoogle987】,h9S
- https://www.remit.co.jp/vi/?s=谷歌霸屏外推技术【tg:seogoogle987】9a1