-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(rerun-sdk): example notebook * feat(rerun): add examples to rerun * feat(rerun): notebook first draft * feat(rerun): notebook first draft * feat(rerun): add more comments * feat(rerun): remove description from viewer * feat(rerun): updates * feat(rerun): updates, polish, simplify * feat(rerun): add French version * feat(rerun): fix text mistakes * fix(nav): add new ReRun pages * fix(notebooks): remove requirements files I don't want to include the pip install -r requirements.txt since that file might not be available if the user downloads the notebook from the documentation.
- Loading branch information
1 parent
55115ca
commit 3236d92
Showing
23 changed files
with
635 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,316 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1bd46748-42b9-46ea-9fea-fee20634a793", | ||
"metadata": {}, | ||
"source": [ | ||
"# ReRun: Fast and Powerful Multimodal Data Visualization\n", | ||
"\n", | ||
"Welcome to ReRun, your go-to SDK for visualizing multimodal data that dynamically evolves over time. Engineers and researchers in fields like computer vision and robotics leverage ReRun to verify, debug, and demonstrate their projects with unparalleled efficiency.\n", | ||
"\n", | ||
"![Multimodal Timeseries Data](./img/rerun-multi-1.png)\n", | ||
"\n", | ||
"## Key Highlights\n", | ||
"\n", | ||
"- **Open-Core Model:** ReRun operates on an open-core model, ensuring that everything in this repository remains open source and free. In the future, ReRun will introduce a commercial product that builds upon the robust foundation of the core free project.\n", | ||
"\n", | ||
"- **Tailored for Individuals and Teams:** The open source project caters to the needs of individual developers, while the upcoming commercial product will specifically address the requirements of teams involved in building and running computer vision and robotics products.\n", | ||
"\n", | ||
"- **Versatile and Cross-Platform:** ReRun is an SDK and engine designed for visualizing and interacting with multimodal data streams. It's simple to integrate and get started with, usable from Python, Rust, and C++, and built in Rust for cross-platform compatibility and speed.\n", | ||
"\n", | ||
"- **Open Source:** ReRun is committed to open source principles, dual-licensed under MIT and Apache 2.\n", | ||
"\n", | ||
"## Installation\n", | ||
"\n", | ||
"To unleash the power of ReRun, install it in your JupyterLab environment with a simple command:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "d9f41c51-e09f-4a37-b5e6-3ff4766001ea", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%%capture\n", | ||
"! pip install -U rerun-sdk" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "b421be69-2741-4d5c-a3fa-f60f8d9187aa", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"## Getting Started\n", | ||
"\n", | ||
"For an optimal ReRun experience, it's recommended to use a Linux, Mac, or Windows desktop session instead of JupyterLab. Access the full ReRun viewer by running `rr.spawn()` in the following script from your terminal emulator:\n", | ||
"\n", | ||
"``` python\n", | ||
"import rerun as rr\n", | ||
"\n", | ||
"rr.spawn()\n", | ||
"```\n", | ||
"\n", | ||
"However, if JupyterLab is your preferred environment, ReRun seamlessly operates within it. Refer to the [official documentation](https://www.rerun.io/docs/howto/notebook) for details on running ReRun within JupyterLab. The simplest JupyterLab example is to open ReRun using the `memory_recording()` and `show()` methods:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "e9918233", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import rerun as rr\n", | ||
"\n", | ||
"rec = rr.memory_recording()\n", | ||
"rec.show(width=1024, height=768)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "b84e8b9d", | ||
"metadata": {}, | ||
"source": [ | ||
"## 3D Visualization: The Cube\n", | ||
"\n", | ||
"Experience the simplicity of 3D visualization with ReRun by generating and plotting points in space:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a7127bbc", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import rerun as rr\n", | ||
"import numpy as np\n", | ||
"\n", | ||
"rec = rr.memory_recording()\n", | ||
"\n", | ||
"SIZE = 10\n", | ||
"\n", | ||
"pos_grid = np.meshgrid(*[np.linspace(-10, 10, SIZE)]*3)\n", | ||
"positions = np.vstack([d.reshape(-1) for d in pos_grid]).T\n", | ||
"\n", | ||
"col_grid = np.meshgrid(*[np.linspace(0, 255, SIZE)]*3)\n", | ||
"colors = np.vstack([c.reshape(-1) for c in col_grid]).astype(np.uint8).T\n", | ||
"\n", | ||
"rr.log(\n", | ||
" \"my_points\",\n", | ||
" rr.Points3D(positions, colors=colors, radii=0.5)\n", | ||
")\n", | ||
"\n", | ||
"rec.show(width=1024, height=768)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "759d2169", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"## 3D Visualization: The DNA\n", | ||
"\n", | ||
"Explore a fascinating example of synthetic 3D data visualization in the shape of a double helix:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "e9bd9a87", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from __future__ import annotations\n", | ||
"\n", | ||
"import argparse\n", | ||
"from math import tau\n", | ||
"\n", | ||
"import numpy as np\n", | ||
"\n", | ||
"import rerun as rr # pip install rerun-sdk\n", | ||
"from rerun.utilities import bounce_lerp, build_color_spiral\n", | ||
"\n", | ||
"rec = rr.memory_recording()\n", | ||
"\n", | ||
"rr.set_time_seconds(\"stable_time\", 0)\n", | ||
"\n", | ||
"NUM_POINTS = 100\n", | ||
"\n", | ||
"# points and colors are both np.array((NUM_POINTS, 3))\n", | ||
"points1, colors1 = build_color_spiral(NUM_POINTS)\n", | ||
"points2, colors2 = build_color_spiral(NUM_POINTS, angular_offset=tau * 0.5)\n", | ||
"rr.log(\"helix/structure/left\", rr.Points3D(points1, colors=colors1, radii=0.08))\n", | ||
"rr.log(\"helix/structure/right\", rr.Points3D(points2, colors=colors2, radii=0.08))\n", | ||
"\n", | ||
"rr.log(\"helix/structure/scaffolding\", rr.LineStrips3D(np.stack((points1, points2), axis=1), colors=[128, 128, 128]))\n", | ||
"\n", | ||
"time_offsets = np.random.rand(NUM_POINTS)\n", | ||
"for i in range(400):\n", | ||
" time = i * 0.01\n", | ||
" rr.set_time_seconds(\"stable_time\", time)\n", | ||
"\n", | ||
" times = np.repeat(time, NUM_POINTS) + time_offsets\n", | ||
" beads = [bounce_lerp(points1[n], points2[n], times[n]) for n in range(NUM_POINTS)]\n", | ||
" colors = [[int(bounce_lerp(80, 230, times[n] * 2))] for n in range(NUM_POINTS)]\n", | ||
" rr.log(\n", | ||
" \"helix/structure/scaffolding/beads\", rr.Points3D(beads, radii=0.06, colors=np.repeat(colors, 3, axis=-1))\n", | ||
" )\n", | ||
"\n", | ||
" rr.log(\n", | ||
" \"helix/structure\",\n", | ||
" rr.Transform3D(rotation=rr.RotationAxisAngle(axis=[0, 0, 1], radians=time / 4.0 * tau)),\n", | ||
" )\n", | ||
"\n", | ||
"rec.show(width=1024, height=768)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "cb0cbca9", | ||
"metadata": {}, | ||
"source": [ | ||
"## Time-Series Data: Plots that Impress\n", | ||
"\n", | ||
"ReRun truly shines when visualizing multimodal time-series data. The following example demonstrates ReRun's prowess in displaying various plots corresponding to different readings on the same time-series data:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "de21e1f2", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from __future__ import annotations\n", | ||
"\n", | ||
"import argparse\n", | ||
"import random\n", | ||
"from math import cos, sin, tau\n", | ||
"\n", | ||
"import numpy as np\n", | ||
"import rerun as rr # pip install rerun-sdk\n", | ||
"\n", | ||
"rec = rr.memory_recording()\n", | ||
"\n", | ||
"def clamp(n, smallest, largest): # type: ignore[no-untyped-def]\n", | ||
" return max(smallest, min(n, largest))\n", | ||
"\n", | ||
"\n", | ||
"def log_bar_chart() -> None:\n", | ||
" rr.set_time_sequence(\"frame_nr\", 0)\n", | ||
" # Log a gauss bell as a bar chart\n", | ||
" mean = 0\n", | ||
" std = 1\n", | ||
" variance = np.square(std)\n", | ||
" x = np.arange(-5, 5, 0.1)\n", | ||
" y = np.exp(-np.square(x - mean) / 2 * variance) / (np.sqrt(2 * np.pi * variance))\n", | ||
" rr.log(\"bar_chart\", rr.BarChart(y))\n", | ||
"\n", | ||
"\n", | ||
"def log_parabola() -> None:\n", | ||
" # Log a parabola as a time series\n", | ||
" for t in range(0, 1000, 10):\n", | ||
" rr.set_time_sequence(\"frame_nr\", t)\n", | ||
"\n", | ||
" f_of_t = (t * 0.01 - 5) ** 3 + 1\n", | ||
" radius = clamp(abs(f_of_t) * 0.1, 0.5, 10.0)\n", | ||
" color = [255, 255, 0]\n", | ||
" if f_of_t < -10.0:\n", | ||
" color = [255, 0, 0]\n", | ||
" elif f_of_t > 10.0:\n", | ||
" color = [0, 255, 0]\n", | ||
"\n", | ||
" rr.log(\n", | ||
" \"curves/parabola\",\n", | ||
" rr.TimeSeriesScalar(\n", | ||
" f_of_t,\n", | ||
" label=\"f(t) = (0.01t - 3)³ + 1\",\n", | ||
" radius=radius,\n", | ||
" color=color,\n", | ||
" ),\n", | ||
" )\n", | ||
"\n", | ||
"\n", | ||
"def log_trig() -> None:\n", | ||
" # Log a time series\n", | ||
" for t in range(0, int(tau * 2 * 100.0)):\n", | ||
" rr.set_time_sequence(\"frame_nr\", t)\n", | ||
"\n", | ||
" sin_of_t = sin(float(t) / 100.0)\n", | ||
" rr.log(\"trig/sin\", rr.TimeSeriesScalar(sin_of_t, label=\"sin(0.01t)\", color=[255, 0, 0]))\n", | ||
"\n", | ||
" cos_of_t = cos(float(t) / 100.0)\n", | ||
" rr.log(\"trig/cos\", rr.TimeSeriesScalar(cos_of_t, label=\"cos(0.01t)\", color=[0, 255, 0]))\n", | ||
"\n", | ||
"\n", | ||
"def log_classification() -> None:\n", | ||
" # Log a time series\n", | ||
" for t in range(0, 1000, 2):\n", | ||
" rr.set_time_sequence(\"frame_nr\", t)\n", | ||
"\n", | ||
" f_of_t = (2 * 0.01 * t) + 2\n", | ||
" color = [255, 255, 0]\n", | ||
" rr.log(\"classification/line\", rr.TimeSeriesScalar(f_of_t, color=color, radius=3.0))\n", | ||
"\n", | ||
" g_of_t = f_of_t + random.uniform(-5.0, 5.0)\n", | ||
" if g_of_t < f_of_t - 1.5:\n", | ||
" color = [255, 0, 0]\n", | ||
" elif g_of_t > f_of_t + 1.5:\n", | ||
" color = [0, 255, 0]\n", | ||
" else:\n", | ||
" color = [255, 255, 255]\n", | ||
" radius = abs(g_of_t - f_of_t)\n", | ||
" rr.log(\"classification/samples\", rr.TimeSeriesScalar(g_of_t, color=color, scattered=True, radius=radius))\n", | ||
"\n", | ||
"\n", | ||
"log_bar_chart()\n", | ||
"log_parabola()\n", | ||
"log_trig()\n", | ||
"log_classification()\n", | ||
"\n", | ||
"rec.show(width=1024, height=768)\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "d9bd7e11", | ||
"metadata": {}, | ||
"source": [ | ||
"## Dive Deeper\n", | ||
"\n", | ||
"For an in-depth understanding of ReRun and its capabilities, refer to the [official ReRun Python Quickstart](https://www.rerun.io/docs/quickstart/python/).\n", | ||
"\n", | ||
"Now, armed with ReRun, embark on a journey of unparalleled data visualization and exploration. Happy coding!" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.