Tf.code_png(contents, channels=None, name=None)ĭecode a PNG-encoded image to a uint8 tensor. If not empty, embed this XMP metadata in the image header.Ī Tensor of type string. Pixels per inch ( 'in') or centimeter ( 'cm'). Unit used to specify x_density and y_density: density_unit: An optional string from: "in", "cm".chroma_downsampling: An optional bool.If True, spend CPU/RAM to reduce size with no quality change. If True, create a JPEG that loads progressively (coarse to fine). Quality of the compression from 0 to 100 (higher is better and slower). format: An optional string from: "", "grayscale", "rgb".In function of the number of channels in image:ģ-D with shape. If format is not specified or is the empty string, a default format is picked grayscale: Output a grayscale JPEG image.'': Use a default format based on the number of channels in the image.The attr format can be used to override the color format of the encoded Tf.image.encode_jpeg(image, format=None, quality=None, progressive=None, optimize_size=None, chroma_downsampling=None, density_unit=None, x_density=None, y_density=None, xmp_metadata=None, name=None) name: A name for the operation (optional).Ī Tensor of type uint8.The minimum required fraction of lines before a truncated acceptable_fraction: An optional float.If true try to recover an image from truncated input. try_recover_truncated: An optional bool.If true use a slower but nicer upscaling of the Number of color channels for the decoded image. The attr ratio allows downscaling the image by an integer factor duringĭecoding. If needed, the JPEG-encoded image is transformed to match the requested number 0: Use the number of channels in the JPEG-encoded image.The attr channels indicates the desired number of color channels for the Tf.code_jpeg(contents, channels=None, ratio=None, fancy_upscaling=None, try_recover_truncated=None, acceptable_fraction=None, name=None)ĭecode a JPEG-encoded image to a uint8 tensor. Presently only support RGB, HSV, and GrayScale. Note: The PNG encode and decode Ops support RGBA, but the conversions Ops The decode Ops to one of the cropping and resizing Ops. If you need fixed size images, pass the output of Their input and outputĪre all of variable size. The encode and decode Ops apply to one image at a time. Images are represented by scalar string Tensors, decoded images by 3-D uint8 TensorFlow provides Ops to decode and encode JPEG and PNG formats.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |