<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/legacy/preprocessing/image.py#L519-L678) |

Iterator yielding data from a Numpy array.

Inherits From: [`Iterator`](https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image/Iterator), [`PyDataset`](https://www.tensorflow.org/api_docs/python/tf/keras/utils/PyDataset)

    tf.keras.preprocessing.image.NumpyArrayIterator(
        x,
        y,
        image_data_generator,
        batch_size=32,
        shuffle=False,
        sample_weight=None,
        seed=None,
        data_format=None,
        save_to_dir=None,
        save_prefix='',
        save_format='png',
        subset=None,
        ignore_class_split=False,
        dtype=None
    )

DEPRECATED.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `max_queue_size` | <br /> <br /> |
| `num_batches` | Number of batches in the PyDataset. |
| `use_multiprocessing` | <br /> <br /> |
| `workers` | <br /> <br /> |

<br />

## Methods

### `on_epoch_begin`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/trainers/data_adapters/py_dataset_adapter.py#L189-L191)

    on_epoch_begin()

Method called at the beginning of every epoch.

### `on_epoch_end`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/legacy/preprocessing/image.py#L77-L78)

    on_epoch_end()

Method called at the end of every epoch.

### `reset`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/legacy/preprocessing/image.py#L80-L81)

    reset()

### `__getitem__`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/legacy/preprocessing/image.py#L57-L72)

    __getitem__(
        idx
    )

Gets batch at position `index`.

<br />

<br />

<br />

| Args ||
|---|---|
| `index` | position of the batch in the PyDataset. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A batch ||

<br />

### `__iter__`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/legacy/preprocessing/image.py#L106-L109)

    __iter__()

### `__len__`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/legacy/preprocessing/image.py#L74-L75)

    __len__()

<br />

<br />

<br />

| ## Class Variables ||
|---|---|
| white_list_formats | `('png', 'jpg', 'jpeg', 'bmp', 'ppm', 'tif', 'tiff')` |

<br />