Skip to content
class

ToFloat

extends_NoParamsPhotometricTransform[Empty]
ToFloat(max_value: float = 255.0, p: float = 1.0)

Scale an integer-range image to [0, 1] (Albumentations ToFloat).

Parameters

max_valuefloat= 255.0
Value the image is divided by.
pfloat= 1.0
No description.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.ToFloat(p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 32, 32)
Divides by max_value, so an 8-bit image lands in 0-1. The
input here is already float, which is why the values do not move.

Used by 1

Constructors

1
dunder

__init__

→None
__init__(max_value: float = 255.0, p: float = 1.0)

Instance methods

1
fn

make_params

→Emptyfrom _NoParams
make_params(img: Tensor)

Dunder methods

1