diff --git a/src/presa_mano/api/grasp_routes.py b/src/presa_mano/api/grasp_routes.py index 16b85c4..c36ec43 100644 --- a/src/presa_mano/api/grasp_routes.py +++ b/src/presa_mano/api/grasp_routes.py @@ -232,26 +232,20 @@ def find_model(req: FindModelReq) -> dict[str, Any]: top = dets[0] bbox = _bbox_to_roi(top["bbox"]) - # 2. SAM21, with depth pre-filter so the segmentation cannot leak onto - # the table around the object: pixels whose back-projection sits below - # the plane have their depth zeroed BEFORE SAM21 sees them, so they - # never end up in the cloud regardless of the mask outline. + # 2. SAM21 — full cluster, no plane filtering at all. try: - seg = segment_with_sam21(nuwa, sam21, bbox, sw, - pre_filter_plane=get_work_plane()) + seg = segment_with_sam21(nuwa, sam21, bbox, sw) except Sam21Fallback as e: raise HTTPException(status_code=422, detail=f"SAM21 fail: {e}") - # 3. Partition by plane - with sw.step("partition_plane"): - accepted_m, excluded_m, plane_info = partition_by_plane( - seg.points_cv_m, get_work_plane() - ) + accepted_m = seg.points_cv_m + excluded_m = np.empty((0, 3), dtype=np.float64) + plane_info = {"plane_applied": False, + "n_points_before_plane": int(accepted_m.shape[0])} if accepted_m.shape[0] < 10: raise HTTPException( status_code=422, - detail=f"too few accepted points after plane filter: {accepted_m.shape[0]}" - f" (before plane: {plane_info['n_points_before_plane']})" + detail=f"too few SAM21 points: {accepted_m.shape[0]}" ) # 4. Open3DModel pose