web UI added and refactoring done
This commit is contained in:
@@ -8,8 +8,10 @@ import pyqtgraph as pg
|
||||
|
||||
from python_app.models.dataset_model import ResultCollection
|
||||
from python_app.orchestration.gpr_locator import (
|
||||
apply_object_draw_limits as gpr_apply_object_draw_limits,
|
||||
collection_payload_by_name as gpr_collection_payload_by_name,
|
||||
collection_payloads_by_prefix as gpr_collection_payloads_by_prefix,
|
||||
filter_object_rows as gpr_filter_object_rows,
|
||||
gpr_object_rows as extract_gpr_object_rows,
|
||||
)
|
||||
|
||||
@@ -252,13 +254,12 @@ class AppWindowGprPlotMixin:
|
||||
|
||||
self._draw_gpr_geometry_markers()
|
||||
|
||||
# Both gpr and legacy_gpr filter heatmap object markers by their own
|
||||
# threshold + visible X/Z window (legacy has the same controls), so the
|
||||
# markers match the objects-only view instead of showing raw detections.
|
||||
points_payload = self._collection_payload_by_name(collection, "gpr_points", kind=4)
|
||||
if points_payload is not None and np.asarray(points_payload.table).size > 0:
|
||||
points = (
|
||||
self._filtered_gpr_object_rows(collection)
|
||||
if self._processing_mode.currentText() == "gpr"
|
||||
else np.asarray(points_payload.table, dtype=np.float32)
|
||||
)
|
||||
points = self._filtered_gpr_object_rows(collection)
|
||||
else:
|
||||
points = np.zeros((0, 3), dtype=np.float32)
|
||||
|
||||
@@ -388,13 +389,7 @@ class AppWindowGprPlotMixin:
|
||||
@staticmethod
|
||||
def _apply_object_draw_limits(rows: np.ndarray, limits: tuple[int, int] | None) -> np.ndarray:
|
||||
"""Apply object count/top-M drawing rules to already-filtered rows."""
|
||||
if limits is None or rows.size == 0:
|
||||
return rows
|
||||
|
||||
max_detected_objects, draw_top_objects = limits
|
||||
if rows.shape[0] > int(max_detected_objects):
|
||||
return np.zeros((0, rows.shape[1]), dtype=rows.dtype)
|
||||
return rows[: max(0, int(draw_top_objects))]
|
||||
return gpr_apply_object_draw_limits(rows, limits)
|
||||
|
||||
@staticmethod
|
||||
def _gpr_display_y_min(z_min: float, z_max: float) -> float:
|
||||
@@ -517,17 +512,13 @@ class AppWindowGprPlotMixin:
|
||||
return rows
|
||||
|
||||
x_min, x_max, z_min, z_max = self._gpr_visible_object_bounds()
|
||||
min_score = self._gpr_locator_threshold()
|
||||
finite_mask = np.all(np.isfinite(rows[:, :3]), axis=1)
|
||||
visible_mask = (
|
||||
finite_mask
|
||||
& (rows[:, 2] >= min_score)
|
||||
& (rows[:, 0] >= x_min)
|
||||
& (rows[:, 0] <= x_max)
|
||||
& (rows[:, 1] >= z_min)
|
||||
& (rows[:, 1] <= z_max)
|
||||
return gpr_filter_object_rows(
|
||||
rows,
|
||||
min_score=self._gpr_locator_threshold(),
|
||||
x_bounds=(x_min, x_max),
|
||||
z_bounds=(z_min, z_max),
|
||||
draw_limits=self._gpr_draw_limits(),
|
||||
)
|
||||
return self._apply_object_draw_limits(rows[visible_mask], self._gpr_draw_limits())
|
||||
|
||||
def _draw_gpr_objects_only(self, collection: ResultCollection) -> bool:
|
||||
"""Draw only detected GPR objects inside configured X/Z bounds."""
|
||||
|
||||
Reference in New Issue
Block a user