Skip to content
class

Pose

extendsTransformsPreset
Pose(crop_size: int, resize_size: int = 256, mean: tuple[float, ...] | None = None, std: tuple[float, ...] | None = None, interpolation: str | Interpolation = Interpolation.BILINEAR)

Keypoint / pose-estimation preset.

Pipeline: SmallestMaxSize(resize_size) → CenterCrop(crop_size) → Normalize. Keypoint coordinates ride along through every geometric stage's _apply_keypoints hook; extra columns (visibility / score / angle) pass through unchanged.

Parameters

crop_sizeint
Square crop fed to the model.
resize_sizeint= 256
Shorter-side length before cropping.
meantuple of float= None
Per-channel normalization stats; default ImageNet.
stdtuple of float= None
Per-channel normalization stats; default ImageNet.
interpolationstr or Interpolation= "bilinear"
No description.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.Pose(crop_size=256)
>>> tuple(tf(T.Image(lucid.rand(3, 300, 400))).data.shape)
(3, 256, 256)
Keypoints handed in beside the image are moved with it, which is the
reason this is a preset rather than a resize and a crop.

Used by 1

Constructors

1
dunder

__init__

→None
__init__(crop_size: int, resize_size: int = 256, mean: tuple[float, ...] | None = None, std: tuple[float, ...] | None = None, interpolation: str | Interpolation = Interpolation.BILINEAR)