← Back to all transforms
TemplateTransform
Description
Apply blending of input image with specified templates Args: templates (numpy array or list of numpy arrays): Images as template for transform. img_weight: If single float weight will be sampled from (0, img_weight). If tuple of float img_weight will be in range `[img_weight[0], img_weight[1])`. If you want fixed weight, use (img_weight, img_weight) Default: (0.5, 0.5). template_weight: If single float weight will be sampled from (0, template_weight). If tuple of float template_weight will be in range `[template_weight[0], template_weight[1])`. If you want fixed weight, use (template_weight, template_weight) Default: (0.5, 0.5). template_transform: transformation object which could be applied to template, must produce template the same size as input image. name: (Optional) Name of transform, used only for deserialization. p: probability of applying the transform. Default: 0.5. Targets: image Image types: uint8, float32
Parameters
- p: float (default: 0.5)
- templates: ndarray | Sequence[ndarray] (default: null)
- img_weight: int | tuple[int, int] | float | tuple[float, float] (default: (0.5, 0.5))
- template_weight: int | tuple[int, int] | float | tuple[float, float] (default: (0.5, 0.5))
- template_transform: Callable[Ellipsis, Any] | None (default: null)
- name: str | None (default: null)
Targets
- Image
Try it out
Original Image (width = 484, height = 733):
Reference Image:
Transformed Image:
Transform not yet applied