1,  打开chrome浏览器,输入以下网址,打开风格转换主文件

https://colab.research.google.com/github/Hvass-Labs/TensorFlow-Tutorials/blob/master/15_Style_Transfer.ipynb#scrollTo=kY73hwnafCwF

可能会有点慢,因为要加载的环境较多。打开后界面如下:

2,  修改设置,使用GPU

3,  导入依赖文件

因为15_Style_Transfer.ipynb依赖vgg16模型,需要导入github上的整个项目文件到colab缓存。

点击“+代码”,输入以下命令

!git clone https://github.com/Hvass-Labs/TensorFlow-Tutorials.git

运行完毕后,可以看到当前目录下多了个TensorFlow-Tutorials子目录。

4,  切换工作目录

为了当前笔记本文件能正确找到vgg16.py文件,需要切换当前目录到TensorFlow-Tutorials目录。

5,  运行

光标定位到imports段,按ctrl+F10,运行其后所有代码。整个过程需要约3分钟左右。其中绝大部分时间花在vgg16模型文件的下载上,共550M大小。

部分输出如下:

tf.__version__

'1.13.0-rc2'

6,  如何合成一张自己的图片?

首先,将图片上传网络,记下地址,然后采用wget下载到当前目录

!wget https://files-cdn.cnblogs.com/files/jackkwok/me.bmp

然后,修改content_filename 为刚导入的文件。

由于照片尺寸较大,达5M多,因此运行时间稍长。

CPU times: user 1min 2s, sys: 31.8 s, total: 1min 34s

Wall time: 2min

在colab上运行style-transfer的更多相关文章

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

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

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

  3. [C4W4] Convolutional Neural Networks - Special applications: Face recognition & Neural style transfer

    第四周:Special applications: Face recognition & Neural style transfer 什么是人脸识别?(What is face recogni ...

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

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

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

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

  6. Perceptual Losses for Real-Time Style Transfer and Super-Resolution and Super-Resolution 论文笔记

    Perceptual Losses for Real-Time Style Transfer and Super-Resolution and Super-Resolution 论文笔记 ECCV 2 ...

  7. pytorch实现style transfer

    说是实现,其实并不是我自己实现的 亮出代码:https://github.com/yunjey/pytorch-tutorial/tree/master/tutorials/03-advanced/n ...

  8. 在Linux服务器上运行Jupyter notebook server教程

    在Linux服务器上运行Jupyter notebook server教程 很多deep learning教程都推荐在jupyter notebook运行python代码,方便及时交互.但只在本地运行 ...

  9. 在Web上运行Linux—js/linux模拟器

    一个叫Fabrice Bellard 的程序员写了一段Javascript在Web浏览器中启动Linux(原网页,我把这个网页iframe在了下面),目前,你只能使用Firefox 4和Chrome ...

随机推荐

  1. 微信小程序服务类目大坑:特殊行业服务类目所需资质材料

    作为一个技术开发人员,遇到特殊行业服务类目所需资质材料,只能叫苦连天了,妈的,这个不是技术可以解决的问题,如果技术可以解决的问题都不是问题. 百牛信息技术bainiu.ltd整理发布于博客园 特殊行业 ...

  2. Collection View Programming Guide for iOS---(一)----About iOS Collection Views

    Next About iOS Collection Views 关于iOS Collection Views A collection view is a way to present an orde ...

  3. UT源码 045

    (3)设计佣金问题的程序 commission方法是用来计算销售佣金的需求,手机配件的销售商,手机配件有耳机(headphone).手机壳(Mobile phone shell).手机贴膜(Cellp ...

  4. ARM汇编中ldr伪指令和ldr指令(转载)

    转自:http://blog.csdn.net/ce123_zhouwei/article/details/7182756 ARM是RISC结构,数据从内存到CPU之间的移动只能通过L/S指令来完成, ...

  5. Oracle Function INSTR

    INSTR(string,subString,position,ocurrence)查找字符串位置 解释:      string:字符串      subString:要查找的子字符串      p ...

  6. C#SuperSocket的搭建--通过配置启动

    之前我们借助一个SuperSocket实现了一个简易版的服务器, 但是不管是Server还是Session都是使用框架的,本篇博客我们要实现自己的Server和Session,来重写框架原生的Serv ...

  7. bzoj 3745: [Coci2015]Norma【分治】

    参考:https://blog.csdn.net/lych_cys/article/details/51203960 真的不擅长这种-- 分治,对于一个(l,r),先递归求出(l,mid),(mid+ ...

  8. 6.while循环正向反向打印一句话

    message = "伤情最是晚凉天,憔悴厮人不堪言."' count=0 num=-1 while count<len(message): print(message[co ...

  9. 重装 Cloudera CDH 5,启动oozie 出错处理

    参考文章:http://community.cloudera.com/t5/Cloudera-Manager-Installation/Error-CDH5-oozie/td-p/8686 按照文章说 ...

  10. 求导四则运算以及三角函数求导 Derivative formulas

    对特定函数的求导. 1:sin(x) 对其进行求斜率.带入公式得:[ sin(x+Δx)- sin(x)]/Δx  = [ sinx*cosΔx + cosx*sinΔx -sin x ]/ Δx = ...