tf.image.extract_glimpse()

tf.image.extract_glimpse(input, size, offsets, centered=None, normalized=None, uniform_noise=None, name=None) Extracts a glimpse from the input tensor. Returns a set of windows called glimpses extracted at location offsets from the input tensor. If the windows only partially overlaps the inputs, the non overlapping areas will be filled with random noise. The result is a 4-D tensor of shape [batch_size, glimpse_height, glimpse_width, channels]. The channels and batch dimensions are the same as

tf.image.encode_png()

tf.image.encode_png(image, compression=None, name=None) PNG-encode an image. image is a 3-D uint8 or uint16 Tensor of shape [height, width, channels] where channels is: 1: for grayscale. 2: for grayscale + alpha. 3: for RGB. 4: for RGBA. The ZLIB compression level, compression, can be -1 for the PNG-encoder default or a value from 0 to 9. 9 is the highest compression level, generating the smallest output, but is slower. Args: image: A Tensor. Must be one of the following types: uint8, uint1

tf.image.encode_jpeg()

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) JPEG-encode an image. image is a 3-D uint8 Tensor of shape [height, width, channels]. The attr format can be used to override the color format of the encoded output. Values can be: '': Use a default format based on the number of channels in the image. grayscale: Output a grayscale JPEG image. Th

tf.image.draw_bounding_boxes()

tf.image.draw_bounding_boxes(images, boxes, name=None) Draw bounding boxes on a batch of images. Outputs a copy of images but draws on top of the pixels zero or more bounding boxes specified by the locations in boxes. The coordinates of the each bounding box in boxes are encoded as [y_min, x_min, y_max, x_max]. The bounding box coordinates are floats in [0.0, 1.0] relative to the width and height of the underlying image. For example, if an image is 100 x 200 pixels and the bounding box is [0.1

tf.image.decode_png()

tf.image.decode_png(contents, channels=None, dtype=None, name=None) Decode a PNG-encoded image to a uint8 or uint16 tensor. The attr channels indicates the desired number of color channels for the decoded image. Accepted values are: 0: Use the number of channels in the PNG-encoded image. 1: output a grayscale image. 3: output an RGB image. 4: output an RGBA image. If needed, the PNG-encoded image is transformed to match the requested number of color channels. Args: contents: A Tensor of typ

tf.image.decode_jpeg()

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. The attr channels indicates the desired number of color channels for the decoded image. Accepted values are: 0: Use the number of channels in the JPEG-encoded image. 1: output a grayscale image. 3: output an RGB image. If needed, the JPEG-encoded image is transformed to match the requested number of col

tf.image.crop_to_bounding_box()

tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width) Crops an image to a specified bounding box. This op cuts a rectangular part out of image. The top-left corner of the returned image is at offset_height, offset_width in image, and its lower-right corner is at offset_height + target_height, offset_width + target_width. Args: image: 3-D tensor with shape [height, width, channels] offset_height: Vertical coordinate of the top-left corner of the resul

tf.image.crop_and_resize()

tf.image.crop_and_resize(image, boxes, box_ind, crop_size, method=None, extrapolation_value=None, name=None) Extracts crops from the input image tensor and bilinearly resizes them (possibly with aspect ratio change) to a common output size specified by crop_size. This is more general than the crop_to_bounding_box op which extracts a fixed size slice from the input image and does not allow resizing or aspect ratio change. Returns a tensor with crops from the input image at positions defined at

tf.image.convert_image_dtype()

tf.image.convert_image_dtype(image, dtype, saturate=False, name=None) Convert image to dtype, scaling its values if needed. Images that are represented using floating point values are expected to have values in the range [0,1). Image data stored in integer data types are expected to have values in the range [0,MAX], where MAX is the largest positive representable number for the data type. This op converts between data types, scaling the values appropriately before casting. Note that converting

tf.image.central_crop()

tf.image.central_crop(image, central_fraction) Crop the central region of the image. Remove the outer parts of an image but retain the central region of the image along each dimension. If we specify central_fraction = 0.5, this function returns the region marked with "X" in the below diagram. -------- | | | XXXX | | XXXX | | | where "X" is the central 50% of the image. -------- Args: image: 3-D float Tensor of shape [height, width, depth] central_fraction: float (0, 1]