new gpr
This commit is contained in:
@@ -50,7 +50,7 @@ def collection_has_gpr_payloads(collection: ResultCollection) -> bool:
|
||||
|
||||
|
||||
def gpr_object_rows(collection: ResultCollection) -> np.ndarray:
|
||||
"""Return object rows as `[x_m, z_m, pair_count]` from a GPR collection."""
|
||||
"""Return object rows as `[x_m, z_m, score]` from a GPR collection."""
|
||||
points_payload = collection_payload_by_name(collection, "gpr_points", kind=4)
|
||||
if points_payload is not None:
|
||||
points = np.asarray(points_payload.table, dtype=np.float32)
|
||||
@@ -68,17 +68,17 @@ def gpr_object_rows(collection: ResultCollection) -> np.ndarray:
|
||||
|
||||
def locator_observations_from_collection(
|
||||
collection: ResultCollection,
|
||||
min_pair_count: float,
|
||||
min_score: float,
|
||||
*,
|
||||
visible_bounds: tuple[float, float, float, float] | None = None,
|
||||
) -> list[dict[str, float]]:
|
||||
"""Build locator observations from GPR rows using pair threshold and optional X/Z bounds."""
|
||||
"""Build locator observations from GPR rows using score threshold and optional X/Z bounds."""
|
||||
rows = gpr_object_rows(collection)
|
||||
if rows.size == 0:
|
||||
return []
|
||||
|
||||
finite_mask = np.all(np.isfinite(rows[:, :3]), axis=1)
|
||||
visible_mask = finite_mask & (rows[:, 2] >= float(min_pair_count))
|
||||
visible_mask = finite_mask & (rows[:, 2] >= float(min_score))
|
||||
if visible_bounds is not None:
|
||||
x_min, x_max, z_min, z_max = (float(value) for value in visible_bounds)
|
||||
visible_mask &= (
|
||||
@@ -90,7 +90,7 @@ def locator_observations_from_collection(
|
||||
filtered = rows[visible_mask]
|
||||
|
||||
observations: list[dict[str, float]] = []
|
||||
for x_m, z_m, _pair_count in filtered:
|
||||
for x_m, z_m, _score in filtered:
|
||||
observations.append(
|
||||
{
|
||||
"dst": round(float(z_m), 2),
|
||||
|
||||
Reference in New Issue
Block a user