Your ad could be here - Reach CV/ML engineers
Contact for advertisingContactInterested in advertising?
Contact usStay updated
News & Insightsalbumentations.augmentations.other.lambda_transform
Lambda transform module for creating custom user-defined transformations. This module provides a flexible transform class that allows users to define their own custom transformation functions for different targets (image, mask, keypoints, bboxes). It's particularly useful for implementing custom logic that isn't available in the standard transforms. The Lambda transform accepts different callable functions for each target type and applies them when the transform is executed. This allows for maximum flexibility while maintaining compatibility with the Albumentations pipeline structure. Key features: - Apply different custom functions to different target types - Compatible with all Albumentations pipeline features - Support for all image types and formats - Ability to handle any number of channels - Warning system for lambda expressions and multiprocessing compatibility Note that using actual lambda expressions (rather than named functions) can cause issues with multiprocessing, as lambdas cannot be properly pickled.
Members
- classLambda
Lambdaclass
A flexible transformation class for using user-defined transformation functions per targets. Function signature must include **kwargs to accept optional arguments like interpolation method, image size, etc:
Parameters
Name | Type | Default | Description |
---|---|---|---|
image | One of:
| None | Image transformation function. |
mask | One of:
| None | Mask transformation function. |
keypoints | One of:
| None | Keypoints transformation function. |
bboxes | One of:
| None | BBoxes transformation function. |
name | One of:
| None | - |
p | float | 1.0 | probability of applying the transform. Default: 1.0. |