load_sample_image#

sklearn.datasets.load_sample_image(image_name)[源代码]#

加载单个示例图像的numpy数组。

阅读更多的 User Guide .

参数:
image_name{china.jpg, flower.jpg}

加载的示例图像的名称。

返回:
img3D阵列

图像作为一个麻木的数组:高度x宽度x颜色。

示例

>>> from sklearn.datasets import load_sample_image
>>> china = load_sample_image('china.jpg')
>>> china.dtype
dtype('uint8')
>>> china.shape
(427, 640, 3)
>>> flower = load_sample_image('flower.jpg')
>>> flower.dtype
dtype('uint8')
>>> flower.shape
(427, 640, 3)