datumaro.util.points_util#

Functions

normalize_points(positions)

Normalize a set of keypoints to fit within a unit bounding box [0, 1] x [0, 1], maintaining the aspect ratio.

datumaro.util.points_util.normalize_points(positions: list[float]) list[float][source]#

Normalize a set of keypoints to fit within a unit bounding box [0, 1] x [0, 1], maintaining the aspect ratio.

Parameters:

keypoints (list[float]) – A list of point positions in the format [x1, y1, x2, y2, …, xn, yn].

Returns:

Normalized keypoints within the unit bounding box, preserving aspect ratio.

Return type:

list[float]