diff --git a/README.md b/README.md index 2f5740a31b4c..bae9d9f0f30c 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,8 @@ _Expect breaking changes!_ Some shortcomings: * Big points clouds (1M+) are slow ([#1136](https://github.com/rerun-io/rerun/issues/1136)) * The data you want to visualize must fit in RAM. - - See for how to bound memory use + - See for how to bound memory use - We plan on having a disk-based data store some time in the future - - Additionally, Rerun is using more memory than it should at the moment ([#1242](https://github.com/rerun-io/rerun/pull/1242)) * The Rust library takes a long time to compile - We have way too many big dependencies, and we are planning on improving the situation ([#1316](https://github.com/rerun-io/rerun/pull/1316)) diff --git a/examples/python/arkitscenes/main.py b/examples/python/arkitscenes/main.py index 5b2c62027022..021f2ba94f88 100755 --- a/examples/python/arkitscenes/main.py +++ b/examples/python/arkitscenes/main.py @@ -63,24 +63,23 @@ def log_annotated_bboxes( uid = label_info["uid"] label = label_info["label"] - # TODO(pablovela5620): half this value once #1701 is resolved - scale = np.array(label_info["segments"]["obbAligned"]["axesLengths"]).reshape(-1, 3)[0] - transform = np.array(label_info["segments"]["obbAligned"]["centroid"]).reshape(-1, 3)[0] + half_size = 0.5 * np.array(label_info["segments"]["obbAligned"]["axesLengths"]).reshape(-1, 3)[0] + centroid = np.array(label_info["segments"]["obbAligned"]["centroid"]).reshape(-1, 3)[0] rotation = np.array(label_info["segments"]["obbAligned"]["normalizedAxes"]).reshape(3, 3) rot = R.from_matrix(rotation).inv() rr.log_obb( f"world/annotations/box-{uid}-{label}", - half_size=scale, - position=transform, + half_size=half_size, + position=centroid, rotation_q=rot.as_quat(), label=label, color=color_list[i], timeless=True, ) - box3d = compute_box_3d(scale, transform, rotation) + box3d = compute_box_3d(half_size, centroid, rotation) bbox_list.append(box3d) bbox_labels.append(label) bboxes_3d = np.array(bbox_list) @@ -88,16 +87,14 @@ def log_annotated_bboxes( def compute_box_3d( - scale: npt.NDArray[np.float64], transform: npt.NDArray[np.float64], rotation: npt.NDArray[np.float64] + half_size: npt.NDArray[np.float64], transform: npt.NDArray[np.float64], rotation: npt.NDArray[np.float64] ) -> npt.NDArray[np.float64]: """ Given obb compute 3d keypoints of the box. TODO(pablovela5620): Once #1581 is resolved this can be removed """ - scale = scale.tolist() - scales = [i / 2 for i in scale] - length, height, width = scales + length, height, width = half_size.tolist() center = np.reshape(transform, (-1, 3)) center = center.reshape(3) x_corners = [length, length, -length, -length, length, length, -length, -length] diff --git a/examples/python/clock/main.py b/examples/python/clock/main.py index a5a55fc38d04..1eff8821373c 100755 --- a/examples/python/clock/main.py +++ b/examples/python/clock/main.py @@ -34,7 +34,7 @@ def rotate(angle: float, len: float) -> Tuple[float, float, float]: rr.log_obb( "world/frame", - half_size=[2 * LENGTH_S, 2 * LENGTH_S, 1.0], + half_size=[LENGTH_S, LENGTH_S, 1.0], position=[0.0, 0.0, 0.0], rotation_q=[0.0, 0.0, 0.0, 0.0], timeless=True, diff --git a/examples/python/objectron/main.py b/examples/python/objectron/main.py index d7dc5237ddd5..f4a8efc60a45 100755 --- a/examples/python/objectron/main.py +++ b/examples/python/objectron/main.py @@ -181,9 +181,9 @@ def log_annotated_bboxes(bboxes: Iterable[Object]) -> None: rot = R.from_matrix(np.asarray(bbox.rotation).reshape((3, 3))) rr.log_obb( f"world/annotations/box-{bbox.id}", - bbox.scale, - bbox.translation, - rot.as_quat(), + half_size=0.5 * np.array(bbox.scale), + position=bbox.translation, + rotation_q=rot.as_quat(), color=[160, 230, 130, 255], label=bbox.category, timeless=True, diff --git a/examples/python/ros/main.py b/examples/python/ros/main.py index 15e268a2a4fe..0b83bc88d391 100644 --- a/examples/python/ros/main.py +++ b/examples/python/ros/main.py @@ -83,7 +83,7 @@ def __init__(self) -> None: # # TODO(jleibs): Log the real map once [#1531](https://github.com/rerun-io/rerun/issues/1531) is merged rr.log_obb( "map/box", - half_size=[6, 6, 2], + half_size=[3, 3, 1], position=[0, 0, 1], color=[255, 255, 255, 255], timeless=True, diff --git a/rerun_py/rerun_sdk/rerun/__init__.py b/rerun_py/rerun_sdk/rerun/__init__.py index 00b40749ff25..efcccb40766c 100644 --- a/rerun_py/rerun_sdk/rerun/__init__.py +++ b/rerun_py/rerun_sdk/rerun/__init__.py @@ -367,9 +367,7 @@ def disconnect() -> None: def save(path: str) -> None: """ - Save previously logged data to a file. - - This only works if you have not called `connect`. + Stream all log-data to a file. Parameters ---------- diff --git a/rerun_py/rerun_sdk/rerun/log/bounding_box.py b/rerun_py/rerun_sdk/rerun/log/bounding_box.py index 2e1ef6b50b26..cda8b6e10d03 100644 --- a/rerun_py/rerun_sdk/rerun/log/bounding_box.py +++ b/rerun_py/rerun_sdk/rerun/log/bounding_box.py @@ -24,6 +24,7 @@ @log_decorator def log_obb( entity_path: str, + *, half_size: Optional[npt.ArrayLike], position: Optional[npt.ArrayLike] = None, rotation_q: Optional[npt.ArrayLike] = None, @@ -72,12 +73,12 @@ def log_obb( splats: Dict[str, Any] = {} if half_size is not None: - size = np.require(half_size, dtype="float32") + half_size = np.require(half_size, dtype="float32") - if size.shape[0] == 3: - instanced["rerun.box3d"] = Box3DArray.from_numpy(size.reshape(1, 3)) + if half_size.shape[0] == 3: + instanced["rerun.box3d"] = Box3DArray.from_numpy(half_size.reshape(1, 3)) else: - raise TypeError("Position should be 1x3") + raise TypeError("half_size should be 1x3") if position is not None: position = np.require(position, dtype="float32") @@ -85,7 +86,7 @@ def log_obb( if position.shape[0] == 3: instanced["rerun.vec3d"] = Vec3DArray.from_numpy(position.reshape(1, 3)) else: - raise TypeError("Position should be 1x3") + raise TypeError("position should be 1x3") if rotation_q is not None: rotation = np.require(rotation_q, dtype="float32") @@ -93,7 +94,7 @@ def log_obb( if rotation.shape[0] == 4: instanced["rerun.quaternion"] = QuaternionArray.from_numpy(rotation.reshape(1, 4)) else: - raise TypeError("Rotation should be 1x4") + raise TypeError("rotation should be 1x4") if color: colors = _normalize_colors([color]) diff --git a/rerun_py/rerun_sdk/rerun/log/scalar.py b/rerun_py/rerun_sdk/rerun/log/scalar.py index 98693934b425..66a6d49ff733 100644 --- a/rerun_py/rerun_sdk/rerun/log/scalar.py +++ b/rerun_py/rerun_sdk/rerun/log/scalar.py @@ -21,6 +21,7 @@ def log_scalar( entity_path: str, scalar: float, + *, label: Optional[str] = None, color: Optional[Sequence[int]] = None, radius: Optional[float] = None,