Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/tensorflow/_api/v2/image/__init__.py: 100%
73 statements
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 07:57 +0000
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 07:57 +0000
1# This file is MACHINE GENERATED! Do not edit.
2# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
3"""Image ops.
5The `tf.image` module contains various functions for image
6processing and decoding-encoding Ops.
8Many of the encoding/decoding functions are also available in the
9core `tf.io` module.
11## Image processing
13### Resizing
15The resizing Ops accept input images as tensors of several types. They always
16output resized images as float32 tensors.
18The convenience function `tf.image.resize` supports both 4-D
19and 3-D tensors as input and output. 4-D tensors are for batches of images,
203-D tensors for individual images.
22Resized images will be distorted if their original aspect ratio is not the
23same as size. To avoid distortions see tf.image.resize_with_pad.
25* `tf.image.resize`
26* `tf.image.resize_with_pad`
27* `tf.image.resize_with_crop_or_pad`
29The Class `tf.image.ResizeMethod` provides various resize methods like
30`bilinear`, `nearest_neighbor`.
32### Converting Between Colorspaces
34Image ops work either on individual images or on batches of images, depending on
35the shape of their input Tensor.
37If 3-D, the shape is `[height, width, channels]`, and the Tensor represents one
38image. If 4-D, the shape is `[batch_size, height, width, channels]`, and the
39Tensor represents `batch_size` images.
41Currently, `channels` can usefully be 1, 2, 3, or 4. Single-channel images are
42grayscale, images with 3 channels are encoded as either RGB or HSV. Images
43with 2 or 4 channels include an alpha channel, which has to be stripped from the
44image before passing the image to most image processing functions (and can be
45re-attached later).
47Internally, images are either stored in as one `float32` per channel per pixel
48(implicitly, values are assumed to lie in `[0,1)`) or one `uint8` per channel
49per pixel (values are assumed to lie in `[0,255]`).
51TensorFlow can convert between images in RGB or HSV or YIQ.
53* `tf.image.rgb_to_grayscale`, `tf.image.grayscale_to_rgb`
54* `tf.image.rgb_to_hsv`, `tf.image.hsv_to_rgb`
55* `tf.image.rgb_to_yiq`, `tf.image.yiq_to_rgb`
56* `tf.image.rgb_to_yuv`, `tf.image.yuv_to_rgb`
57* `tf.image.image_gradients`
58* `tf.image.convert_image_dtype`
60### Image Adjustments
62TensorFlow provides functions to adjust images in various ways: brightness,
63contrast, hue, and saturation. Each adjustment can be done with predefined
64parameters or with random parameters picked from predefined intervals. Random
65adjustments are often useful to expand a training set and reduce overfitting.
67If several adjustments are chained it is advisable to minimize the number of
68redundant conversions by first converting the images to the most natural data
69type and representation.
71* `tf.image.adjust_brightness`
72* `tf.image.adjust_contrast`
73* `tf.image.adjust_gamma`
74* `tf.image.adjust_hue`
75* `tf.image.adjust_jpeg_quality`
76* `tf.image.adjust_saturation`
77* `tf.image.random_brightness`
78* `tf.image.random_contrast`
79* `tf.image.random_hue`
80* `tf.image.random_saturation`
81* `tf.image.per_image_standardization`
83### Working with Bounding Boxes
85* `tf.image.draw_bounding_boxes`
86* `tf.image.combined_non_max_suppression`
87* `tf.image.generate_bounding_box_proposals`
88* `tf.image.non_max_suppression`
89* `tf.image.non_max_suppression_overlaps`
90* `tf.image.non_max_suppression_padded`
91* `tf.image.non_max_suppression_with_scores`
92* `tf.image.pad_to_bounding_box`
93* `tf.image.sample_distorted_bounding_box`
95### Cropping
97* `tf.image.central_crop`
98* `tf.image.crop_and_resize`
99* `tf.image.crop_to_bounding_box`
100* `tf.io.decode_and_crop_jpeg`
101* `tf.image.extract_glimpse`
102* `tf.image.random_crop`
103* `tf.image.resize_with_crop_or_pad`
105### Flipping, Rotating and Transposing
107* `tf.image.flip_left_right`
108* `tf.image.flip_up_down`
109* `tf.image.random_flip_left_right`
110* `tf.image.random_flip_up_down`
111* `tf.image.rot90`
112* `tf.image.transpose`
114## Image decoding and encoding
116TensorFlow provides Ops to decode and encode JPEG and PNG formats. Encoded
117images are represented by scalar string Tensors, decoded images by 3-D uint8
118tensors of shape `[height, width, channels]`. (PNG also supports uint16.)
120Note: `decode_gif` returns a 4-D array `[num_frames, height, width, 3]`
122The encode and decode Ops apply to one image at a time. Their input and output
123are all of variable size. If you need fixed size images, pass the output of
124the decode Ops to one of the cropping and resizing Ops.
126* `tf.io.decode_bmp`
127* `tf.io.decode_gif`
128* `tf.io.decode_image`
129* `tf.io.decode_jpeg`
130* `tf.io.decode_and_crop_jpeg`
131* `tf.io.decode_png`
132* `tf.io.encode_jpeg`
133* `tf.io.encode_png`
136"""
138import sys as _sys
140from tensorflow.python.ops.array_ops import extract_image_patches_v2 as extract_patches
141from tensorflow.python.ops.gen_image_ops import decode_and_crop_jpeg
142from tensorflow.python.ops.gen_image_ops import decode_bmp
143from tensorflow.python.ops.gen_image_ops import decode_gif
144from tensorflow.python.ops.gen_image_ops import decode_jpeg
145from tensorflow.python.ops.gen_image_ops import decode_png
146from tensorflow.python.ops.gen_image_ops import encode_jpeg
147from tensorflow.python.ops.gen_image_ops import extract_jpeg_shape
148from tensorflow.python.ops.gen_image_ops import hsv_to_rgb
149from tensorflow.python.ops.gen_image_ops import rgb_to_hsv
150from tensorflow.python.ops.image_ops_impl import ResizeMethod
151from tensorflow.python.ops.image_ops_impl import adjust_brightness
152from tensorflow.python.ops.image_ops_impl import adjust_contrast
153from tensorflow.python.ops.image_ops_impl import adjust_gamma
154from tensorflow.python.ops.image_ops_impl import adjust_hue
155from tensorflow.python.ops.image_ops_impl import adjust_jpeg_quality
156from tensorflow.python.ops.image_ops_impl import adjust_saturation
157from tensorflow.python.ops.image_ops_impl import central_crop
158from tensorflow.python.ops.image_ops_impl import combined_non_max_suppression
159from tensorflow.python.ops.image_ops_impl import convert_image_dtype
160from tensorflow.python.ops.image_ops_impl import crop_and_resize_v2 as crop_and_resize
161from tensorflow.python.ops.image_ops_impl import crop_to_bounding_box
162from tensorflow.python.ops.image_ops_impl import decode_image
163from tensorflow.python.ops.image_ops_impl import draw_bounding_boxes_v2 as draw_bounding_boxes
164from tensorflow.python.ops.image_ops_impl import encode_png
165from tensorflow.python.ops.image_ops_impl import extract_glimpse_v2 as extract_glimpse
166from tensorflow.python.ops.image_ops_impl import flip_left_right
167from tensorflow.python.ops.image_ops_impl import flip_up_down
168from tensorflow.python.ops.image_ops_impl import generate_bounding_box_proposals
169from tensorflow.python.ops.image_ops_impl import grayscale_to_rgb
170from tensorflow.python.ops.image_ops_impl import image_gradients
171from tensorflow.python.ops.image_ops_impl import is_jpeg
172from tensorflow.python.ops.image_ops_impl import non_max_suppression
173from tensorflow.python.ops.image_ops_impl import non_max_suppression_padded
174from tensorflow.python.ops.image_ops_impl import non_max_suppression_with_overlaps as non_max_suppression_overlaps
175from tensorflow.python.ops.image_ops_impl import non_max_suppression_with_scores
176from tensorflow.python.ops.image_ops_impl import pad_to_bounding_box
177from tensorflow.python.ops.image_ops_impl import per_image_standardization
178from tensorflow.python.ops.image_ops_impl import psnr
179from tensorflow.python.ops.image_ops_impl import random_brightness
180from tensorflow.python.ops.image_ops_impl import random_contrast
181from tensorflow.python.ops.image_ops_impl import random_flip_left_right
182from tensorflow.python.ops.image_ops_impl import random_flip_up_down
183from tensorflow.python.ops.image_ops_impl import random_hue
184from tensorflow.python.ops.image_ops_impl import random_jpeg_quality
185from tensorflow.python.ops.image_ops_impl import random_saturation
186from tensorflow.python.ops.image_ops_impl import resize_image_with_crop_or_pad as resize_with_crop_or_pad
187from tensorflow.python.ops.image_ops_impl import resize_image_with_pad_v2 as resize_with_pad
188from tensorflow.python.ops.image_ops_impl import resize_images_v2 as resize
189from tensorflow.python.ops.image_ops_impl import rgb_to_grayscale
190from tensorflow.python.ops.image_ops_impl import rgb_to_yiq
191from tensorflow.python.ops.image_ops_impl import rgb_to_yuv
192from tensorflow.python.ops.image_ops_impl import rot90
193from tensorflow.python.ops.image_ops_impl import sample_distorted_bounding_box_v2 as sample_distorted_bounding_box
194from tensorflow.python.ops.image_ops_impl import sobel_edges
195from tensorflow.python.ops.image_ops_impl import ssim
196from tensorflow.python.ops.image_ops_impl import ssim_multiscale
197from tensorflow.python.ops.image_ops_impl import stateless_random_brightness
198from tensorflow.python.ops.image_ops_impl import stateless_random_contrast
199from tensorflow.python.ops.image_ops_impl import stateless_random_flip_left_right
200from tensorflow.python.ops.image_ops_impl import stateless_random_flip_up_down
201from tensorflow.python.ops.image_ops_impl import stateless_random_hue
202from tensorflow.python.ops.image_ops_impl import stateless_random_jpeg_quality
203from tensorflow.python.ops.image_ops_impl import stateless_random_saturation
204from tensorflow.python.ops.image_ops_impl import stateless_sample_distorted_bounding_box
205from tensorflow.python.ops.image_ops_impl import total_variation
206from tensorflow.python.ops.image_ops_impl import transpose
207from tensorflow.python.ops.image_ops_impl import yiq_to_rgb
208from tensorflow.python.ops.image_ops_impl import yuv_to_rgb
209from tensorflow.python.ops.random_ops import random_crop
210from tensorflow.python.ops.random_ops import stateless_random_crop