feat(find_model gui): toggle to overlay full SAM21 cluster (yellow)
Adds a 4th checkbox 'Punti SAM21 (gialli)' that draws the full SAM21 segmentation (input to both the plane partition and Open3DModel) on the RGB result canvas. The backend now returns sam21_points_px and n_sam21 alongside the existing accepted/excluded splits. Useful as a sanity check: visualise what was actually segmented vs what the plane filter kept/rejected vs where the STL got placed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
767d91acdc
commit
2fe7a7a7fa
3 files changed
+15
-4
No files matched your search
@@ -306,6 +306,11 @@ def find_model(req: FindModelReq) -> dict[str, Any]:
|
||||
with sw.step("project_points"):
|
||||
accepted_px = project_camera_to_pixels(accepted_m, K, (W, H))
|
||||
excluded_px = project_camera_to_pixels(excluded_m, K, (W, H))
|
||||
# Full SAM21 cluster (= input to the partition + Open3DModel search).
|
||||
# Useful as a sanity-check overlay: shows everything segmented before
|
||||
# any plane filtering. Equal to accepted ∪ excluded set-wise but kept
|
||||
# as a separate field so the GUI can color it independently.
|
||||
sam21_px = project_camera_to_pixels(seg.points_cv_m, K, (W, H))
|
||||
|
||||
with sw.step("encode_rgb"):
|
||||
rgb_b64 = base64.b64encode(seg.rgb_jpeg).decode("ascii")
|
||||
@@ -323,8 +328,10 @@ def find_model(req: FindModelReq) -> dict[str, Any]:
|
||||
"model_points_px": model_px.tolist(),
|
||||
"accepted_points_px": accepted_px.tolist(),
|
||||
"excluded_points_px": excluded_px.tolist(),
|
||||
"sam21_points_px": sam21_px.tolist(),
|
||||
"n_accepted": int(accepted_m.shape[0]),
|
||||
"n_excluded": int(excluded_m.shape[0]),
|
||||
"n_sam21": int(seg.points_cv_m.shape[0]),
|
||||
"plane_applied": bool(plane_info["plane_applied"]),
|
||||
"fit_ok": fit_ok,
|
||||
"fit_failed": fit_failed,
|
||||
|
||||
Reference in new issue
Block a user