module documentation
TensorFlow utilities.
Class |
|
Base class for sample writers that emit tf.train.Example protos. |
Class |
|
Exporter that writes an image classification dataset to disk as TFRecords. |
Class |
|
Importer for TF image classification datasets stored on disk. |
Class |
|
Class for generating tf.train.Example protos for samples in TF image classification format. |
Class |
|
Parser for image classification samples stored as TFRecords. |
Class |
|
Exporter that writes an object detection dataset to disk as TFRecords in the TF Object Detection API format. |
Class |
|
Importer for TF detection datasets stored on disk. |
Class |
|
Class for generating tf.train.Example protos for samples in TF Object Detection API format. |
Class |
|
Parser for samples in TF Object Detection API format. |
Class |
|
Base class for sample parsers that ingest tf.train.Example protos containing labeled images. |
Class |
|
Base class for fiftyone.utils.data.exporters.LabeledImageDatasetExporter instances that export labeled images as TFRecords datasets on disk. |
Class |
|
Base class for fiftyone.utils.data.importers.LabeledImageDatasetImporter instances that import tf.train.Example protos containing labeled images. |
Class |
|
Class for writing TFRecords to disk. |
Function | from |
Creates a tf.data.Dataset for the given image classification dataset directory tree. |
Function | from |
Creates a tf.data.Dataset for an image classification dataset stored as a list of image paths and labels. |
Function | from |
Creates a tf.data.Dataset for the given list of images. |
Function | from |
Creates a tf.data.Dataset for the given directory of images. |
Function | from |
Creates a tf.data.Dataset for the given glob pattern of images. |
Function | from |
Creates a tf.data.Dataset for the TFRecords at the given path(s). |
Function | write |
Writes the given tf.train.Example protos to disk as TFRecords. |
Variable | logger |
Undocumented |
Function | _bytes |
Undocumented |
Function | _bytes |
Undocumented |
Function | _float |
Undocumented |
Function | _float |
Undocumented |
Function | _get |
Undocumented |
Function | _int64 |
Undocumented |
Function | _int64 |
Undocumented |
Function | _parse |
Undocumented |
Function | _to |
Undocumented |
def from_image_classification_dir_tree(dataset_dir, force_rgb=False, num_parallel_calls=None):
(source)
¶
Creates a tf.data.Dataset for the given image classification dataset directory tree.
The directory should have the following format:
<dataset_dir>/ <classA>/ <image1>.<ext> <image2>.<ext> ... <classB>/ <image1>.<ext> <image2>.<ext> ...
Parameters | |
dataset | the dataset directory |
forceFalse | whether to force convert all images to RGB |
numNone | the number of samples to read asynchronously in parallel. See https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map for details |
Returns | |
a tuple of |
|
def from_image_paths_and_labels(image_paths, labels, force_rgb=False, num_parallel_calls=None):
(source)
¶
Creates a tf.data.Dataset for an image classification dataset stored as a list of image paths and labels.
Parameters | |
image | an iterable of image paths |
labels | an iterable of labels |
forceFalse | whether to force convert all images to RGB |
numNone | the number of samples to read asynchronously in parallel. See https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map for details |
Returns | |
a tf.data.Dataset that emits (img, label) pairs |
Creates a tf.data.Dataset for the given list of images.
Parameters | |
image | an iterable of image paths |
forceFalse | whether to force convert all images to RGB |
numNone | the number of samples to read asynchronously in parallel. See https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map for details |
Returns | |
a tf.data.Dataset that emits decoded images |
def from_images_dir(images_dir, recursive=True, force_rgb=False, num_parallel_calls=None):
(source)
¶
Creates a tf.data.Dataset for the given directory of images.
Parameters | |
images | a directory of images |
recursive:True | whether to recursively traverse subdirectories |
forceFalse | whether to force convert all images to RGB |
numNone | the number of samples to read asynchronously in parallel. See https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map for details |
Returns | |
a tf.data.Dataset that emits decoded images |
Creates a tf.data.Dataset for the given glob pattern of images.
Parameters | |
images | a glob pattern of images like /path/to/images/*.jpg |
forceFalse | whether to force convert all images to RGB |
numNone | the number of samples to read asynchronously in parallel. See https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map for details |
Returns | |
a tf.data.Dataset that emits decoded images |
Creates a tf.data.Dataset for the TFRecords at the given path(s).
Parameters | |
tf | the path (or glob pattern of paths) to the TFRecords file(s) to load |
bufferNone | an optional buffer size, in bytes, to use when reading the records. Reasonable values are 1-100MBs |
numNone | an optional number of files to read in parallel. If a negative value is passed, this parameter is set to the number of CPU cores on the host machine. By default, the files are read in series |
Returns | |
a tf.data.Dataset that emits tf.train.Example protos |
Writes the given tf.train.Example protos to disk as TFRecords.
Parameters | |
examples | an iterable that emits tf.train.Example protos |
tf | the path to write the .tfrecords file. If sharding is requested -%%05d-of-%%05d is appended to the path |
numNone | an optional number of shards to split the records into (using a round robin strategy) |