觉得有用的话,欢迎一起讨论相互学习~Follow Me

tf.image.decode_png(contents, channels=None, name=None)

Decode a PNG-encoded image to a uint8 tensor.

将一个png编码的图像解码成一个uint8张量。

The attr channels indicates the desired number of color channels for the

decoded image.

参数"channels"表示解码图像所需的颜色通道数量。

Accepted values are:

  • 0: Use the number of channels in the PNG-encoded image.

    使用png编码图像的通道数
  • 1: output a grayscale image.

    输出一个灰度图像
  • 3: output an RGB image.

    输出一个RGB值表示的图像
  • 4: output an RGBA image.

    输出一个RGBA值表示的图像

    If needed, the PNG-encoded image is transformed to match the requested number

    of color channels.

    如果需要,将转换为png编码的图像,以匹配所请求的颜色通道数量。
Args:
  • contents: A Tensor of type string. 0-D. The PNG-encoded image.

    0阶"string"类型的张量,使用png编码格式的图片
  • channels: An optional int. Defaults to 0.

    Number of color channels for the decoded image.

    可选int参数,默认是0,表示解码图像的颜色通道数。
  • name: A name for the operation (optional).
Returns:

A Tensor of type uint8. 3-D with shape [height, width, channels].

一个uint8类型的张量。3维分别表示[高度,宽度,通道数]

tf.image.decode_jpeg(contents, channels=None, ratio=None, fancy_upscaling=None, try_recover_truncated=None, acceptable_fraction=None, name=None)

Decode a JPEG-encoded image to a uint8 tensor.

讲一个jepg编码的图片编码为int类型的张量

The attr channels indicates the desired number of color channels for the decoded image.

属性"channels"表示解码图像所需的颜色通道数量。

Accepted values are:

  • 0: Use the number of channels in the JPEG-encoded image.
  • 1: output a grayscale image.
  • 3: output an RGB image.
  • 0: 使用jpeg编码映像中的通道数量。
  • 1: 输出一个灰度图像。
  • 3: 输出一个RGB图像

    If needed, the JPEG-encoded image is transformed to match the requested number of color channels.

    如果需要,则将jpeg编码的图像转换为匹配请求的数字的颜色通道。

    The attr ratio allows downscaling the image by an integer factor during

    decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than

    downscaling the image later.

    在解码过程中,属性'ratio'允许通过整数因子来缩小图像。允许的值是:1、2、4和8。

    这比稍后缩小图像的速度要快得多。
Args:
  • contents: A Tensor of type string. 0-D. The JPEG-encoded image.

    是一个0维度的string类型的使用JRPG编码的张量.
  • channels: An optional int. Defaults to 0.

    Number of color channels for the decoded image.

    一个可选的int类型的参数,默认是0,表示解码图片的通道数.
  • ratio: An optional int. Defaults to 1. Downscaling ratio.

    默认是1,可以通过调节来缩小图片.
  • fancy_upscaling: An optional bool. Defaults to True.

    If true use a slower but nicer upscaling of the

    chroma planes (yuv420/422 only).

    可选的布尔值.

    默认是"True"如果选择true会使用一个慢但是更好的对于chroma层的加速

    plane一般是以luma plane、chroma plane的形式出现,其实就是luma层和chroma层,就像RGB,要用三个plane来存。
  • try_recover_truncated: An optional bool. Defaults to False.

    If true try to recover an image from truncated input.

    一个可选的布尔值,默认是假,如果选择"true"则会试图从截断的输入中恢复图像。

  • acceptable_fraction: An optional float. Defaults to 1.

    The minimum required fraction of lines before a truncated

    input is accepted.

    可选的"float"类型的变量,默认为“1”。在被截断的输入被接受之前,最少需要的行数。

  • name: A name for the operation (optional).

Returns:

A Tensor of type uint8. 3-D with shape [height, width, channels]..

一个uint8类型的张量。3维分别表示[高度,宽度,通道数]

