graphlab.Image

class graphlab.Image(path=None, format='auto', **_Image__internal_kw_args)

A class whose objects contains image data, meta-data, and supports useful utility methods. This is intended to make image pre-processing easier for input into subsequent learning methods. Supports reading of JPEG and PNG formats.

Parameters:

path : string

The path of the location of the image file to be loaded into the Image object.

format : {‘auto’ | ‘JPG’ | ‘PNG’}, optional

Defaults to ‘auto’. A format hint for the constructor. If left as ‘auto’, constructor tries to infer file format from file extension. Otherwise, tries to decode file as whatever the format hint suggests.

Examples

>>> img = graphlab.Image('https://static.turi.com/datasets/images/sample.jpg')
>>> graphlab.SArray([img]).show()

Methods

Image.show() Displays the image.

Attributes

Image.channels Returns the number of channels in the image stored in the Image object.
Image.height Returns the height of the image stored in the Image object.
Image.pixel_data Returns the pixel data stored in the Image object.
Image.width Returns the width of the image stored in the Image object.