SRCNN-TensorFlow理解

code:https://github.com/tegg89/SRCNN-Tensorflow

model.py
1、tf.random_normal() 参考
(https://blog.csdn.net/dcrmg/article/details/79028043)
tf.random_normal() 从正太分布的数值中输出随机值。

tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)

  • shape: 输出张量的形状,必选
  • mean: 正态分布的均值,默认为0
  • stddev: 正态分布的标准差,默认为1.0
  • dtype: 输出的类型,默认为tf.float32
  • seed: 随机数种子,是一个整数,当设置之后,每次生成的随机数都一样

utils.py
1、read_data(path)
读取.h5文件的data和label数据,转化np.array格式

2、preprocess(path,scale=3)
(1)读取灰度图像;
(2)modcrop;
(3)归一化;
(4)两次bicubic interpolation

返回input_ ,label_

3、prepare_data(sess,dataset)
作用:返回data是训练集或测试集bmp格式的图像
(1)参数说明:dataset是train dataset 或 test dataset

(2)glob.glob得到所有的训练集或是测试集图像

4、make_data(sess,data,label)
作用:将data(checkpoint下的train.h5 或test.h5)利用h5的create_dataset 写入

  • 为什么?

  • 如何生成train.h5 或test.h5文件的?

5、imread(path,is_grayscale=True)
目的:读取指定路径的图像

6、modcrop(image,scale)
7、input_setup(sess,config)

8、

猜你喜欢

转载自blog.csdn.net/qq_42025376/article/details/88042123