Skip to content
class

ZoomBlur

extendsPhotometricTransform[ZoomParam]
ZoomBlur(max_factor: float = 1.31, step_factor: tuple[float, float] = (0.01, 0.03), p: float = 0.5)

Radial zoom blur via averaged centre-zoomed copies (Albumentations ZoomBlur).

Samples a final zoom factor uniformly from [1.0, max_factor], builds 5 centre-crops at progressively-increasing zoom levels (each resized back to the input (H, W) via bilinear), and averages them with the original image — simulates a fast forward dolly into the scene.

Parameters

max_factorfloat= 1.31
Upper bound on the final zoom factor (must be >= 1.0).
step_factor(float, float)= (0.01, 0.03)
Reserved for future per-step jitter; currently the 5 zoom levels are evenly spaced toward max_factor regardless.
pfloat= 0.5
Probability of applying the transform.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.ZoomBlur(p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 32, 32)

Used by 1

Constructors

1
dunder

__init__

→None
__init__(max_factor: float = 1.31, step_factor: tuple[float, float] = (0.01, 0.03), p: float = 0.5)

Instance methods

1
fn

make_params

→ZoomParam
make_params(img: Tensor)

Sample per-call random parameters for ZoomBlur.

Parameters

Image tensor; not inspected, carried through for dispatch.

Returns

ZoomParam

Carries factor — the final zoom factor drawn uniformly from [1.0, max_factor]. The apply step interpolates 5 intermediate zoom levels between 1.0 and factor.

Dunder methods

1