On this page
tf.keras.preprocessing.image.Iterator
Base class for image data iterators.
Inherits From: Sequence
tf.keras.preprocessing.image.Iterator(
n, batch_size, shuffle, seed
)
Every Iterator
must implement the _get_batches_of_transformed_samples
method.
Args | |
---|---|
n |
Integer, total number of samples in the dataset to loop over. |
batch_size |
Integer, size of a batch. |
shuffle |
Boolean, whether to shuffle the data between epochs. |
seed |
Random seeding for data shuffling. |
Methods
next
next()
For python 2.x.
Returns | |
---|---|
The next batch. |
on_epoch_end
on_epoch_end()
Method called at the end of every epoch.
reset
reset()
__getitem__
__getitem__(
idx
)
Gets batch at position index
.
Args | |
---|---|
index |
position of the batch in the Sequence. |
Returns | |
---|---|
A batch |
__iter__
__iter__()
Create a generator that iterate over the Sequence.
__len__
__len__()
Number of batch in the Sequence.
Returns | |
---|---|
The number of batches in the Sequence. |
Class Variables | |
---|---|
white_list_formats | ('png', 'jpg', 'jpeg', 'bmp', 'ppm', 'tif', 'tiff') |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/keras/preprocessing/image/Iterator