觉得有用的话,欢迎一起讨论相互学习~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. spring boot +mysql + mybatis + druid的整理(一)——单数据源

    一,使用spring boot脚手架搭建spring boot框架生成maven项目 如下图所示: 设置自定义的坐标,即左侧的Group和Artifact,右侧可以搜索添加一些依赖,搜索不到的可以在p ...

  2. hdu 6191--Query on A Tree(持久化字典树)

    题目链接 Problem Description Monkey A lives on a tree, he always plays on this tree. One day, monkey A l ...

  3. 洛谷 P1598 垂直柱状图【字符串+模拟】

    P1598 垂直柱状图 题目描述 写一个程序从输入文件中去读取四行大写字母(全都是大写的,每行不超过72个字符),然后用柱状图输出每个字符在输入文件中出现的次数.严格地按照输出样例来安排你的输出格式. ...

  4. LibreOJ β Round #2 E. 数论只会 GCD

    传送门 题解 题解里面说得很清楚了. 大约就是单独考虑每个数的贡献,然后看一下每个序列里有多少区间是没有这个数的,乘起来就好了. 为了处理修改我们需要每个值建一棵线段树来搞,但是窝zz了,写了线段树套 ...

  5. 51nod 1575 Gcd and Lcm

    题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1575 万年巨坑终于填掉了…… 首先是煞笔西瓜的做题历程O_O. ...

  6. JFinal极速开发框架使用笔记(三) 分析Model和ActiveRecord

    JFinal框架的一些新发现的用法: 在JFinal框架中,实体类并不需要设置属性,更不需要配置getset方法就可以很方便的操作数据库,如果需要设置或者获取属性,可以直接使用一下方式: User u ...

  7. 同一台电脑使用 gitlab 和 github 配置

    Git 客户端与服务器端的通信支持多种协议,ssh 最常用.ssh的公钥登录流程,用户将自己的公钥存储在远程主机,登录时,远程主机会向用户发送一条消息,用户用自己的私钥加密后,再发给服务器.远程主机用 ...

  8. 从零开始学习前端开发 — 3、CSS盒模型

    ★  css盒模型是css的基石,每个html标签都可以看作是一个盒模型. css盒模型是由内容(content),补白或填充(padding),边框(border),外边距(margin)四部分组成 ...

  9. TCP长连接和短连接的区别

    当网络通信时采用TCP协议时,在真正的读写操作之前,server与client之间必须建立一个连接,当读写操作完成后,双方不再需要这个连接时它们可以释放这个连接,连接的建立是需要三次握手的,而释放则需 ...

  10. Mysql中的force index和ignore index

    前几天统计一个sql,是一个人提交了多少工单,顺便做了相关sql优化.数据大概2000多w. ) c order by c desc; 为了实验最少受其他因素干扰,将生产库的200多w数据导出来,用测 ...