tensorflow Image 解码函数的更多相关文章

  1. Qt中gb2312/GBK的URL编解码函数

    编码函数: QByteArray encodeURI(QString str) { QByteArray array; QTextCodec *codec=QTextCodec::codecForNa ...

  2. 关于JavaScript中的编码和解码函数

    js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decodeURIComponent 1 ...

  3. js中escape对应的C#解码函数 UrlDecode

    js中escape对应的C#解码函数 System.Web.HttpUtility.UrlDecode(s),使用过程中有以下几点需要注意   js中escape对应的C#解码函数 System.We ...

  4. 46.Linux-分析rc红外遥控平台驱动框架,修改内核的NEC解码函数BUG(1)

    内核版本          :  Linux 3.10.14 rc红外接收类型:  GPIO 类型的NEC红外编码 本章内容 1) rc体系结构分析 2) 分析红外platform_driver平台驱 ...

  5. java中URL 的编码和解码函数

    java中URL 的编码和解码函数java.net.URLEncoder.encode(String s)和java.net.URLDecoder.decode(String s);在javascri ...

  6. Tensorflow Batch normalization函数

    Tensorflow Batch normalization函数 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文献 stackoverflow上tensorflow实现BN的不同函数的 ...

  7. tensorflow.nn.bidirectional_dynamic_rnn()函数的用法

    在分析Attention-over-attention源码过程中,对于tensorflow.nn.bidirectional_dynamic_rnn()函数的总结: 首先来看一下,函数: def bi ...

  8. decodeURIComponent 解码函数

    想象一个场景,你朋友发一个链接让你打开,但链接是下面其中之一,你会不会想锤死他 1. \u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0062\u0069\u0 ...

  9. TensorFlow卷积层-函数

    函数1:tf.nn.conv2d是TensorFlow里面实现卷积的函数,实际上这是搭建卷积神经网络比较核心的一个方法 函数原型: tf.nn.conv2d(input,filter,strides, ...

随机推荐

  1. JAXB应用实例

    过往的项目中数据存储都离不开数据库,不过最近做的一个项目的某些数据(比如人员信息.菜单.权限等等)却完全没有涉及任何数据库操作,直接XML搞定.这里无意比较优劣,因为数据库存储和XML存储本就有不同的 ...

  2. 把玩爬虫框架Gecco

    如果你现在接到一个任务,获取某某行业下的分类. 作为一个非该领域专家,没有深厚的运营经验功底,要提供一套摆的上台面且让人信服的行业分类,恐怕不那么简单. 找不到专家没有关系,我们可以爬虫.把那些专家的 ...

  3. Sql的基础知识技巧(三)

    三.技巧 1.1=1,1=2 的使用,在 SQL 语句组合时用的较多 "where 1=1" 是表示选择全部 "where 1=2"全部不选, 如:if @st ...

  4. js时间戳与日期格式的相互转换

    下面总结一下js中时间戳与日期格式的相互转换: 1. 将时间戳转换成日期格式: function timestampToTime(timestamp) { var date = new Date(ti ...

  5. BZOJ 3097: Hash Killer I【构造题,思维题】

    3097: Hash Killer I Time Limit: 5 Sec  Memory Limit: 128 MBSec  Special JudgeSubmit: 963  Solved: 36 ...

  6. BZOJ3997: [TJOI2015]组合数学(网络流)

    3997: [TJOI2015]组合数学 Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 405  Solved: 284[Submit][Status ...

  7. 【Git】Git基础操作

    repository:版本库又名仓库,可以简单理解成一个目录,这个目录里面的所有文件都可以被Git管理起来,每个文件的修改.删除,Git都能跟踪,以便任何时刻都可以追踪历史,或者在将来某个时刻可以&q ...

  8. LinkedHashMap 源码详细分析(JDK1.8)

    1. 概述 LinkedHashMap 继承自 HashMap,在 HashMap 基础上,通过维护一条双向链表,解决了 HashMap 不能随时保持遍历顺序和插入顺序一致的问题.除此之外,Linke ...

  9. Android开发——BroadcastReceiver广播的使用

    想要了解广播定义及相关原理的可以看下这一篇BroadcastReceiver史上最全面解析 简单地对广播进行分类吧,广播有两个角色,一个是广播发送者,另外一个是广播接收者 广播按照类型分为两种,一种是 ...

  10. LAMP环境跟LNMP环境有什么不同,主要用什么地方

    LAMP即Linux+Apache+Mysql/MariaDB+Perl/PHP/Python Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网 ...