Effect
-
class
text_renderer.effect.
Effect
(p=0.5)[source] Apply different augmentations to image.
E.g. add noise, add dropout, add padding…
- Parameters
p (float) – Probability of apply this effect
-
abstract
apply
(img: PIL.Image.Image, text_bbox: text_renderer.utils.bbox.BBox)[source] - Parameters
img (PILImage) – Image to apply effect
text_bbox (BBox) – bbox of text on input Image
- Returns
PILImage – Image changed
BBox – Text bbox on image after apply effect. Some effects (such as Padding) may modify the relative position of the text in the image.
-
class
text_renderer.effect.
Effects
(effects: Union[text_renderer.effect.base_effect.Effect, List[text_renderer.effect.base_effect.Effect], text_renderer.effect.selector.Selector, List[text_renderer.effect.selector.Selector]])[source] Apply multiple effects