Converters

[source]

ImageReader

polyaxon.datasets.converters.ImageReader(channels=3)

Base ImageReader class that provides an operation to read/encode/decode an image.


[source]

PNGImageReader

polyaxon.datasets.converters.PNGImageReader(channels=3)

A png image class reader


[source]

PNGNumpyImageReader

polyaxon.datasets.converters.PNGNumpyImageReader(shape=None)

A numpy png image class reader


[source]

JPGNumpyImageReader

polyaxon.datasets.converters.JPGNumpyImageReader(shape=None)

A jpeg numpy image class reader


[source]

JPEGImageReader

polyaxon.datasets.converters.JPEGImageReader(channels=3)

A jpeg image class reader


[source]

ImagesToTFExampleConverter

polyaxon.datasets.converters.ImagesToTFExampleConverter(classes, colorspace, image_format, channels, image_reader=None, height=None, width=None, store_filenames=False)

Converts images to a TFRecords of TF-Example protos.

Each record is TF-Example protocol buffer which contain a single image and label.

  • Args:
    • classes: dict or list. The data classes. e.g. ['zero', 'one', 'two', ...] or {0: 'cats', 1: 'dogs'}
    • colorspace: str. The color space of the images, 'rgb', 'grayscale' ...
    • image_format: str. The format of the images, 'png', 'jpeg'.
    • channels: int. The number of channels of the images, e.g. 1, 3.
    • image_reader: ImageReader instance. If None an image reader is created automatically based on the image_format.
    • height: int. If provided the the height per image will not be stored in the TFRecord, only in the meta_data file.
    • width: int. If provided the the width per image will not be stored in the TFRecord, only in the meta_data file.
    • store_filenames: bool. If True the filename of the image will be stored as a feature.