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. (android 地图实战开发)2 创建MapActivity,根据设备当前位置,显示地图

    (android 地图实战开发)2 创建MapActivity,根据设备当前位置,显示地图 http://www.cnblogs.com/macroxu-1982/archive/2011/09/13 ...

  2. 【老生常谈】Attr与Prop的区别

    “你为什么要做一个程序员?”,“因为我有一颗改变世界的心!”,“说人话”,“因为我没朋友...” -------------纯属娱乐 ================================= ...

  3. Encode Adjacent Letters

    Encode a string by counting the consecutive letter. (i.e., "aaaabbxxxyyz" might become &qu ...

  4. 写一个Python的windows服务

    1. 安装pywin32和pyinstaller pip install pywin32 pip install pyinstaller 2.写一个服务Demo # -*- coding: utf-8 ...

  5. HihoCoder1049 后序遍历 分治水题

    水题,是为了给难题(树形DP)做铺垫 描述 在参与过了美食节之后,小Hi和小Ho在别的地方又玩耍了一阵子,在这个过程中,小Ho得到了一个非常有意思的玩具——一棵由小球和木棍连接起来的二叉树! 小Ho对 ...

  6. Java并发--进程与线程由来

    下面是本文的目录大纲: 一.操作系统中为什么会出现进程? 二.为什么会出现线程? 三.多线程并发 一.操作系统中为什么会出现进程? 说起进程的由来,我们需要从操作系统的发展历史谈起. 也许在今天,我们 ...

  7. DVD项目

    package sy.com.cn;import java.util.*; public class DvdWorker { public static void main(String[]args) ...

  8. win32 去掉窗口边框

    参考:http://www.blitzbasic.com/Community/posts.php?topic=67222 Strict Graphics 320, 200 SetClsColor 0, ...

  9. 基于jquery的可查询多级select控件(可记录历史选择)

    一.功能和使用 公司有功能需求,还要一条代码引入的控件,网上找完全符合的控件比较难,寻找所花的时间还不如自己写一个,所以找个空闲时间自己写了一个   控件功能:1.可手动输入查询,也可点击下拉框查询, ...

  10. Cache应用中的服务过载案例研究

    https://tech.meituan.com/avalanche-study.html