在colab上运行style-transfer
1, 打开chrome浏览器,输入以下网址,打开风格转换主文件
可能会有点慢,因为要加载的环境较多。打开后界面如下:

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的更多相关文章
- 课程四(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 ...
- fast neural style transfer图像风格迁移基于tensorflow实现
引自:深度学习实践:使用Tensorflow实现快速风格迁移 一.风格迁移简介 风格迁移(Style Transfer)是深度学习众多应用中非常有趣的一种,如图,我们可以使用这种方法把一张图片的风格“ ...
- [C4W4] Convolutional Neural Networks - Special applications: Face recognition & Neural style transfer
第四周:Special applications: Face recognition & Neural style transfer 什么是人脸识别?(What is face recogni ...
- 神经风格转换Neural Style Transfer a review
原文:http://mp.weixin.qq.com/s/t_jknoYuyAM9fu6CI8OdNw 作者:Yongcheng Jing 等 机器之心编译 风格迁移是近来人工智能领域内的一个热门研究 ...
- DeepLearning.ai-Week4-Deep Learning & Art: Neural Style Transfer
1 - Task Implement the neural style transfer algorithm Generate novel artistic images using your alg ...
- 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 ...
- pytorch实现style transfer
说是实现,其实并不是我自己实现的 亮出代码:https://github.com/yunjey/pytorch-tutorial/tree/master/tutorials/03-advanced/n ...
- 在Linux服务器上运行Jupyter notebook server教程
在Linux服务器上运行Jupyter notebook server教程 很多deep learning教程都推荐在jupyter notebook运行python代码,方便及时交互.但只在本地运行 ...
- 在Web上运行Linux—js/linux模拟器
一个叫Fabrice Bellard 的程序员写了一段Javascript在Web浏览器中启动Linux(原网页,我把这个网页iframe在了下面),目前,你只能使用Firefox 4和Chrome ...
随机推荐
- iOS NSString拼接字符串
NSString* str_C; // 结果字符串NSString* str_A, str_B; //已存在的字符串,需要将str_A和str_B连接起来 //方法1 str_C = [NSStrin ...
- codeforces 459 A. Pashmak and Garden 解题报告
题目链接:http://codeforces.com/problemset/problem/459/A 题目意思:给出两个点的坐标你,问能否判断是一个正方形,能则输出剩下两点的坐标,不能就输出 -1. ...
- ZOJ 3706 Break Standard Weight 解题报告
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5009 题目意思:给出两个mass:x 和 y,问如何将其中一个 ma ...
- 老毛桃U盘启动盘,通过ghost创建xp系统蓝屏问题
新买的东芝笔记本只预安装了dos,找来一个老毛桃U盘启动盘,进入winpe用ghost恢复成xp系统:重启后,系统蓝屏,提示的主要报错代码 0x0000007B 与 要求“chkdsk /f”处理. ...
- hiho Mission Impossible 6(模拟 未提交验证。。)
题意:模拟文本操作 思路:模拟 #include<iostream> #include<stdio.h> #include<string.h> using name ...
- golang OOP面向对象
摘自:http://www.01happy.com/golang-oop/ golang中并没有明确的面向对象的说法,实在要扯上的话,可以将struct比作其它语言中的class. 类声明 1 2 3 ...
- How to run Media SDK samples on Skylake【转载】
In the last few days, we have seen lot of concern for using Intel® Media 2016 on 6th generation Inte ...
- hdu-5718 Oracle(水题)
题目链接: Oracle Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) ...
- [Selenium] Android HTML5 中 Application Cache
HTML5 中引入了 Application Cache,这意味着 Web 应用程序可以被缓存到本地,且可在没有网络的情况下也能访问该 Web 应用程序 Application Cache 在以下3个 ...
- java利用Aspose.words.jar将本地word文档转化成pdf(完美破解版 无水印 无中文乱码)
package doc; import java.io.*; import junit.framework.Test; import com.aspose.words.*; public class ...