tf.keras.preprocessing.image.img_to_array
| View source on GitHub |
Преобразует экземпляр PIL Image в массив NumPy.
tf.keras.preprocessing.image.img_to_array(
img, data_format=None, dtype=None
)
| Аргументы | |
|---|---|
img | Экземпляр PIL Image. |
data_format | Формат данных изображения, либо "channels_first", либо "channels_last". |
dtype | Тип данных для возвращаемого массива. |
| Возвращает | |
|---|---|
| 3D массив NumPy. |
| Возможные исключения | |
|---|---|
ValueError | если передан недопустимый img или data_format. |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/preprocessing/image/img_to_array