当然 tensorflow 并不是一种用于图像处理的框架,这里图像处理仅仅是一些简单的像素级操作,最终目的比如用于数据增强

  • tf.random_crop()
  • tf.image.random_flip_left_right():
  • tf.image.random_hue()
    • random_contrast()
    • random_brightness()
    • random_saturation()
def pre_process_image(image, training):# This function takes a single image as input,# and a boolean whether to build the training or testing graph.if training:# For training, add the following to the TensorFlow graph.# Randomly crop the input image.image = tf.random_crop(image, size=[img_size_cropped, img_size_cropped, num_channels])# Randomly flip the image horizontally.image = tf.image.random_flip_left_right(image)# Randomly adjust hue, contrast and saturation.image = tf.image.random_hue(image, max_delta=0.05)image = tf.image.random_contrast(image, lower=0.3, upper=1.0)image = tf.image.random_brightness(image, max_delta=0.2)image = tf.image.random_saturation(image, lower=0.0, upper=2.0)# Some of these functions may overflow and result in pixel# values beyond the [0, 1] range. It is unclear from the# documentation of TensorFlow 0.10.0rc0 whether this is# intended. A simple solution is to limit the range.# Limit the image pixels between [0, 1] in case of overflow.image = tf.minimum(image, 1.0)image = tf.maximum(image, 0.0)else:# For training, add the following to the TensorFlow graph.# Crop the input image around the centre so it is the same# size as images that are randomly cropped during training.image = tf.image.resize_image_with_crop_or_pad(image,target_height=img_size_cropped,target_width=img_size_cropped)return image

TensorFlow 实战(五)—— 图像预处理相关推荐

  1. PyTorch框架学习五——图像预处理transforms(一)

    PyTorch框架学习五--图像预处理transforms(一) 一.transforms运行机制 二.transforms的具体方法 1.裁剪 (1)随机裁剪:transforms.RandomCr ...

  2. Tensorflow数据预处理之tf.data.TFRecordDataset---TFRecords详解\TFRecords图像预处理

    目录 1.概述 2.预处理数据 2.1.常量定义 2.2.导入库 2.3.从train.txt文件中读取图片-标签对 2.4.预处理图片并保存 2.5.调用main函数 3.读取预处理后的数据 3.1 ...

  3. Tensorflow实战学习(三十五)【实现基于LSTM语言模型】

    神经结构进步.GPU深度学习训练效率突破.RNN,时间序列数据有效,每个神经元通过内部组件保存输入信息. 卷积神经网络,图像分类,无法对视频每帧图像发生事情关联分析,无法利用前帧图像信息.RNN最大特 ...

  4. 『TensorFlow』第九弹_图像预处理_不爱红妆爱武装

    部分代码单独测试: 这里实践了图像大小调整的代码,值得注意的是格式问题: 输入输出图像时一定要使用uint8编码, 但是数据处理过程中TF会自动把编码方式调整为float32,所以输入时没问题,输出时 ...

  5. 计算机视觉实战的深度学习实战二:图像预处理

    图像预处理 更多精彩内容请关注微信公众号:听潮庭. 写在前面: 图像显示与存储原理 图像增强的目标 点运算:基于直方图的对比度增强 形态学处理 空间与处理:卷积 卷积的应用(平滑.边缘检测.锐化等) ...

  6. 《TensorFlow 实战》第五章源码 5.2 源代码中权重函数中初始化函数 tf.truncated_normal(shape, stddev=0.1) 中 stddev 的重要性

    <TensorFlow 实战>黄文坚  黄源著 源码地址:https://github.com/sundaygeek/tensorflow-in-action/blob/master/5_ ...

  7. TensorFlow实战:Chapter-4(CNN-2-经典卷积神经网络(AlexNet、VGGNet))

    引言 AlexNet AlexNet 简介 AlexNet的特点 AlexNet论文分析 引言 介绍 数据集 网络架构 注解 注解 减少过拟合 训练细节 结果 讨论 参考文献略 AlexNet在Ten ...

  8. 【北京大学】16 TensorFlow1.x的项目实战之图像风格融合与快速迁移

    目录 1 简介 1.1 图像风格快速迁移 1.2 图像风格融合 1.3 图像风格融合与快速迁移 2 数据集 3 模型结构 3.1 损失函数网络 3.2 图像生成网络 4 代码讲解 4.1 代码结构 4 ...

  9. (转)Tensorflow 实战Google深度学习框架 读书笔记

    本文大致脉络: 读书笔记的自我说明 对读书笔记的摘要 具体章节的摘要: 第一章 深度学习简介 第二章 TensorFlow环境搭建 第三章 TensorFlow入门 第四章 深层神经网络 第五章 MN ...

  10. 免费教材丨第55期:Python机器学习实践指南、Tensorflow 实战Google深度学习框架

    小编说  时间过的好快啊,小伙伴们是不是都快进入寒假啦?但是学习可不要落下哦!  本期教材  本期为大家发放的教材为:<Python机器学习实践指南>.<Tensorflow 实战G ...

最新文章

  1. cimiss数据_CIMISS,你太优秀了!
  2. Js传递数组参数到后台controller的方式
  3. (27)TLB番外篇——ShadowWalker
  4. install python_python install on windows 10
  5. iOS 图形编程总结
  6. android_x86安装时遇到的问题与修改开机分辨率
  7. snr matlab,cal snr - MATLAB 论坛讨论区 - EETOP 创芯网论坛 (原名:电子顶级开发网) -...
  8. 全中!七大初学者易踩的坑!
  9. oracle 的“+”和“,”连接表的方式
  10. Goland的常用快捷键
  11. Oracle官网下载JDk文档
  12. nginx工作原理:
  13. 微擎框架对接第三方短信接口教程
  14. vs2015 社区版
  15. 域名注册网站服务比较
  16. 项目实训--Unity多人游戏开发(八、3D音效融合AudioMixer、统一的音频播放系统)
  17. 推荐1个易上手代码开源的好用的H5网页编辑工具
  18. 新时代 新创意 新场景 新消费 2021“设计+”珠宝首饰创新设计展将于10月17日开幕
  19. 值传递和引用传递是什么?
  20. How to make a ipcamera

热门文章

  1. FLEX AIR添加系统托盘图标步骤
  2. 关于如何学好游戏3D引擎编程的一些经验
  3. php高德地图计算距离接口,高德地图计算两坐标之间距离
  4. JVM GC调优参数说明
  5. 【HIVE 之 DDL,DML】
  6. 来看一下:构造函数的小秘密详解
  7. 毕竟这个世界互相适合的人太少了
  8. javascript 的module 模块化
  9. 二叉搜索树+快速排序 查到文本中出现频率最多的100个词 【留学生作业】
  10. YIi 数据操作备注