资源简介
谷歌Deep Dream源代码,可以直接运行,不错的参考资料
代码片段和文件信息
# coding:utf-8
from __future__ import print_function
import os
from io import BytesIO
import numpy as np
from functools import partial
import PIL.Image
import scipy.misc
import tensorflow as tf
graph = tf.Graph()
model_fn = ‘tensorflow_inception_graph.pb‘
sess = tf.InteractiveSession(graph=graph)
with tf.gfile.FastGFile(model_fn ‘rb‘) as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
t_input = tf.placeholder(np.float32 name=‘input‘) # define the input tensor
imagenet_mean = 117.0
t_preprocessed = tf.expand_dims(t_input - imagenet_mean 0)
tf.import_graph_def(graph_def {‘input‘: t_preprocessed})
def savearray(img_array img_name):
scipy.misc.toimage(img_array).save(img_name)
print(‘img saved: %s‘ % img_name)
def visstd(a s=0.1):
return (a - a.mean()) / max(a.std() 1e-4) * s + 0.5
def resize_ratio(img ratio):
min = img.min()
max = img.max()
img = (img - min) / (max - min) * 255
img = np.float32(scipy.misc.imresize(img
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 3552 2018-03-15 17:49 chapter_4\gen_deepdream.py
....... 4591 2018-03-15 17:49 chapter_4\gen_lapnorm.py
....... 2820 2018-03-15 17:49 chapter_4\gen_multiscale.py
....... 1810 2018-03-15 17:49 chapter_4\gen_naive.py
....... 1334 2018-03-15 17:49 chapter_4\load_inception.py
....... 971 2018-03-15 17:49 chapter_4\README.md
....... 41535 2018-03-15 17:49 chapter_4\test.jpg
目录 0 2018-03-15 17:49 chapter_4
----------- --------- ---------- ----- ----
56613 8
- 上一篇:用authorware做的电子读物
- 下一篇:DLX实验报告
相关资源
- 数学物理方法_德顾樵编著_2012.01_545页
- zw_WKTConvert.zip
- tdxw.exe
- zw_LabVIEW_8.20程序设计从入门到精通.
- zw_20170105220330215.zip
- unlocker-master最新版.rar
- Nginx核心知识100讲全套课件.zip
- navicat.11.2.16.premium_cs_x64破解版.zip
- 凸优化_Boyd_王书宁译.rar
- 云盘.rar
- Xshell5.exe
- 20170121135652618.rar
- DiskGenius4.7.0专业版.rar
- AlphaControlsv11.16StableFullSource(D5和D10
- 雅奇880官方开源赠品30多个雅奇4.rar
- 2009_LabVIEW编程样式_清晰版.pdf
- tiger_newhu5.99.24.zip
- 大数据架构详解:从数据获取到深度
- 程序是怎样跑起来的_PDF电子书带书签
- MongodbSample.rar
- EtherCATSlaveStackCodeTool5.12.rar
- 重构_改善既有代码的设计.rar
- 矩阵分析与应用第二版高清带书签.
- 通达网络智能办公系统OfficeAnywhere20
- 入门到实践.rar
- vRealizeAutomation7.0快速部署手册v1.3.pd
- 迅捷pdf转换器.7z
- FLACFLAC3D基础与应用-陈育民.pptx
- Location12.2.rar
- proteus仿真stm32测距.zip
评论
共有 条评论