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)
| 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 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected