dial_core.datasets.datatype package

Module contents

DataTypes used by the datasets

class dial_core.datasets.datatype.Categorical(categories)[source]

Bases: dial_core.datasets.datatype.datatype.DataType

Represents a Category.

A Category is a number indexed on an array of strings, each one representing a different category.

display(data)[source]

Return the display representation of the data.

For example, for Categorical types this will be the actual category name instead of an interger.

Return type:str
process(data)[source]

Return the data after processing given the data type.

For example, if the DataType is an ImagePath, process() will open the image and return the array corresponding to its content.

Return type:List[int]
class dial_core.datasets.datatype.DataType[source]

Bases: object

Abstract class for any data type.

abstract display(data)[source]

Return the display representation of the data.

For example, for Categorical types this will be the actual category name instead of an interger.

abstract process(data)[source]

Return the data after processing given the data type.

For example, if the DataType is an ImagePath, process() will open the image and return the array corresponding to its content.

class dial_core.datasets.datatype.ImageArray[source]

Bases: dial_core.datasets.datatype.datatype.DataType

Image, represented as an array of int values, each one representing a pixel intensity (0-255).

The array will have shape (W, H), for grayscale images, or (W, H, C), where C represents the number of color channels (For RGB images)

display(data)[source]

Return the display representation of the data.

For example, for Categorical types this will be the actual category name instead of an interger.

process(data)[source]

Return the data after processing given the data type.

For example, if the DataType is an ImagePath, process() will open the image and return the array corresponding to its content.

Return type:np.ndarray
class dial_core.datasets.datatype.Numeric[source]

Bases: dial_core.datasets.datatype.datatype.DataType

Represents a single numeric value.

display(data)[source]

Return the display representation of the data.

For example, for Categorical types this will be the actual category name instead of an interger.

Return type:str
process(data)[source]

Return the data after processing given the data type.

For example, if the DataType is an ImagePath, process() will open the image and return the array corresponding to its content.

Return type:int
class dial_core.datasets.datatype.NumericArray[source]

Bases: dial_core.datasets.datatype.datatype.DataType

Represents an array of numeric values (unidimensional)

display(data)[source]

Return the display representation of the data.

For example, for Categorical types this will be the actual category name instead of an interger.

Return type:str
process(data)[source]

Return the data after processing given the data type.

For example, if the DataType is an ImagePath, process() will open the image and return the array corresponding to its content.

Return type:ndarray