MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / _refresh_pointcloud

Function _refresh_pointcloud

benchmark/models/r3/view.py:579–606  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

577 return data["points"][a:b], data["colors"][a:b], data["conf"][a:b], f"frames {lo}-{hi}"
578
579 def _refresh_pointcloud():
580 data = state["data"]
581 if data is None:
582 return
583 thr = float(gui_conf.value)
584 target = int(gui_n_points.value) * 1000
585 if gui_single.value:
586 idx = int(gui_frame.value)
587 idx = max(0, min(idx, len(data["cam_c2ws"]) - 1))
588 pts_all, cols_all, conf_all = _frame_slice(idx)
589 label = f"frame {idx}"
590 else:
591 pts_all, cols_all, conf_all, label = _frame_range_slice(gui_pc_start.value, gui_pc_end.value)
592 mask = conf_all > thr
593 pts = pts_all[mask]
594 cols = cols_all[mask]
595 conf = conf_all[mask]
596 pts, cols, conf = _filter_finite_cloud(pts, cols, conf)
597 pts_ds, cols_ds, _ = _stride_downsample(pts, cols, conf, target)
598 if state["pc_handle"] is not None:
599 state["pc_handle"].remove()
600 state["pc_handle"] = server.scene.add_point_cloud(
601 "/cloud",
602 points=pts_ds,
603 colors=cols_ds,
604 point_size=float(gui_point_size.value),
605 )
606 gui_status.value = f"[{state['name']}] {label}: {len(pts_ds):,} / {len(pts):,} pts (conf>{thr:.2f})"
607
608 def _refresh_cameras():
609 data = state["data"]

Callers 2

_load_selectedFunction · 0.85
_Function · 0.85

Calls 4

_frame_sliceFunction · 0.85
_frame_range_sliceFunction · 0.85
_filter_finite_cloudFunction · 0.85
_stride_downsampleFunction · 0.85

Tested by

no test coverage detected