Generate thresholds and weights for the given range. Args: ---- t_min (float): Minimum threshold. t_max (float): Maximum threshold. N (int): Number of thresholds. Returns: ------- Tuple[np.ndarray, np.ndarray]: Array of thresholds and corresponding w
(
t_min: float, t_max: float, N: int
)
| 222 | |
| 223 | |
| 224 | def get_thresholds_and_weights( |
| 225 | t_min: float, t_max: float, N: int |
| 226 | ) -> Tuple[np.ndarray, np.ndarray]: |
| 227 | """Generate thresholds and weights for the given range. |
| 228 | |
| 229 | Args: |
| 230 | ---- |
| 231 | t_min (float): Minimum threshold. |
| 232 | t_max (float): Maximum threshold. |
| 233 | N (int): Number of thresholds. |
| 234 | |
| 235 | Returns: |
| 236 | ------- |
| 237 | Tuple[np.ndarray, np.ndarray]: Array of thresholds and corresponding weights. |
| 238 | |
| 239 | """ |
| 240 | thresholds = np.linspace(t_min, t_max, N) |
| 241 | weights = thresholds / thresholds.sum() |
| 242 | return thresholds, weights |
| 243 | |
| 244 | |
| 245 | def invert_depth(depth: np.ndarray, eps: float = 1e-6) -> np.ndarray: |
no outgoing calls
no test coverage detected