MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / apply_coords

Method apply_coords

PATH/core/data/transforms/seg_aug_dev.py:56–72  ·  view source on GitHub ↗

Flip the coordinates. Args: coords (ndarray): floating point array of shape Nx2. Each row is (x, y). Returns: ndarray: the flipped coordinates. Note: The inputs are floating point coordinates, not pixel indices.

(self, coords: np.ndarray)

Source from the content-addressed store, hash-verified

54 return np.flip(img, axis=-2)
55
56 def apply_coords(self, coords: np.ndarray) -> np.ndarray:
57 """
58 Flip the coordinates.
59
60 Args:
61 coords (ndarray): floating point array of shape Nx2. Each row is
62 (x, y).
63 Returns:
64 ndarray: the flipped coordinates.
65
66 Note:
67 The inputs are floating point coordinates, not pixel indices.
68 Therefore they are flipped by `(W - x, H - y)`, not
69 `(W - 1 - x, H - 1 - y)`.
70 """
71 coords[:, 0] = self.width - coords[:, 0]
72 return coords
73
74 def inverse(self) -> Transform:
75 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected