@Operator(group="image") public final class DecodeJpeg extends PrimitiveOp implements Operand<UInt8>
The attr `channels` indicates the desired number of color channels for the decoded image.
Accepted values are:
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.
This op also supports decoding PNGs and non-animated GIFs since the interface is the same, though it is cleaner to use `tf.image.decode_image`.
Modifier and Type | Class and Description |
---|---|
static class |
DecodeJpeg.Options
Optional attributes for
DecodeJpeg |
operation
Modifier and Type | Method and Description |
---|---|
static DecodeJpeg.Options |
acceptableFraction(Float acceptableFraction) |
Output<UInt8> |
asOutput()
Returns the symbolic handle of a tensor.
|
static DecodeJpeg.Options |
channels(Long channels) |
static DecodeJpeg |
create(Scope scope,
Operand<String> contents,
DecodeJpeg.Options... options)
Factory method to create a class wrapping a new DecodeJpeg operation.
|
static DecodeJpeg.Options |
dctMethod(String dctMethod) |
static DecodeJpeg.Options |
fancyUpscaling(Boolean fancyUpscaling) |
Output<UInt8> |
image()
3-D with shape `[height, width, channels]`..
|
static DecodeJpeg.Options |
ratio(Long ratio) |
static DecodeJpeg.Options |
tryRecoverTruncated(Boolean tryRecoverTruncated) |
equals, hashCode, op, toString
public static DecodeJpeg create(Scope scope, Operand<String> contents, DecodeJpeg.Options... options)
scope
- current scopecontents
- 0-D. The JPEG-encoded image.options
- carries optional attributes valuespublic static DecodeJpeg.Options channels(Long channels)
channels
- Number of color channels for the decoded image.public static DecodeJpeg.Options ratio(Long ratio)
ratio
- Downscaling ratio.public static DecodeJpeg.Options fancyUpscaling(Boolean fancyUpscaling)
fancyUpscaling
- If true use a slower but nicer upscaling of the
chroma planes (yuv420/422 only).public static DecodeJpeg.Options tryRecoverTruncated(Boolean tryRecoverTruncated)
tryRecoverTruncated
- If true try to recover an image from truncated input.public static DecodeJpeg.Options acceptableFraction(Float acceptableFraction)
acceptableFraction
- The minimum required fraction of lines before a truncated
input is accepted.public static DecodeJpeg.Options dctMethod(String dctMethod)
dctMethod
- string specifying a hint about the algorithm used for
decompression. Defaults to "" which maps to a system-specific
default. Currently valid values are ["INTEGER_FAST",
"INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal
jpeg library changes to a version that does not have that specific
option.)public Output<UInt8> asOutput()
Operand
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput
in interface Operand<UInt8>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.