tensorflow Image 解码函数
觉得有用的话,欢迎一起讨论相互学习~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: ATensorof typestring. 0-D. The PNG-encoded image.
0阶"string"类型的张量,使用png编码格式的图片channels: An optionalint. Defaults to0.
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 attrratioallows 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: ATensorof typestring. 0-D. The JPEG-encoded image.
是一个0维度的string类型的使用JRPG编码的张量.channels: An optionalint. Defaults to0.
Number of color channels for the decoded image.
一个可选的int类型的参数,默认是0,表示解码图片的通道数.ratio: An optionalint. Defaults to1. Downscaling ratio.
默认是1,可以通过调节来缩小图片.fancy_upscaling: An optionalbool. Defaults toTrue.
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 optionalbool. Defaults toFalse.
If true try to recover an image from truncated input.
一个可选的布尔值,默认是假,如果选择"true"则会试图从截断的输入中恢复图像。acceptable_fraction: An optionalfloat. Defaults to1.
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 解码函数的更多相关文章
- Qt中gb2312/GBK的URL编解码函数
编码函数: QByteArray encodeURI(QString str) { QByteArray array; QTextCodec *codec=QTextCodec::codecForNa ...
- 关于JavaScript中的编码和解码函数
js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decodeURIComponent 1 ...
- js中escape对应的C#解码函数 UrlDecode
js中escape对应的C#解码函数 System.Web.HttpUtility.UrlDecode(s),使用过程中有以下几点需要注意 js中escape对应的C#解码函数 System.We ...
- 46.Linux-分析rc红外遥控平台驱动框架,修改内核的NEC解码函数BUG(1)
内核版本 : Linux 3.10.14 rc红外接收类型: GPIO 类型的NEC红外编码 本章内容 1) rc体系结构分析 2) 分析红外platform_driver平台驱 ...
- java中URL 的编码和解码函数
java中URL 的编码和解码函数java.net.URLEncoder.encode(String s)和java.net.URLDecoder.decode(String s);在javascri ...
- Tensorflow Batch normalization函数
Tensorflow Batch normalization函数 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文献 stackoverflow上tensorflow实现BN的不同函数的 ...
- tensorflow.nn.bidirectional_dynamic_rnn()函数的用法
在分析Attention-over-attention源码过程中,对于tensorflow.nn.bidirectional_dynamic_rnn()函数的总结: 首先来看一下,函数: def bi ...
- decodeURIComponent 解码函数
想象一个场景,你朋友发一个链接让你打开,但链接是下面其中之一,你会不会想锤死他 1. \u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0062\u0069\u0 ...
- TensorFlow卷积层-函数
函数1:tf.nn.conv2d是TensorFlow里面实现卷积的函数,实际上这是搭建卷积神经网络比较核心的一个方法 函数原型: tf.nn.conv2d(input,filter,strides, ...
随机推荐
- SpringBoot入坑-持久化操作
前面内容中我们已经了解到了SpringBoot关于参数传递的相关知识,本篇我们一起来学习一下SpringBoot关于数据库持久化操作的知识,这里我们使用JPA进行数据库的持久化操作. 首先由于我们需要 ...
- Sql的基础知识提升(二)
二.提升 1.说明:复制表(只复制结构,源表名:a 新表名:b) (Access 可用) 法一:select * into b from a where 1<>1(仅用于 SQlServe ...
- 2017ccpc哈尔滨区域赛H
n堆石子 每次只能拿一个石子从一堆移到另一堆 知道所有的堆的石子数目都能整除x(x>1) 问最小移动次数 枚举x的可能取值 即a[i]和的素因子即可 合因子的区间变化会比较大 然后求余 ...
- python内建函数isinstance基础用法
语法:isinstance(object,type) 作用:来判断一个对象是否是一个已知的类型. 其第一个参数(object)为对象,第二个参数(type)为类型名(int...)或类型名的一个 ...
- sass 安装
最近在安装sass的过程中遇到 了一下问题,总结一下安装过程. windows下sass的安装是依赖于ruby的,所以要先安装rubyinstaller,下载地址:https://rubyinstal ...
- Java本地缓存解决方案其一(使用Google的CacheBuilder)
前不久,业务实现上需要用到本地缓存来解决一些数据量相对较小但是频繁访问的数据,通过查找各种资料,找到了一种可以实现的方案--采用的是Google的CacheBuilder.下面是代码实现过程:1.首先 ...
- HDU 4034 Graph(Floyd变形——逆向判断)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4034 Problem Description Everyone knows how to calcu ...
- 迈向c++的一次尝试
从C到C++说着容易做起来也不难,今天做一下尝试. ★:题目介绍:今天是一次尝试所以先从简单的题开始. ★:试题分析:由题可了解到本题目的是要做到由一个数字到一个字符串的转变. 题目简单是由于它只是让 ...
- Git的简单的基本使用
前言: 接触了Android Studio,自然是知道了Github这个网站,这个网站有许多大神们做的开源库,我们只需要简单地引入就是可以使用到这些开源库从而实现酷炫的效果,最近也是刚接触到Git的使 ...
- DALI 2.0解码模块
DALI2.0调光解码模块使用手册 一.概述(联系人:张先生,电话:13923882807,QQ:813267849) 欢迎使用本公司的DALI 2.0解码模块,该模块支持"DALI第二套协 ...