Skip to content

Augmentations

Source

CAREamics transformation Pydantic models.

SPATIAL_TRANSFORMS_UNION = Annotated[Union[XYFlipConfig, XYRandomRotate90Config], Discriminator('name')] module-attribute

Available spatial transforms in CAREamics.

XYFlipConfig

Bases: BaseModel

Configuration for the XYFlip augmentation.

Attributes:

  • name (Literal['XYFlip']) –

    Name of the transformation.

  • p (float) –

    Probability of applying the transform, by default 0.5.

  • seed (int | None) –

    Seed for the random number generator, by default None.

model_dump(**kwargs)

Return the model as a dictionary.

Parameters:

  • **kwargs

    Pydantic BaseMode model_dump method keyword arguments.

Returns:

  • {str: Any}

    Dictionary representation of the model.

XYRandomRotate90Config

Bases: BaseModel

Configuration for the XY random 90 degree rotation augmentation.

Attributes:

  • name (Literal['XYRandomRotate90']) –

    Name of the transformation.

  • p (float) –

    Probability of applying the transform, by default 0.5.

  • seed (int | None) –

    Seed for the random number generator, by default None.

model_dump(**kwargs)

Return the model as a dictionary.

Parameters:

  • **kwargs

    Pydantic BaseMode model_dump method keyword arguments.

Returns:

  • {str: Any}

    Dictionary representation of the model.