aisquared.config.preprocessing.image package

Submodules

aisquared.config.preprocessing.image.ImagePreprocessing module

class aisquared.config.preprocessing.image.ImagePreprocessing.ImagePreprocesser(steps: list | None = None)[source]

Bases: BaseObject

Preprocesser object for image data

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.image.ImagePreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.image.AddValue(255.0)
)
add_step(step)[source]

Add a step to the preprocesser object

property step_dict
to_dict() dict[source]

Get the configuration object as a dictionary

aisquared.config.preprocessing.image.Steps module

class aisquared.config.preprocessing.image.Steps.AddValue(value: int | float)[source]

Bases: BaseObject

Preprocessing step to add a value to all pixels in an image

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.image.ImagePreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.image.AddValue(255.0)
)
to_dict() dict[source]

Get the configuration object as a dictionary

property value
class aisquared.config.preprocessing.image.Steps.ConvertToColor(color: str)[source]

Bases: BaseObject

Preprocessing step to convert images to a color scheme

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.image.ImagePreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.image.ConvertToColor('RGB')
)
property color
to_dict() dict[source]

Get the configuration object as a dictionary

class aisquared.config.preprocessing.image.Steps.DivideValue(value: int | float)[source]

Bases: BaseObject

Preprocessing step to divide all pixels in an image by a value

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.image.ImagePreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.image.DivideValue(255.0)
)
to_dict() dict[source]

Get the configuration object as a dictionary

property value
class aisquared.config.preprocessing.image.Steps.MultiplyValue(value: int | float)[source]

Bases: BaseObject

Preprocessing step to multiply all pixels in an image by a value

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.image.ImagePreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.image.MultiplyValue(2.0)
)
to_dict() dict[source]

Get the configuration object as a dictionary

property value
class aisquared.config.preprocessing.image.Steps.Resize(size: list, method: str = 'bilinear', preserve_aspect_ratio: bool = False)[source]

Bases: BaseObject

Preprocessing step to resize an image

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.image.ImagePreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.image.Resize([100, 100])
)
property method
property preserve_aspect_ratio
property size
to_dict() dict[source]

Get the configuration object as a dictionary

class aisquared.config.preprocessing.image.Steps.SubtractValue(value: int | float)[source]

Bases: BaseObject

Preprocessing step to subtract a value from all pixels in an image

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.image.ImagePreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.image.SubtractValue(255.0)
)
to_dict() dict[source]

Get the configuration object as a dictionary

property value

Module contents

The aisquared.config.preprocessing.image subpackage contains objects for configuring image preprocessing.