#include <image_ops.h>
Decode and Crop a JPEG-encoded image to a uint8 tensor.
The attr channels
indicates the desired number of color channels for the decoded image.
Accepted values are:
If needed, the JPEG-encoded image is transformed to match the requested number of color channels.
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.
It is equivalent to a combination of decode and crop, but much faster by only decoding partial jpeg image.
Arguments:
Optional attributes (see Attrs
):
Returns:
Output
: 3-D with shape [height, width, channels]
.. Constructors and Destructors | |
---|---|
DecodeAndCropJpeg(const ::tensorflow::Scope & scope, ::tensorflow::Input contents, ::tensorflow::Input crop_window) | |
DecodeAndCropJpeg(const ::tensorflow::Scope & scope, ::tensorflow::Input contents, ::tensorflow::Input crop_window, const DecodeAndCropJpeg::Attrs & attrs) |
Public attributes | |
---|---|
image |
Public functions | |
---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const |
Public static functions | |
---|---|
AcceptableFraction(float x) | |
Channels(int64 x) | |
DctMethod(StringPiece x) | |
FancyUpscaling(bool x) | |
Ratio(int64 x) | |
TryRecoverTruncated(bool x) |
Structs | |
---|---|
tensorflow::ops::DecodeAndCropJpeg::Attrs | Optional attribute setters for DecodeAndCropJpeg. |
::tensorflow::Output image
DecodeAndCropJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input contents, ::tensorflow::Input crop_window )
DecodeAndCropJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input contents, ::tensorflow::Input crop_window, const DecodeAndCropJpeg::Attrs & attrs )
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output() const
Attrs AcceptableFraction( float x )
Attrs Channels( int64 x )
Attrs DctMethod( StringPiece x )
Attrs FancyUpscaling( bool x )
Attrs Ratio( int64 x )
Attrs TryRecoverTruncated( bool x )
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/decode-and-crop-jpeg.html