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

Method apply_coords

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

Apply crop transform on coordinates. Args: coords (ndarray): floating point array of shape Nx2. Each row is (x, y). Returns: ndarray: cropped coordinates.

(self, coords: np.ndarray)

Source from the content-addressed store, hash-verified

191 return img[..., self.y0 : self.y0 + self.h, self.x0 : self.x0 + self.w, :]
192
193 def apply_coords(self, coords: np.ndarray) -> np.ndarray:
194 """
195 Apply crop transform on coordinates.
196
197 Args:
198 coords (ndarray): floating point array of shape Nx2. Each row is
199 (x, y).
200 Returns:
201 ndarray: cropped coordinates.
202 """
203 coords[:, 0] -= self.x0
204 coords[:, 1] -= self.y0
205 return coords
206
207 def apply_polygons(self, polygons: list) -> list:
208 """

Callers 1

apply_polygonsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected