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的更多相关文章

  1. fast neural style transfer图像风格迁移基于tensorflow实现

    引自:深度学习实践:使用Tensorflow实现快速风格迁移 一.风格迁移简介 风格迁移(Style Transfer)是深度学习众多应用中非常有趣的一种,如图,我们可以使用这种方法把一张图片的风格“ ...

  2. 神经风格转换Neural Style Transfer a review

    原文:http://mp.weixin.qq.com/s/t_jknoYuyAM9fu6CI8OdNw 作者:Yongcheng Jing 等 机器之心编译 风格迁移是近来人工智能领域内的一个热门研究 ...

  3. 项目总结四:神经风格迁移项目(Art generation with Neural Style Transfer)

    1.项目介绍 神经风格转换 (NST) 是深部学习中最有趣的技术之一.它合并两个图像, 即 内容图像 C(content image) 和 样式图像S(style image), 以生成图像 G(ge ...

  4. 【原创】梵高油画用深度卷积神经网络迭代十万次是什么效果? A neural style of convolutional neural networks

    作为一个脱离了低级趣味的码农,春节假期闲来无事,决定做一些有意思的事情打发时间,碰巧看到这篇论文: A neural style of convolutional neural networks,译作 ...

  5. 【原创】梵高油画用深度卷积神经网络迭代10万次是什么效果? A neural style of convolutional neural networks

    作为一个脱离了低级趣味的码农,春节假期闲来无事,决定做一些有意思的事情打发时间,碰巧看到这篇论文: A neural style of convolutional neural networks,译作 ...

  6. 在Docker中运行torch版的neural style

    相关的代码都在Github上,请参见我的Github,https://github.com/lijingpeng/deep-learning-notes 敬请多多关注哈~~~ 在Docker中运行to ...

  7. DeepLearning.ai-Week4-Deep Learning & Art: Neural Style Transfer

    1 - Task Implement the neural style transfer algorithm Generate novel artistic images using your alg ...

  8. 课程四(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 ...

  9. Neural Style论文笔记+源码解析

    引言 前面在Ubuntu16.04+GTX1080配置TensorFlow并实现图像风格转换中介绍了TensorFlow的配置过程,以及运用TensorFlow实现图像风格转换,主要是使用了文章A N ...

随机推荐

  1. apk系统签名命令

    java -jar signapk.jar platform.x509.pem platform.pk8 D:/ClockSetting.apk D:/ClockSettingSigned.apk 需 ...

  2. JNative用法注意事项

    公司要做个跟设备打交道的web系统,需要java调用dll.搞java的同事说JNative看起来挺好使的,找俺帮忙调通.用的是1.3.1版本 环境设置. JNative的调试信息需要打开才能更清楚些 ...

  3. 快速排序的partition版本实现

    int partition(int arr[], int low, int high) { int pivot = arr[high]; int i = low-1; for (int j = low ...

  4. [译]贵宾犬咬伤了TLS

    原文链接:https://community.qualys.com/blogs/securitylabs/2014/12/08/poodle-bites-tls 原文发表时间:2014.12.8 今天 ...

  5. MVC 页面间的传值

    关于MVC页面之间的传值,有多种方式,下面,我们就Html.RenderAction 方式 和 Html.RenderPartial 方式 来给大家分享一下有什么不同. 一.Html.RenderAc ...

  6. 使用Costura.Fody将源DLL合并到目标EXE

    本文为原创文章,如转载,请在网页明显位置标明原文名称.作者及网址,谢谢! 一.本文主要是使用Costura.Fody工具将源DLL合并到目标EXE,因此,需要从以下任一链接下载: ①从Github地址 ...

  7. 14.Python使用Pillow教程

    1.打算开始学习PIL,在命令行输入:pip3 install PIL,报错信息如下所示,后百度了下,发现:PIL仅支持到Python2.7,后来一群志愿者在此基础上创建了兼容性版本,为Pillow, ...

  8. jeecg中选择的数据字典

    <t:dictSelect field="fjingji" hasLabel="false" typeGroupCode="fjingji&qu ...

  9. 许多人问:FPGA是什么?

    菇凉提问: 做FPGA开发多年,每次菇凉问我,什么是FPGA,我,我,我,不知道如何说起,难以回答. FPGA是一种器件.其英文名 feild programable gate array . 通俗来 ...

  10. Java中的三元运算:a = (a > b)?a:b

    格式:逻辑值 ? 表达式1 : 表达式2 执行顺序:先执行逻辑值,如果逻辑值为true,则执行表达式1:反之则执行表达式2 a = (a > b)?a:b 如果a>b成立,返回a: 如果a ...