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

Method apply_coords

PATH/core/data/transforms/seg_aug_dev.py:110–126  ·  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

108 return tensor.numpy()
109
110 def apply_coords(self, coords: np.ndarray) -> np.ndarray:
111 """
112 Flip the coordinates.
113
114 Args:
115 coords (ndarray): floating point array of shape Nx2. Each row is
116 (x, y).
117 Returns:
118 ndarray: the flipped coordinates.
119
120 Note:
121 The inputs are floating point coordinates, not pixel indices.
122 Therefore they are flipped by `(W - x, H - y)`, not
123 `(W - 1 - x, H - 1 - y)`.
124 """
125 coords[:, 1] = self.height - coords[:, 1]
126 return coords
127
128 def inverse(self) -> Transform:
129 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected