【图片】机器学习--名画风格 neural-style
neural-style
学习画作风格,将风格施加到另外一张图片中
例如将名画《星夜》的风格施加到一副建筑照片中:

源码 https://github.com/jcjohnson/neural-style
安装步骤:
1.torch7
2.loadcaff
torch7的安装详见 前文:开源 人脸识别 openface 实用介绍 实例演示 训练自己的模型
loadcaff的安装:
sudo apt-get install libprotobuf-dev protobuf-compiler
git clone https://github.com/szagoruyko/loadcaffe.git
cd loadcaffe
luarocks install loadcaffe-1.0-.rockspec
neural-style的安装:
git clone https://github.com/jcjohnson/neural-style.git
cd neural-style
sh models/download_models.sh
经过第三步,下载好模型之后就可以运行了。注意,内存占用较大,一定要有足够内存否则不能运行,建议分配9GB内存,虚拟机宿主机最好有16GB内存。
试运行:使用CPU模式(-gpu -1),此时cpu核心全开,cpu核数越多越快,4核3.3GHz 跑完一次大约需要40分钟。
th neural_style.lua -gpu - -print_iter
基本功能:使用style_image作为风格,content_image为等待修改图片,程序会自动合成第三张图片。
th neural_style.lua -gpu - -print_iter -style_image <image.jpg> -content_image <image.jpg>
网上找了一张川普的动感图:

给女神施加一下:

结果:

=========完=========
2017年4月16日
【图片】机器学习--名画风格 neural-style的更多相关文章
- fast neural style transfer图像风格迁移基于tensorflow实现
引自:深度学习实践:使用Tensorflow实现快速风格迁移 一.风格迁移简介 风格迁移(Style Transfer)是深度学习众多应用中非常有趣的一种,如图,我们可以使用这种方法把一张图片的风格“ ...
- 神经风格转换Neural Style Transfer a review
原文:http://mp.weixin.qq.com/s/t_jknoYuyAM9fu6CI8OdNw 作者:Yongcheng Jing 等 机器之心编译 风格迁移是近来人工智能领域内的一个热门研究 ...
- 项目总结四:神经风格迁移项目(Art generation with Neural Style Transfer)
1.项目介绍 神经风格转换 (NST) 是深部学习中最有趣的技术之一.它合并两个图像, 即 内容图像 C(content image) 和 样式图像S(style image), 以生成图像 G(ge ...
- 【原创】梵高油画用深度卷积神经网络迭代十万次是什么效果? A neural style of convolutional neural networks
作为一个脱离了低级趣味的码农,春节假期闲来无事,决定做一些有意思的事情打发时间,碰巧看到这篇论文: A neural style of convolutional neural networks,译作 ...
- 【原创】梵高油画用深度卷积神经网络迭代10万次是什么效果? A neural style of convolutional neural networks
作为一个脱离了低级趣味的码农,春节假期闲来无事,决定做一些有意思的事情打发时间,碰巧看到这篇论文: A neural style of convolutional neural networks,译作 ...
- 在Docker中运行torch版的neural style
相关的代码都在Github上,请参见我的Github,https://github.com/lijingpeng/deep-learning-notes 敬请多多关注哈~~~ 在Docker中运行to ...
- DeepLearning.ai-Week4-Deep Learning & Art: Neural Style Transfer
1 - Task Implement the neural style transfer algorithm Generate novel artistic images using your alg ...
- 课程四(Convolutional Neural Networks),第四 周(Special applications: Face recognition & Neural style transfer) —— 2.Programming assignments:Art generation with Neural Style Transfer
Deep Learning & Art: Neural Style Transfer Welcome to the second assignment of this week. In thi ...
- Neural Style论文笔记+源码解析
引言 前面在Ubuntu16.04+GTX1080配置TensorFlow并实现图像风格转换中介绍了TensorFlow的配置过程,以及运用TensorFlow实现图像风格转换,主要是使用了文章A N ...
随机推荐
- jQuery插件实现表格隔行换色且感应鼠标高亮行变色
实现表格隔行换色,且感应鼠标行变色的方法有很多,在本文将为大家介绍的是使用jQuery插件来实现,具体如下 看代码: : css代码:
- vim 强大复制链接
参考文献: http://blog.csdn.net/xiyuan1999/article/details/5680102 vi编辑器中的整行(多行)复制与粘贴就非常必要了. 1.复制 1)单行复制 ...
- HDU2043 密码
解题思路:10分钟AC,不解释,so easy! #include<cstdio> #include<cstring> #include<algorithm> us ...
- iOS UIWebView 中 js调用OC 打开相册 获取图片, OC调用js 将图片加载到html上
线上html <!DOCTYPE html> <html> <head> <title>HTML中用JS调用OC方法</title> < ...
- Java Web 减少网络 IO、静态资源磁盘 IO 有效的办法--响应使用 GZIP( 压缩http请求与响应gzip压缩)
(转载http://blog.csdn.net/hylclxy/article/details/7779662) 出于节约流量考虑, 客户端在向服务端发送request的时候对post数据进行gzip ...
- POJ2185 Milking Grid 【lcm】【KMP】
Description Every morning when they are milked, the Farmer John's cows form a rectangular grid that ...
- Python3.x time模块
python中,我们会用到很多和时间相关的操作.下面就来看看时间的模块的作用. 使用相应功能需要导入time模块 import time time模块方法: asctime(p_tuple=None) ...
- 《DSP using MATLAB》示例 Example6.7
代码: M = 32; alpha = (M-1)/2; magHk = [1, 1, 1, 0.5, zeros(1, 25), 0.5, 1, 1]; k1 = 0:15; k2 = 16:M-1 ...
- [LOJ6261]一个人的高三楼
loj description 给你一个长度为\(n\)的数列\(a_i\),求它的\(k\)次前缀和模\(998244353\).(就是做\(k\)次前缀和后的数列) \(n\le10^5,k\le ...
- eclipse安装最新版svn
1.下载最新的Eclipse,我的版本是3.7.2 indigo(Eclipse IDE for Java EE Developers)版 如果没有安装的请到这里下载安装:http://ecli ...