- View on TensorFlow.org
- |
-
- View GitHub repository
- |
-
For Unicode, see the - * [https://www.tensorflow.org/tutorials/representation/unicode](Working with Unicode text) + * [https://www.tensorflow.org/text/guide/unicode](Working with Unicode text) * tutorial. *
Examples: *
@@ -69,7 +69,6 @@ public AsString asString(Operand extends TType> input, AsString.Options... opt /** * Cast x of type SrcT to y of DstT. * - * @param data type for {@code y} output * @param x The x value * @param DstT The value of the DstT attribute * @param options carries optional attribute values @@ -95,7 +94,6 @@ public Cast cast(Operand extends TType> x, Class DstT, * tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] * * - * @param data type for {@code out} output * @param real The real value * @param imag The imag value * @param Tout The value of the Tout attribute diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java index 559ffc0d80a..896bb62de5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java @@ -32,6 +32,7 @@ import org.tensorflow.op.image.DecodeImage; import org.tensorflow.op.image.DecodeJpeg; import org.tensorflow.op.image.DecodePng; +import org.tensorflow.op.image.DecodeWebP; import org.tensorflow.op.image.DrawBoundingBoxes; import org.tensorflow.op.image.EncodeJpeg; import org.tensorflow.op.image.EncodeJpegVariableQuality; @@ -93,7 +94,6 @@ public final class ImageOps { * channel and then adjusts each component of each pixel to * {@code (x - mean) * contrast_factor + mean}. * - * @param* * - * @paramdata type for {@code output} output * @param images Images to adjust. At least 3-D. * @param contrastFactor A float multiplier for adjusting contrast. * @param data type for {@code AdjustContrastv2} output and operands @@ -112,7 +112,6 @@ public AdjustContrast adjustContrast(Operand images, * colors are first mapped into HSV. A delta is then applied all the hue values, * and then remapped back to RGB colorspace. * - * @param data type for {@code output} output * @param images Images to adjust. At least 3-D. * @param delta A float delta to add to the hue. * @param data type for {@code AdjustHue} output and operands @@ -130,7 +129,6 @@ public AdjustHue adjustHue(Operand images, Operand data type for {@code output} output * @param images Images to adjust. At least 3-D. * @param scale A float scale to add to the saturation. * @param data type for {@code AdjustSaturation} output and operands @@ -250,7 +248,6 @@ public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, /** * Computes the gradient of the crop_and_resize op wrt the input image tensor. * - * @param data type for {@code output} output * @param grads A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. * @param boxes A 2-D tensor of shape {@code [num_boxes, 4]}. The {@code i}-th row of the tensor * specifies the coordinates of a box in the {@code box_ind[i]} image and is specified @@ -340,51 +337,52 @@ public DecodeGif decodeGif(Operand contents) { } /** - * Function for decode_bmp, decode_gif, decode_jpeg, and decode_png. - * Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, or PNG, and performs the * appropriate operation to convert the input bytes string into a Tensor of type * dtype. - * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as - * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays - * [height, width, num_channels]. Make sure to take this into account when - * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or - * PNG files. Alternately, set the expand_animations argument of this function to - * False, in which case the op will return 3-dimensional tensors and will truncate - * animated GIF files to the first frame. + *
NOTE: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated files with + * BMP, JPEG, and/or PNG files. Alternately, set the expand_animations + * argument of this function to False, in which case the op will return + * 3-dimensional tensors and will truncate animations to the first frame. *
NOTE: If the first frame of an animated GIF does not occupy the entire * canvas (maximum frame width x maximum frame height), then it fills the * unoccupied areas (in the first frame) with zeros (black). For frames after the * first frame that does not occupy the entire canvas, it uses the previous * frame to fill the unoccupied areas. * - * @param
data type for {@code image} output * @param contents 0-D. The encoded image bytes. * @param options carries optional attribute values * @return a new instance of DecodeImage, with default output types */ - public DecodeImage decodeImage(Operand contents, DecodeImage.Options[] options) { + public DecodeImage decodeImage(Operand contents, + DecodeImage.Options... options) { return DecodeImage.create(scope, contents, options); } /** - * Function for decode_bmp, decode_gif, decode_jpeg, and decode_png. - * Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, or PNG, and performs the * appropriate operation to convert the input bytes string into a Tensor of type * dtype. - * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as - * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays - * [height, width, num_channels]. Make sure to take this into account when - * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or - * PNG files. Alternately, set the expand_animations argument of this function to - * False, in which case the op will return 3-dimensional tensors and will truncate - * animated GIF files to the first frame. + *
NOTE: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated files with + * BMP, JPEG, and/or PNG files. Alternately, set the expand_animations + * argument of this function to False, in which case the op will return + * 3-dimensional tensors and will truncate animations to the first frame. *
NOTE: If the first frame of an animated GIF does not occupy the entire * canvas (maximum frame width x maximum frame height), then it fills the * unoccupied areas (in the first frame) with zeros (black). For frames after the * first frame that does not occupy the entire canvas, it uses the previous * frame to fill the unoccupied areas. * - * @param
data type for {@code image} output * @param contents 0-D. The encoded image bytes. * @param dtype The desired DType of the returned Tensor. * @param options carries optional attribute values @@ -438,12 +436,11 @@ public DecodeJpeg decodeJpeg(Operand contents, DecodeJpeg.Options... op * This op also supports decoding JPEGs and non-animated GIFs since the interface * is the same, though it is cleaner to use {@code tf.io.decode_image}. * - * @param
data type for {@code image} output * @param contents 0-D. The PNG-encoded image. * @param options carries optional attribute values * @return a new instance of DecodePng, with default output types */ - public DecodePng decodePng(Operand contents, DecodePng.Options[] options) { + public DecodePng decodePng(Operand contents, DecodePng.Options... options) { return DecodePng.create(scope, contents, options); } @@ -463,7 +460,6 @@ public DecodePng decodePng(Operand contents, DecodePng.Options[ * This op also supports decoding JPEGs and non-animated GIFs since the interface * is the same, though it is cleaner to use {@code tf.io.decode_image}. * - * @param
data type for {@code image} output * @param contents 0-D. The PNG-encoded image. * @param dtype The value of the dtype attribute * @param options carries optional attribute values @@ -475,6 +471,51 @@ public DecodePng decodePng(Operand contents, Cla return DecodePng.create(scope, contents, dtype, options); } + /** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + * Accepted values are: + *
+ *
+ *- 0: Use the number of channels in the WebP-encoded image.
+ *- 3: output an RGB image.
+ *- 4: output an RGBA image.
+ *The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + * + * @param contents 0-D. The WebP-encoded image. + * @param options carries optional attribute values + * @return a new instance of DecodeWebP, with default output types + */ + public DecodeWebP
decodeWebP(Operand contents, DecodeWebP.Options... options) { + return DecodeWebP.create(scope, contents, options); + } + + /** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + * Accepted values are: + *
+ *
+ *- 0: Use the number of channels in the WebP-encoded image.
+ *- 3: output an RGB image.
+ *- 4: output an RGBA image.
+ *The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + * + * @param contents 0-D. The WebP-encoded image. + * @param dtype The value of the dtype attribute + * @param options carries optional attribute values + * @param
data type for {@code DecodeWebP} output and operands + * @return a new instance of DecodeWebP + */ + public DecodeWebP decodeWebP(Operand contents, Class dtype, + DecodeWebP.Options... options) { + return DecodeWebP.create(scope, contents, dtype, options); + } + /** * Draw bounding boxes on a batch of images. * Outputs a copy of {@code images} but draws on top of the pixels zero or more bounding @@ -487,7 +528,6 @@ public DecodePng decodePng(Operand contents, Cla * the bounding box will be {@code (40, 10)} to {@code (100, 50)} (in (x,y) coordinates). * Parts of the bounding box may fall outside the image. * - * @param
data type for {@code output} output * @param images 4-D with shape {@code [batch, height, width, depth]}. A batch of images. * @param boxes 3-D with shape {@code [batch, num_bounding_boxes, 4]} containing bounding * boxes. @@ -602,7 +642,6 @@ public ExtractGlimpse extractGlimpse(Operand input, Operand si /** * Extract {@code patches} from {@code images} and put them in the "depth" output dimension. * - * @param data type for {@code patches} output * @param images 4-D Tensor with shape {@code [batch, in_rows, in_cols, depth]}. * @param ksizes The size of the sliding window for each dimension of {@code images}. * @param strides How far the centers of two consecutive patches are in @@ -626,7 +665,6 @@ public ExtractImagePatches extractImagePatches(Operand i * Extract the shape information of a JPEG-encoded image. * This op only parses the image header, so it is much faster than DecodeJpeg. * - * @param data type for {@code image_shape} output * @param contents 0-D. The JPEG-encoded image. * @return a new instance of ExtractJpegShape, with default output types */ @@ -638,7 +676,6 @@ public ExtractJpegShape extractJpegShape(Operand contents) { * Extract the shape information of a JPEG-encoded image. * This op only parses the image header, so it is much faster than DecodeJpeg. * - * @param data type for {@code image_shape} output * @param contents 0-D. The JPEG-encoded image. * @param outputType (Optional) The output type of the operation (int32 or int64). * Defaults to int32. @@ -691,7 +728,6 @@ public GenerateBoundingBoxProposals generateBoundingBoxProposals(Operand See {@code rgb_to_hsv} for a description of the HSV encoding. * - * @param data type for {@code output} output * @param images 1-D or higher rank. HSV data to convert. Last dimension must be size 3. * @param data type for {@code HSVToRGB} output and operands * @return a new instance of HsvToRgb @@ -708,7 +744,6 @@ public HsvToRgb hsvToRgb(Operand images) { * {@code k = c0 x + c1 y + 1}. If the transformed point lays outside of the input * image, the output pixel is set to 0. * - * @param data type for {@code transformed_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param transforms 2-D Tensor, {@code [batch, 8]} or {@code [1, 8]} matrix, where each row corresponds to a 3 x 3 * projective transformation matrix, with the last entry assumed to be 1. If there @@ -733,7 +768,6 @@ public ImageProjectiveTransformV2 imageProjectiveTransfor * {@code k = c0 x + c1 y + 1}. If the transformed point lays outside of the input * image, the output pixel is set to fill_value. * - * @param data type for {@code transformed_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param transforms 2-D Tensor, {@code [batch, 8]} or {@code [1, 8]} matrix, where each row corresponds to a 3 x 3 * projective transformation matrix, with the last entry assumed to be 1. If there @@ -794,7 +828,6 @@ public NearestNeighbors nearestNeighbors(Operand points, Operand data type for {@code selected_scores} output * @param boxes A 2-D float tensor of shape {@code [num_boxes, 4]}. * @param scores A 1-D float tensor of shape {@code [num_boxes]} representing a single * score corresponding to each box (each row of boxes). @@ -854,7 +887,6 @@ public NonMaxSuppressionWithOverlaps nonMaxSuppressionWithOverlaps(Operand data type for {@code resized_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. @@ -878,7 +910,6 @@ public QuantizedResizeBilinear quantizedResizeBilinear(Op * rectangle from that location. The random location is picked so the cropped * area will fit inside the original image. * - * @param data type for {@code output} output * @param image 3-D of shape {@code [height, width, channels]}. * @param sizeOutput 1-D of length 2 containing: {@code crop_height}, {@code crop_width}.. * @param options carries optional attribute values @@ -931,7 +962,6 @@ public ResizeBicubic resizeBicubic(Operand extends TNumber> images, Operand data type for {@code output} output * @param grads 4-D with shape {@code [batch, height, width, channels]}. * @param originalImage 4-D with shape {@code [batch, orig_height, orig_width, channels]}, * The image tensor that was resized. @@ -962,7 +992,6 @@ public ResizeBilinear resizeBilinear(Operand extends TNumber> images, /** * Computes the gradient of bilinear interpolation. * - * @param data type for {@code output} output * @param grads 4-D with shape {@code [batch, height, width, channels]}. * @param originalImage 4-D with shape {@code [batch, orig_height, orig_width, channels]}, * The image tensor that was resized. @@ -978,7 +1007,6 @@ public ResizeBilinearGrad resizeBilinearGrad(Operand data type for {@code resized_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. @@ -994,7 +1022,6 @@ public ResizeNearestNeighbor resizeNearestNeighbor(Operan /** * Computes the gradient of nearest neighbor interpolation. * - * @param data type for {@code output} output * @param grads 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code orig_height, orig_width}. The * original input size. @@ -1031,7 +1058,6 @@ public ResizeNearestNeighborGrad resizeNearestNeighborGra *
The minibatch size {@code N} is extracted from {@code sparse_shape[0]}.
*
- * @param data type for {@code serialized_sparse} output
* @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}.
* @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}.
* @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}.
@@ -903,7 +898,6 @@ public SerializeManySparse The minibatch size {@code N} is extracted from {@code sparse_shape[0]}.
*
- * @param data type for {@code serialized_sparse} output
* @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}.
* @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}.
* @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}.
@@ -920,7 +914,6 @@ public SerializeManySparse serializeManySparse(Operand Computes the inverse of one or more square invertible matrices or their
+ * adjoints (conjugate transposes).
*
- * @param Note: The default kernel implementation for MatMul on GPUs uses
* cublas.
*
- * @param
{@literal @}end_compatibility
*
*
- * @param