Skip to content
class

FromFloat

extends_NoParamsPhotometricTransform[Empty]
FromFloat(max_value: float = 255.0, dtype: str = 'uint8', p: float = 1.0)

Scale a [0, 1] image back up by max_value (Albumentations FromFloat).

Parameters

max_valuefloat= 255.0
No description.
pfloat= 1.0
No description.

Notes

Stays in floating point (Lucid keeps a float tensor); the Albu dtype argument is accepted for signature parity but the result is not re-quantized.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.FromFloat(p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 32, 32)
The inverse of ToFloat, and the pair is what moves an
image between the 0-1 range a network wants and the 0-255 one a
file holds.

Used by 1

Constructors

1
dunder

__init__

→None
__init__(max_value: float = 255.0, dtype: str = 'uint8', p: float = 1.0)

Instance methods

1
fn

make_params

→Emptyfrom _NoParams
make_params(img: Tensor)

Dunder methods

1