From fe6400e72fd8642349b95cb6e7341ab64eca73f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <1665677+jprochazk@users.noreply.github.com> Date: Tue, 19 Dec 2023 10:19:39 +0100 Subject: [PATCH] Use TOML in examples (#4553) ### What Closes https://github.com/rerun-io/rerun/issues/3355 Closes https://github.com/rerun-io/rerun/issues/2431 - [x] Convert all example `README.md` frontmatter to use TOML instead of YAML - [x] Convert `manifest.yml` to a `.toml` file - [x] Support reading TOML frontmatter everywhere (linting, `thumbnails.py`, `re_build_examples`) - [x] Simplify both `README.md` frontmatter and the manifest file by inferring more information from the filesystem - [x] Use HTML comments instead of `---` for delimiters - [x] Update `landing` to support TOML and new manifest/README formats - https://github.com/rerun-io/landing/pull/594 After merging this PR, merge [the PR in landing](https://github.com/rerun-io/landing/pull/594) by following the instructions in the PR body there. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/4553/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/4553/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/4553/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4553) - [Docs preview](https://rerun.io/preview/7588e64e5e2f3676ebeb40fe75a3e8185da0b9e9/docs) - [Examples preview](https://rerun.io/preview/7588e64e5e2f3676ebeb40fe75a3e8185da0b9e9/examples) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --------- Co-authored-by: Emil Ernerfeldt --- .github/workflows/contrib_checks.yml | 2 +- .github/workflows/documentation.yaml | 3 +- .github/workflows/reusable_checks.yml | 2 +- Cargo.lock | 56 ++-- Cargo.toml | 2 +- crates/re_build_examples/Cargo.toml | 2 +- crates/re_build_examples/src/example.rs | 26 +- examples/README.md | 4 +- examples/c/spawn_viewer/README.md | 12 +- examples/cpp/clock/README.md | 12 +- examples/cpp/dna/README.md | 20 +- examples/cpp/eigen_opencv/README.md | 15 +- examples/cpp/minimal/README.md | 12 +- examples/cpp/shared_recording/README.md | 9 +- examples/cpp/spawn_viewer/README.md | 12 +- examples/cpp/stdio/README.md | 12 +- examples/cpp/vrs/README.md | 15 +- examples/manifest.toml | 99 +++++++ examples/manifest.yml | 175 ------------- examples/python/arkit_scenes/README.md | 18 +- examples/python/car/README.md | 12 +- examples/python/clock/README.md | 14 +- examples/python/controlnet/README.md | 14 +- .../depth_guided_stable_diffusion/README.md | 17 +- .../python/detect_and_track_objects/README.md | 18 +- examples/python/dicom_mri/README.md | 18 +- .../differentiable_blocks_world/README.md | 15 +- examples/python/dna/README.md | 20 +- examples/python/face_tracking/README.md | 14 +- examples/python/human_pose_tracking/README.md | 18 +- examples/python/lidar/README.md | 16 +- examples/python/limap/README.md | 15 +- .../live_camera_edge_detection/README.md | 14 +- examples/python/live_depth_sensor/README.md | 14 +- examples/python/mcc/README.md | 15 +- examples/python/minimal/README.md | 15 +- examples/python/multiprocessing/README.md | 12 +- examples/python/multithreading/README.md | 12 +- examples/python/nuscenes/README.md | 19 +- examples/python/nv12/README.md | 11 +- examples/python/objectron/README.md | 18 +- .../open_photogrammetry_format/README.md | 17 +- examples/python/plots/README.md | 18 +- examples/python/raw_mesh/README.md | 17 +- examples/python/rgbd/README.md | 17 +- examples/python/ros_node/README.md | 16 +- .../python/segment_anything_model/README.md | 16 +- examples/python/shape_pointe/README.md | 15 +- examples/python/shared_recording/README.md | 10 +- .../python/signed_distance_fields/README.md | 14 +- examples/python/simplerecon/README.md | 15 +- examples/python/slahmr/README.md | 15 +- examples/python/stdio/README.md | 14 +- .../python/structure_from_motion/README.md | 20 +- examples/python/tapir/README.md | 14 +- examples/python/template/README.md | 13 +- examples/python/widebaseline/README.md | 15 +- examples/rust/clock/README.md | 12 +- examples/rust/custom_space_view/README.md | 10 +- .../rust/custom_store_subscriber/README.md | 10 +- examples/rust/dna/README.md | 20 +- examples/rust/extend_viewer_ui/README.md | 10 +- examples/rust/minimal/README.md | 13 +- examples/rust/minimal_serve/README.md | 10 +- examples/rust/objectron/README.md | 14 +- examples/rust/raw_mesh/README.md | 11 +- examples/rust/shared_recording/README.md | 8 +- examples/rust/spawn_viewer/README.md | 12 +- examples/rust/stdio/README.md | 12 +- examples/rust/template/README.md | 12 +- examples/schema.json | 3 + pixi.lock | 247 ------------------ pixi.toml | 3 +- scripts/ci/frontmatter.py | 23 ++ scripts/ci/requirements.txt | 1 - scripts/ci/thumbnails.py | 12 +- scripts/lint.py | 13 +- scripts/requirements-dev.txt | 1 - 78 files changed, 608 insertions(+), 924 deletions(-) create mode 100644 examples/manifest.toml delete mode 100644 examples/manifest.yml create mode 100644 examples/schema.json create mode 100644 scripts/ci/frontmatter.py diff --git a/.github/workflows/contrib_checks.yml b/.github/workflows/contrib_checks.yml index 628cf354508e..88f741d7377e 100644 --- a/.github/workflows/contrib_checks.yml +++ b/.github/workflows/contrib_checks.yml @@ -230,7 +230,7 @@ jobs: - name: Install dependencies shell: bash run: | - pip install gitignore_parser python-frontmatter + pip install gitignore_parser pip install -r ./scripts/ci/requirements.txt - name: Rerun lints diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 33d56163ee72..4c28655b2737 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -35,7 +35,8 @@ jobs: # Avoid crates.io rate-limiting, skip changelog PR links (so many), and skip speculative links # TODO(#4085): https://rerun-io.github.io/rerun/dev/bench/ often 404:s for unknown reasons - linksToSkip: "https://crates.io/crates/.*, https://github.com/rerun-io/rerun/pull/.*, .*?speculative-link, https://rerun-io.github.io/rerun/dev/bench/" + # TODO(#4556): remove the `static.rerun.io` and `github.com` skips + linksToSkip: "https://static.rerun.io/.*, https://github.com/.*, https://crates.io/crates/.*, https://github.com/rerun-io/rerun/pull/.*, .*?speculative-link, https://rerun-io.github.io/rerun/dev/bench/" retry: true retryErrors: true retryErrorsCount: 5 diff --git a/.github/workflows/reusable_checks.yml b/.github/workflows/reusable_checks.yml index 446eff6bd1fc..1129bcfd37fe 100644 --- a/.github/workflows/reusable_checks.yml +++ b/.github/workflows/reusable_checks.yml @@ -306,7 +306,7 @@ jobs: - name: Install dependencies shell: bash run: | - pip install gitignore_parser python-frontmatter + pip install gitignore_parser pip install -r ./scripts/ci/requirements.txt - name: Rerun lints diff --git a/Cargo.lock b/Cargo.lock index e6c9fbf5d9e5..4036b62aa15a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4502,7 +4502,7 @@ dependencies = [ "re_format", "serde", "serde_json", - "serde_yaml", + "toml", ] [[package]] @@ -5994,25 +5994,21 @@ dependencies = [ ] [[package]] -name = "serde_test" -version = "1.0.163" +name = "serde_spanned" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100168a8017b89fd4bcbeb8d857d95a8cfcbde829a7147c09cc82d3ab8d8cb41" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] [[package]] -name = "serde_yaml" -version = "0.9.21" +name = "serde_test" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" +checksum = "100168a8017b89fd4bcbeb8d857d95a8cfcbde829a7147c09cc82d3ab8d8cb41" dependencies = [ - "indexmap 1.9.3", - "itoa", - "ryu", "serde", - "unsafe-libyaml", ] [[package]] @@ -6599,19 +6595,37 @@ dependencies = [ "tracing", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 1.9.3", + "indexmap 2.1.0", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -6778,12 +6792,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" -[[package]] -name = "unsafe-libyaml" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" - [[package]] name = "untrusted" version = "0.7.1" @@ -7701,9 +7709,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.4.6" +version = "0.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 3334bc46f2b9..b90a9f272223 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -192,7 +192,6 @@ serde = "1" serde_bytes = "0.11" serde_json = { version = "1", default-features = false, features = ["std"] } serde_test = "1" -serde_yaml = { version = "0.9.21", default-features = false } sha2 = "0.10" similar-asserts = "1.4.2" slotmap = { version = "1.0.6", features = ["serde"] } @@ -213,6 +212,7 @@ tinyvec = { version = "1.6", features = ["alloc", "rustc_1_55"] } tobj = "4.0" tokio = { version = "1.24", default-features = false } tokio-tungstenite = { version = "0.17.1", default-features = false } +toml = { version = "0.7.8", default-features = false } tracing = { version = "0.1", default-features = false } tungstenite = { version = "0.17", default-features = false } type-map = "0.5" diff --git a/crates/re_build_examples/Cargo.toml b/crates/re_build_examples/Cargo.toml index 71c1a63cf7ff..a2d0f8b12f04 100644 --- a/crates/re_build_examples/Cargo.toml +++ b/crates/re_build_examples/Cargo.toml @@ -26,5 +26,5 @@ argh.workspace = true indicatif.workspace = true rayon.workspace = true serde = { workspace = true, features = ["derive"] } -serde_yaml.workspace = true serde_json.workspace = true +toml = { workspace = true, features = ["parse", "preserve_order"] } diff --git a/crates/re_build_examples/src/example.rs b/crates/re_build_examples/src/example.rs index 8f03fb2c6539..2ff32ac3929e 100644 --- a/crates/re_build_examples/src/example.rs +++ b/crates/re_build_examples/src/example.rs @@ -154,22 +154,28 @@ struct Frontmatter { } fn parse_frontmatter>(path: P) -> anyhow::Result> { + const START: &str = ""; + let path = path.as_ref(); let content = std::fs::read_to_string(path)?; - let content = content.replace('\r', ""); // Windows, god damn you - re_build_tools::rerun_if_changed(path); - let Some(content) = content.strip_prefix("---\n") else { + + let Some(start) = content.find(START) else { return Ok(None); }; - let Some(end) = content.find("---") else { - anyhow::bail!("{:?} has invalid frontmatter: missing --- terminator", path); + let start = start + START.len(); + + let Some(end) = content[start..].find(END) else { + anyhow::bail!("{:?} has invalid frontmatter: missing --> terminator", path); }; - Ok(Some(serde_yaml::from_str(&content[..end]).map_err( - |err| { + let end = start + end; + + toml::from_str(content[start..end].trim()) + .map(Some) + .map_err(|err| { anyhow::anyhow!( - "failed to read {:?}: {err}", + "Failed to parse TOML metadata of {:?}: {err}", path.parent().unwrap().file_name().unwrap() ) - }, - )?)) + }) } diff --git a/examples/README.md b/examples/README.md index 46d8dc60e6fa..2be0e8cdc9eb 100644 --- a/examples/README.md +++ b/examples/README.md @@ -41,12 +41,12 @@ tags: [2D, huggingface, object-detection, object-tracking, opencv] The contents of this `README.md` file and its frontmatter are used to render the examples in [the documentation](https://rerun.io/examples). Individual examples are currently "stitched together" to form one large markdown file for every category of examples (`artificial-data`, `real-data`). -The `manifest.yml` file describes the structure of the examples contained in this repository. Only the examples which appear in the manifest are included in the [generated documentation](https://rerun.io/examples). The file contains a description of its own format. +The `manifest.toml` file describes the structure of the examples contained in this repository. Only the examples which appear in the manifest are included in the [generated documentation](https://rerun.io/examples). The file contains a description of its own format. ## Adding a new example You can base your example off of `python/template` or `rust/template`. -Once it's ready to be displayed in the docs, add it to the [manifest](./manifest.yml). +Once it's ready to be displayed in the docs, add it to the [manifest](./manifest.toml). If you want to run the example on CI and include it in the in-viewer example page, add a `channel` entry to its README frontmatter. The available channels right now are: diff --git a/examples/c/spawn_viewer/README.md b/examples/c/spawn_viewer/README.md index 82471eb5fa51..e6f4f4e7bd38 100644 --- a/examples/c/spawn_viewer/README.md +++ b/examples/c/spawn_viewer/README.md @@ -1,10 +1,8 @@ ---- -title: Spawn Viewer -tags: [spawn] -c: https://github.com/rerun-io/rerun/tree/latest/examples/c/spawn_viewer/main.c -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/spawn_viewer/main.cpp -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/spawn_viewer/src/main.rs ---- + + Shows how to spawn a new Rerun Viewer process ready to listen for TCP connections using an executable available in PATH. diff --git a/examples/cpp/clock/README.md b/examples/cpp/clock/README.md index e23540bce360..7f0343f21390 100644 --- a/examples/cpp/clock/README.md +++ b/examples/cpp/clock/README.md @@ -1,10 +1,8 @@ ---- -title: Clock -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/clock/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/clock/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/clock/main.cpp -thumbnail: https://static.rerun.io/clock/ae4b8970edba8480431cb71e57b8cddd9e1769c7/480w.png ---- + + diff --git a/examples/cpp/dna/README.md b/examples/cpp/dna/README.md index ba50cdc03d01..99fcffb5672b 100644 --- a/examples/cpp/dna/README.md +++ b/examples/cpp/dna/README.md @@ -1,14 +1,12 @@ ---- -title: Helix -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/dna/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/dna/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/dna/main.cpp -tags: [3d, api-example] -description: "Simple example of logging point and line primitives to draw a 3D helix." -thumbnail: https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/480w.png -thumbnail_dimensions: [480, 285] -channel: main ---- + + diff --git a/examples/cpp/eigen_opencv/README.md b/examples/cpp/eigen_opencv/README.md index 06f039f088ae..550c7a900b4e 100644 --- a/examples/cpp/eigen_opencv/README.md +++ b/examples/cpp/eigen_opencv/README.md @@ -1,10 +1,11 @@ ---- -title: "Eigen and OpenCV C++ Integration" -cpp: https://github.com/rerun-io/cpp-example-opencv-eigen -tags: [2D, 3D, C++, Eigen, OpenCV] -thumbnail: https://static.rerun.io/cpp-example-opencv-eigen/2fc6355fd87fbb4d07cda384ee8805edb68b5e01/480w.png -thumbnail_dimensions: [480, 267] ---- + + This is a minimal CMake project that shows how to use Rerun in your code in conjunction with [Eigen](https://eigen.tuxfamily.org/) and [OpenCV](https://opencv.org/). diff --git a/examples/cpp/minimal/README.md b/examples/cpp/minimal/README.md index e5455628a2fb..0ecce0696a94 100644 --- a/examples/cpp/minimal/README.md +++ b/examples/cpp/minimal/README.md @@ -1,10 +1,8 @@ ---- -title: Minimal example -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/minimal/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/minimal/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/minimal/main.cpp -thumbnail: https://static.rerun.io/minimal/0e47ac513ab25d56cf2b493128097d499a07e5e8/480w.png ---- + + diff --git a/examples/cpp/shared_recording/README.md b/examples/cpp/shared_recording/README.md index 769f57755745..167352c49895 100644 --- a/examples/cpp/shared_recording/README.md +++ b/examples/cpp/shared_recording/README.md @@ -1,8 +1,7 @@ ---- -title: Shared Recording -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/shared_recording/src/main.rs?speculative-link -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/shared_recording/main.cpp?speculative-link ---- + + diff --git a/examples/cpp/spawn_viewer/README.md b/examples/cpp/spawn_viewer/README.md index 43ce01d5f743..c912e6b8cfc5 100644 --- a/examples/cpp/spawn_viewer/README.md +++ b/examples/cpp/spawn_viewer/README.md @@ -1,10 +1,8 @@ ---- -title: Spawn Viewer -tags: [spawn] -c: https://github.com/rerun-io/rerun/tree/latest/examples/c/spawn_viewer/main.c -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/spawn_viewer/main.cpp -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/spawn_viewer/src/main.rs ---- + + Shows how to spawn a new Rerun Viewer process ready to listen for TCP connections using an executable available in PATH. diff --git a/examples/cpp/stdio/README.md b/examples/cpp/stdio/README.md index 823c505c7740..2307966e370e 100644 --- a/examples/cpp/stdio/README.md +++ b/examples/cpp/stdio/README.md @@ -1,10 +1,8 @@ ---- -title: Standard Input/Output example -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/stdio/main.py?speculative-link -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/stdio/src/main.rs?speculative-link -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/stdio/main.cpp?speculative-link -thumbnail: https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/480w.png ---- + + diff --git a/examples/cpp/vrs/README.md b/examples/cpp/vrs/README.md index 6c2131b3b101..01e5fb03e47d 100644 --- a/examples/cpp/vrs/README.md +++ b/examples/cpp/vrs/README.md @@ -1,10 +1,11 @@ ---- -title: "VRS Viewer" -cpp: https://github.com/rerun-io/cpp-example-vrs -tags: [2D, 3D, vrs, viewer, C++] -thumbnail: https://static.rerun.io/cpp-example-vrs/c765460d4448da27bb9ee2a2a15f092f82a402d2/480w.png -thumbnail_dimensions: [480, 286] ---- + + This is an example that shows how to use [Rerun](https://github.com/rerun-io/rerun)'s C++ API to log and view [VRS](https://github.com/facebookresearch/vrs) files. diff --git a/examples/manifest.toml b/examples/manifest.toml new file mode 100644 index 000000000000..addf50e435eb --- /dev/null +++ b/examples/manifest.toml @@ -0,0 +1,99 @@ +#:schema ./schema.json + +[categories.real-data] +order = 1 +title = "Examples with Real Data" +prelude = """ +The following examples illustrate using the Rerun logging SDK with potential real-world (if toy) use cases. +They all require additional data to be downloaded, so an internet connection is needed at least once. +Each example downloads it's own data, so no additional steps are needed. +For the simplest possible examples showing how to use each api, +check out [Types](/docs/reference/types). +""" +examples = [ + "arkit_scenes", + "controlnet", + "depth-guided-stable-diffusion", + "detect-and-track-objects", + "dicom-mri", + "face-tracking", + "human-pose-tracking", + "lidar", + "live-camera-edge-detection", + "live-depth-sensor", + "llm_embedding_ner", + "nuscenes", + "objectron", + "open-photogrammetry-format", + "raw-mesh", + "rgbd", + "ros-node", + "segment-anything-model", + "signed-distance-fields", + "structure-from-motion", + "vrs", +] + +[categories.artificial-data] +order = 2 +title = "Examples with Artificial Data" +prelude = """ +The following examples serve to illustrate various uses of the Rerun logging SDK. +They should not require any additional data downloads, and should run offline. +For the simplest possible examples showing how to use each api, +check out [Types](/docs/reference/types). +""" +examples = [ + "minimal", + "car", + "clock", + "eigen-opencv", + "multithreading", + "multiprocessing", + "plots", +] + +[categories.paper-visualizations] +order = 3 +title = "Paper Visualizations" +prelude = """ +The following examples use Rerun to create visual walkthroughs of papers. They are typically forks +from the official open-source implementations adding Rerun as the visualizer. +Check out the respective READMEs for installation instructions. +For the simplest possible examples showing how to use each api, +check out [Types](/docs/reference/types). +""" +examples = [ + "differentiable_blocks_world", + "limap", + "mcc", + "shape_pointe", + "simplerecon", + "slahmr", + "tapir", + "widebaseline", +] + +[categories.setup] +order = 4 +title = "Setup" +prelude = """ +### Examples with Real / Artificial Data +To run these examples, make sure you have the Rerun repository checked out +and the latest SDK installed. + +```bash +pip install --upgrade rerun-sdk # install the latest Rerun SDK +git clone git@github.com:rerun-io/rerun.git # Clone the repository +cd rerun +git checkout latest # Check out the commit matching the latest SDK release +``` +> Note: Make sure your SDK version matches the examples. +For example, if your SDK version is `0.3.1`, check out the matching tag +in the Rerun repository by running `git checkout v0.3.1`. + +### Paper Visualizations +To reproduce the paper visualizations check out the README of the respective +Rerun forks. +""" +examples = [] diff --git a/examples/manifest.yml b/examples/manifest.yml deleted file mode 100644 index 1fcaf6a86ae3..000000000000 --- a/examples/manifest.yml +++ /dev/null @@ -1,175 +0,0 @@ -# `landing` expects this file to have the following format: -# root { -# prelude: string -# children: [ -# { -# # the path in the url, e.g. to get `rerun.io/examples/minimal` set `name: "minimal"` -# name: string -# # path to the python example -# python: string? -# # path to the rust example -# rust: string? -# # path to the cpp example -# cpp: string? -# # at least one of `python`, `rust`, or `cpp` should be set -# } -# OR -# { -# # the path in the url, e.g. `rerun.io/examples/artificial-data` -# name: string -# # the title in the side nav + header, e.g. `Examples with Artificial Data` -# title: string -# # the content that's placed right after the header. -# # used to include setup instructions and general info -# prelude: string -# children: [ -# { # same as above -# name: string -# python: string? -# rust: string? -# cpp: string? -# } -# ] -# } -# ] -# } - -root: - prelude: | - In the Rerun [GitHub](https://github.com/rerun-io/rerun) repository we maintain - a list of examples that demonstrate using the Rerun logging APIs. Generally the - examples are individually self-contained, and can be run directly from a Git - clone of the repository. Many of the Python examples need additional dependencies - set up in a `requirements.txt` next to the example. These are noted in the - individual example sections below. - children: - - name: real-data - title: Examples with Real Data - prelude: | - The following examples illustrate using the Rerun logging SDK with potential real-world (if toy) use cases. - They all require additional data to be downloaded, so an internet connection is needed at least once. - Each example downloads it's own data, so no additional steps are needed. - For the simplest possible examples showing how to use each api, - check out [Types](/docs/reference/types). - children: - # Keep this list lexicographically sorted: - - name: arkit_scenes - python: python/arkit_scenes - - name: controlnet - python: python/controlnet - - name: depth-guided-stable-diffusion - python: python/depth_guided_stable_diffusion - - name: detect-and-track-objects - python: python/detect_and_track_objects - - name: dicom-mri - python: python/dicom_mri - - name: face-tracking - python: python/face_tracking - - name: human-pose-tracking - python: python/human_pose_tracking - - name: lidar - python: python/lidar - - name: live-camera-edge-detection - python: python/live_camera_edge_detection - - name: live-depth-sensor - python: python/live_depth_sensor - - name: llm_embedding_ner - python: python/llm_embedding_ner - - name: nuscenes - python: python/nuscenes - - name: objectron - python: python/objectron - rust: rust/objectron - - name: open-photogrammetry-format - python: python/open_photogrammetry_format - - name: raw-mesh - python: python/raw_mesh - rust: rust/raw_mesh - - name: rgbd - python: python/rgbd - - name: ros-node - python: python/ros_node - - name: segment-anything-model - python: python/segment_anything_model - - name: signed-distance-fields - python: python/signed_distance_fields - - name: structure-from-motion - python: python/structure_from_motion - - name: vrs - cpp: cpp/vrs - - - name: artificial-data - title: Examples with Artificial Data - prelude: | - The following examples serve to illustrate various uses of the Rerun logging SDK. - They should not require any additional data downloads, and should run offline. - For the simplest possible examples showing how to use each api, - check out [Types](/docs/reference/types). - children: - # Always show the simple "minimal" example first: - - name: minimal - python: python/minimal - rust: rust/minimal - - # Keep the following examples lexicographically sorted: - - name: car - python: python/car - - name: clock - python: python/clock - rust: rust/clock - - name: eigen-opencv - cpp: cpp/eigen_opencv - - name: multithreading - python: python/multithreading - - name: multiprocessing - python: python/multiprocessing - - name: plots - python: python/plots - - - name: paper-visualizations - title: Paper Visualizations - prelude: | - The following examples use Rerun to create visual walkthroughs of papers. They are typically forks - from the official open-source implementations adding Rerun as the visualizer. - Check out the respective READMEs for installation instructions. - For the simplest possible examples showing how to use each api, - check out [Types](/docs/reference/types). - children: - # Keep this list lexicographically sorted: - - name: differentiable_blocks_world - python: python/differentiable_blocks_world - - name: limap - python: python/limap - - name: mcc - python: python/mcc - - name: shape_pointe - python: python/shape_pointe - - name: simplerecon - python: python/simplerecon - - name: slahmr - python: python/slahmr - - name: tapir - python: python/tapir - - name: widebaseline - python: python/widebaseline - - - name: setup - title: Setup - prelude: | - ### Examples with Real / Artificial Data - To run these examples, make sure you have the Rerun repository checked out - and the latest SDK installed. - - ```bash - pip install --upgrade rerun-sdk # install the latest Rerun SDK - git clone git@github.com:rerun-io/rerun.git # Clone the repository - cd rerun - git checkout latest # Check out the commit matching the latest SDK release - ``` - > Note: Make sure your SDK version matches the examples. - For example, if your SDK version is `0.3.1`, check out the matching tag - in the Rerun repository by running `git checkout v0.3.1`. - - ### Paper Visualizations - To reproduce the paper visualizations check out the README of the respective - Rerun forks. diff --git a/examples/python/arkit_scenes/README.md b/examples/python/arkit_scenes/README.md index f45eb2b7e758..22d158b98227 100644 --- a/examples/python/arkit_scenes/README.md +++ b/examples/python/arkit_scenes/README.md @@ -1,12 +1,12 @@ ---- -title: ARKit Scenes -python: https://github.com/rerun-io/rerun/blob/latest/examples/python/arkit_scenes/main.py -tags: [2D, 3D, depth, mesh, object-detection, pinhole-camera] -description: "Visualize the ARKitScenes dataset, which contains color+depth images, the reconstructed mesh and labeled bounding boxes." -thumbnail: https://static.rerun.io/arkit_scenes/fb9ec9e8d965369d39d51b17fc7fc5bae6be10cc/480w.png -thumbnail_dimensions: [480, 243] -channel: main ---- + + diff --git a/examples/python/car/README.md b/examples/python/car/README.md index 4914a2c04be5..f1c75cded900 100644 --- a/examples/python/car/README.md +++ b/examples/python/car/README.md @@ -1,9 +1,9 @@ ---- -title: Car -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/car/main.py -thumbnail: https://static.rerun.io/car/014857675dfed92c3f6a9492e3291c48a982ac83/480w.png -thumbnail_dimensions: [480, 235] ---- + + diff --git a/examples/python/clock/README.md b/examples/python/clock/README.md index 6f2d15d0be7c..db90bf1543cb 100644 --- a/examples/python/clock/README.md +++ b/examples/python/clock/README.md @@ -1,11 +1,9 @@ ---- -title: Clock -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/clock/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/clock/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/clock/main.cpp -thumbnail: https://static.rerun.io/clock/ae4b8970edba8480431cb71e57b8cddd9e1769c7/480w.png -thumbnail_dimensions: [480, 341] ---- + + diff --git a/examples/python/controlnet/README.md b/examples/python/controlnet/README.md index 666de0ac6d48..d5eaad46dc50 100644 --- a/examples/python/controlnet/README.md +++ b/examples/python/controlnet/README.md @@ -1,10 +1,10 @@ ---- -title: ControlNet -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/controlnet/main.py -tags: [controlnet, canny, huggingface, stable-diffusion, tensor, text] -thumbnail: https://static.rerun.io/controlnet/8aace9c59a423c2eeabe4b7f9abb5187559c52e8/480w.png -thumbnail_dimensions: [480, 303] ---- + + This example integrates Rerun into [Hugging Face's ControlNet example](https://huggingface.co/docs/diffusers/using-diffusers/controlnet#controlnet). ControlNet allows to condition Stable Diffusion on various modalities. In this example we condition on edges detected by the Canny edge detector. diff --git a/examples/python/depth_guided_stable_diffusion/README.md b/examples/python/depth_guided_stable_diffusion/README.md index 94de9d5f6d83..a8de8c85ae13 100644 --- a/examples/python/depth_guided_stable_diffusion/README.md +++ b/examples/python/depth_guided_stable_diffusion/README.md @@ -1,11 +1,11 @@ ---- -title: Depth Guided Stable Diffusion -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/depth_guided_stable_diffusion/main.py -tags: [2D, depth, huggingface, stable-diffusion, tensor, text] -thumbnail: https://static.rerun.io/depth_guided_stable_diffusion/a85516aba09f72649517891d767e15383ce7f4ea/480w.png -thumbnail_dimensions: [480, 253] -channel: nightly ---- + + @@ -23,3 +23,4 @@ For more info see [here](https://github.com/Stability-AI/stablediffusion). pip install -r examples/python/depth_guided_stable_diffusion/requirements.txt python examples/python/depth_guided_stable_diffusion/main.py ``` + diff --git a/examples/python/detect_and_track_objects/README.md b/examples/python/detect_and_track_objects/README.md index 61ce69ee6f1b..0e045d4f595c 100644 --- a/examples/python/detect_and_track_objects/README.md +++ b/examples/python/detect_and_track_objects/README.md @@ -1,12 +1,12 @@ ---- -title: Detect and Track Objects -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/detect_and_track_objects/main.py -tags: [2D, huggingface, object-detection, object-tracking, opencv] -description: "Visualize object detection and segmentation using the Huggingface `transformers` library." -thumbnail: https://static.rerun.io/detect_and_track_objects/59f5b97a8724f9037353409ab3d0b7cb47d1544b/480w.png -thumbnail_dimensions: [480, 279] -channel: nightly ---- + + diff --git a/examples/python/dicom_mri/README.md b/examples/python/dicom_mri/README.md index abdcb0bb9b96..f91da8201fa1 100644 --- a/examples/python/dicom_mri/README.md +++ b/examples/python/dicom_mri/README.md @@ -1,12 +1,12 @@ ---- -title: Dicom MRI -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/dicom_mri/main.py -tags: [tensor, mri, dicom] -description: "Example using a DICOM MRI scan. This demonstrates the flexible tensor slicing capabilities of the Rerun viewer." -thumbnail: https://static.rerun.io/dicom_mri/e39f34a1b1ddd101545007f43a61783e1d2e5f8e/480w.png -thumbnail_dimensions: [480, 285] -channel: main ---- + + diff --git a/examples/python/differentiable_blocks_world/README.md b/examples/python/differentiable_blocks_world/README.md index 93378b3521c6..7704ab6b8cb7 100644 --- a/examples/python/differentiable_blocks_world/README.md +++ b/examples/python/differentiable_blocks_world/README.md @@ -1,10 +1,11 @@ ---- -title: "Differentiable Blocks World: Qualitative 3D Decomposition by Rendering Primitives" -python: https://github.com/rerun-io/differentiable-blocksworld -tags: [3D, mesh, pinhole-camera] -thumbnail: https://static.rerun.io/dbw/1da9e778d5fc9875a28a1fd74b61654c287e950d/480w.png -thumbnail_dimensions: [480, 311] ---- + + Finding a textured mesh decomposition from a collection of posed images is a very challenging optimization problem. "Differentiable Block Worlds" by Tom Monnier et al. shows impressive results using differentiable rendering. Here we visualize how this optimization works using the Rerun SDK. diff --git a/examples/python/dna/README.md b/examples/python/dna/README.md index 5bea9a1a365e..4cfc2c422b0c 100644 --- a/examples/python/dna/README.md +++ b/examples/python/dna/README.md @@ -1,14 +1,12 @@ ---- -title: Helix -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/dna/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/dna/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/dna/main.cpp -tags: [3d, api-example] -description: "Simple example of logging point and line primitives to draw a 3D helix." -thumbnail: https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/480w.png -thumbnail_dimensions: [480, 285] -channel: main ---- + + diff --git a/examples/python/face_tracking/README.md b/examples/python/face_tracking/README.md index 24a1b315b5bd..3b954a016c2f 100644 --- a/examples/python/face_tracking/README.md +++ b/examples/python/face_tracking/README.md @@ -1,10 +1,10 @@ ---- -title: Face Tracking -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/face_tracking/main.py -tags: [2d, 3d, camera, face-tracking, live, mediapipe, time-series] -thumbnail: https://static.rerun.io/mp_face/f5ee03278408bf8277789b637857d5a4fda7eba3/480w.png -thumbnail_dimensions: [480, 335] ---- + + diff --git a/examples/python/human_pose_tracking/README.md b/examples/python/human_pose_tracking/README.md index 10d1eb168ac9..5b596f817474 100644 --- a/examples/python/human_pose_tracking/README.md +++ b/examples/python/human_pose_tracking/README.md @@ -1,12 +1,12 @@ ---- -title: Human Pose Tracking -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/human_pose_tracking/main.py -tags: [mediapipe, keypoint-detection, 2D, 3D] -description: "Use the MediaPipe Pose solution to detect and track a human pose in video." -thumbnail: https://static.rerun.io/human_pose_tracking/37d47fe7e3476513f9f58c38da515e2cd4a093f9/480w.png -thumbnail_dimensions: [480, 272] -channel: main ---- + + diff --git a/examples/python/lidar/README.md b/examples/python/lidar/README.md index 35c363c7988e..89775cb0ee14 100644 --- a/examples/python/lidar/README.md +++ b/examples/python/lidar/README.md @@ -1,11 +1,11 @@ ---- -title: Lidar -python: https://github.com/rerun-io/rerun/blob/latest/examples/python/lidar/main.py?speculative-link -tags: [lidar, 3D] -description: "Visualize the lidar data from the nuScenes dataset." -thumbnail: https://static.rerun.io/lidar/bcea9337044919c1524429bd26bc51a3c4db8ccb/480w.png -thumbnail_dimensions: [480, 286] ---- + + diff --git a/examples/python/limap/README.md b/examples/python/limap/README.md index f1fa26159649..553078485678 100644 --- a/examples/python/limap/README.md +++ b/examples/python/limap/README.md @@ -1,10 +1,11 @@ ---- -title: "3D Line Mapping Revisited" -python: https://github.com/rerun-io/limap -tags: [2D, 3D, structure-from-motion, time-series, line-detection, pinhole-camera] -thumbnail: https://static.rerun.io/limap/30b9ad1ae36df7dc809edfd40c11620292bc7294/480w.png -thumbnail_dimensions: [480, 277] ---- + + Human-made environments contain a lot of straight lines, which are currently not exploited by most mapping approaches. With their recent work "3D Line Mapping Revisited" Shaohui Liu et al. take steps towards changing that. diff --git a/examples/python/live_camera_edge_detection/README.md b/examples/python/live_camera_edge_detection/README.md index 775f09e0222d..6b7ae789f8b7 100644 --- a/examples/python/live_camera_edge_detection/README.md +++ b/examples/python/live_camera_edge_detection/README.md @@ -1,10 +1,10 @@ ---- -title: Live Camera Edge Detection -python: https://github.com/rerun-io/rerun/blob/latest/examples/python/live_camera_edge_detection/main.py -tags: [2D, canny, live, opencv] -thumbnail: https://static.rerun.io/live_camera_edge_detection/bf877bffd225f6c62cae3b87eecbc8e247abb202/480w.png -thumbnail_dimensions: [480, 364] ---- + + diff --git a/examples/python/live_depth_sensor/README.md b/examples/python/live_depth_sensor/README.md index 6ddac05995e4..2762fc8ebc92 100644 --- a/examples/python/live_depth_sensor/README.md +++ b/examples/python/live_depth_sensor/README.md @@ -1,10 +1,10 @@ ---- -title: Live Depth Sensor -python: https://github.com/rerun-io/rerun/blob/latest/examples/python/live_depth_sensor/main.py -tags: [2D, 3D, live, depth, realsense] -thumbnail: https://static.rerun.io/live_depth_sensor/d3c0392bebe2003d24110a779d6f6748167772d8/480w.png -thumbnail_dimensions: [480, 360] ---- + + diff --git a/examples/python/mcc/README.md b/examples/python/mcc/README.md index 12fbea5bcf26..74ea26745d8d 100644 --- a/examples/python/mcc/README.md +++ b/examples/python/mcc/README.md @@ -1,10 +1,11 @@ ---- -title: "Single Image 3D Reconstruction using MCC, SAM, and ZoeDepth" -python: https://github.com/rerun-io/MCC -tags: [2D, 3D, segmentation, point-cloud, sam] -thumbnail: https://static.rerun.io/mcc/d244be2806b5abcc0e905a2c262b491b73914658/480w.png -thumbnail_dimensions: [480, 274] ---- + + By combining MetaAI's [Segment Anything Model (SAM)](https://github.com/facebookresearch/segment-anything) and [Multiview Compressive Coding (MCC)](https://github.com/facebookresearch/MCC) we can get a 3D object from a single image. diff --git a/examples/python/minimal/README.md b/examples/python/minimal/README.md index 332e6b427b5c..d7ae9f724eb8 100644 --- a/examples/python/minimal/README.md +++ b/examples/python/minimal/README.md @@ -1,11 +1,9 @@ ---- -title: Minimal example -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/minimal/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/minimal/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/minimal/main.cpp -thumbnail: https://static.rerun.io/minimal/0e47ac513ab25d56cf2b493128097d499a07e5e8/480w.png -thumbnail_dimensions: [480, 322] ---- + + @@ -21,4 +19,3 @@ This is part of the [Quick Start guide](https://www.rerun.io/docs/getting-starte ```bash python examples/python/minimal/main.py ``` - diff --git a/examples/python/multiprocessing/README.md b/examples/python/multiprocessing/README.md index 0df2a77f90a6..ba091f51b874 100644 --- a/examples/python/multiprocessing/README.md +++ b/examples/python/multiprocessing/README.md @@ -1,9 +1,9 @@ ---- -title: Multiprocessing -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/multiprocessing/main.py -thumbnail: https://static.rerun.io/multiprocessing/72bcb7550d84f8e5ed5a39221093239e655f06de/480w.png -thumbnail_dimensions: [480, 308] ---- + + diff --git a/examples/python/multithreading/README.md b/examples/python/multithreading/README.md index 4c380cb2882b..2cd2a50b9e3e 100644 --- a/examples/python/multithreading/README.md +++ b/examples/python/multithreading/README.md @@ -1,9 +1,9 @@ ---- -title: Multithreading -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/multithreading/main.py -thumbnail: https://static.rerun.io/multithreading/8521bf95a7ff6004c932e8fb72429683928fbab4/480w.png -thumbnail_dimensions: [480, 312] ---- + + diff --git a/examples/python/nuscenes/README.md b/examples/python/nuscenes/README.md index 5d299fedc469..220061880c55 100644 --- a/examples/python/nuscenes/README.md +++ b/examples/python/nuscenes/README.md @@ -1,13 +1,12 @@ ---- -title: nuScenes -python: https://github.com/rerun-io/rerun/blob/latest/examples/python/nuscenes/main.py?speculative-link -tags: [lidar, 3D, 2D, object-detection, pinhole-camera] -description: "Visualize the nuScenes dataset including lidar, radar, images, and bounding boxes." -thumbnail: https://static.rerun.io/nuscenes/64a50a9d67cbb69ae872551989ee807b195f6b5d/480w.png -thumbnail_dimensions: [480, 282] -channel: nightly -build_args: ["--seconds=5"] ---- + diff --git a/examples/python/nv12/README.md b/examples/python/nv12/README.md index 8c3dd22c9e8f..93827e9c6682 100644 --- a/examples/python/nv12/README.md +++ b/examples/python/nv12/README.md @@ -1,8 +1,9 @@ ---- -title: NV12 -tags: [2d, image-encoding, yuv] -description: "Visualize an NV12 encoded video stream from a webcam." ---- + + diff --git a/examples/python/open_photogrammetry_format/README.md b/examples/python/open_photogrammetry_format/README.md index 0fdce1acc50b..def51fe9c643 100644 --- a/examples/python/open_photogrammetry_format/README.md +++ b/examples/python/open_photogrammetry_format/README.md @@ -1,12 +1,11 @@ ---- -title: Open Photogrammetry Format -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/open_photogrammetry_format/main.py -tags: [2d, 3d, camera, photogrammetry] -thumbnail: https://static.rerun.io/open_photogrammetry_format/603d5605f9670889bc8bce3365f16b831fce1eb1/480w.png -thumbnail_dimensions: [480, 310] -channel: nightly -build_args: ["--jpeg-quality=50"] ---- + diff --git a/examples/python/plots/README.md b/examples/python/plots/README.md index d8855202bd35..bd444a5bfb73 100644 --- a/examples/python/plots/README.md +++ b/examples/python/plots/README.md @@ -1,12 +1,12 @@ ---- -title: Plots -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/plots/main.py -tags: [2d, plots, api-example] -description: "Demonstration of various plots and charts supported by Rerun." -thumbnail: https://static.rerun.io/plots/c5b91cf0bf2eaf91c71d6cdcd4fe312d4aeac572/480w.png -thumbnail_dimensions: [480, 271] -channel: main ---- + + diff --git a/examples/python/raw_mesh/README.md b/examples/python/raw_mesh/README.md index 0d905bdab2ec..3cc309d433e2 100644 --- a/examples/python/raw_mesh/README.md +++ b/examples/python/raw_mesh/README.md @@ -1,12 +1,11 @@ ---- -title: Raw Mesh -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/raw_mesh/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/raw_mesh/src/main.rs -tags: [mesh] -thumbnail: https://static.rerun.io/raw_mesh/64bec98280b07794f7c9617f30ba2c20278601c3/480w.png -thumbnail_dimensions: [480, 271] -channel: nightly ---- + + diff --git a/examples/python/rgbd/README.md b/examples/python/rgbd/README.md index c99d9be10a86..7461d5ad76cc 100644 --- a/examples/python/rgbd/README.md +++ b/examples/python/rgbd/README.md @@ -1,12 +1,11 @@ ---- -title: RGBD -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/rgbd/main.py -tags: [2D, 3D, depth, nyud, pinhole-camera] -thumbnail: https://static.rerun.io/rgbd/4109d29ed52fa0a8f980fcdd0e9673360c76879f/480w.png -thumbnail_dimensions: [480, 254] -channel: nightly -build_args: ["--frames=300"] ---- + diff --git a/examples/python/ros_node/README.md b/examples/python/ros_node/README.md index 468198a71e5a..8600aa22e1e2 100644 --- a/examples/python/ros_node/README.md +++ b/examples/python/ros_node/README.md @@ -1,10 +1,10 @@ ---- -title: ROS Node -python: https://github.com/rerun-io/rerun/blob/latest/examples/python/ros_node/main.py -tags: [2D, 3D, mesh, pinhole-camera, ros, time-series] -thumbnail: https://static.rerun.io/ros_node/de224f02697d8fa26a387e497ef5823a68122356/480w.png -thumbnail_dimensions: [480, 266] ---- + + @@ -59,5 +59,3 @@ You can now connect to the running ROS system by running: ``` python3 examples/python/ros_node/main.py ``` - - diff --git a/examples/python/segment_anything_model/README.md b/examples/python/segment_anything_model/README.md index 4a423519ff49..46dcd687a27e 100644 --- a/examples/python/segment_anything_model/README.md +++ b/examples/python/segment_anything_model/README.md @@ -1,11 +1,11 @@ ---- -title: Segment Anything Model -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/segment_anything_model/main.py -tags: [2D, sam, segmentation] -thumbnail: https://static.rerun.io/segment_anything_model/6aa2651907efbcf81be55b343caa76b9de5f2138/480w.png -thumbnail_dimensions: [480, 283] -channel: nightly ---- + + diff --git a/examples/python/shape_pointe/README.md b/examples/python/shape_pointe/README.md index b96d07769a33..132f7e15706f 100644 --- a/examples/python/shape_pointe/README.md +++ b/examples/python/shape_pointe/README.md @@ -1,10 +1,11 @@ ---- -title: "Point-E and Shap-E" -python: https://github.com/rerun-io/point-shap-e -tags: [3D, diffusion, point, mesh] -thumbnail: https://static.rerun.io/overview/6516611ebcf25c4b946e3d99c21c6930d4c9f0bd/480w.png -thumbnail_dimensions: [480, 293] ---- + + OpenAI has released two models for text-to-3d generation: Point-E and Shape-E. Both of these methods are fast and interesting but still low fidelity for now. diff --git a/examples/python/shared_recording/README.md b/examples/python/shared_recording/README.md index 4e0e1b2e2515..db773eedd4dc 100644 --- a/examples/python/shared_recording/README.md +++ b/examples/python/shared_recording/README.md @@ -1,9 +1,7 @@ ---- -title: Shared Recording -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/shared_recording/main.py?speculative-link -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/shared_recording/src/main.rs?speculative-link -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/shared_recording/main.cpp?speculative-link ---- + + diff --git a/examples/python/signed_distance_fields/README.md b/examples/python/signed_distance_fields/README.md index e6aba1383493..1bface96cd58 100644 --- a/examples/python/signed_distance_fields/README.md +++ b/examples/python/signed_distance_fields/README.md @@ -1,10 +1,10 @@ ---- -title: Signed Distance Fields -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/signed_distance_fields/main.py -tags: [3D, mesh, tensor] -thumbnail: https://static.rerun.io/signed_distance_fields/99f6a886ed6f41b6a8e9023ba917a98668eaee70/480w.png -thumbnail_dimensions: [480, 294] ---- + + diff --git a/examples/python/simplerecon/README.md b/examples/python/simplerecon/README.md index 9d2903a71ee3..adb6da7453ef 100644 --- a/examples/python/simplerecon/README.md +++ b/examples/python/simplerecon/README.md @@ -1,10 +1,11 @@ ---- -title: "SimpleRecon: 3D Reconstruction Without 3D Convolutions" -python: https://github.com/rerun-io/simplerecon -tags: [3D, depth, time-series, pinhole-camera, mesh] -thumbnail: https://static.rerun.io/simplerecon/e309760134e44ba5ca1a547cb310d47a19257e5b/480w.png -thumbnail_dimensions: [480, 271] ---- + + SimpleRecon is a back-to-basics approach for 3D scene reconstruction from posed monocular images by Niantic Labs. It offers state-of-the-art depth accuracy and competitive 3D scene reconstruction which makes it perfect for resource-constrained environments. diff --git a/examples/python/slahmr/README.md b/examples/python/slahmr/README.md index 913355903739..dbad445366bb 100644 --- a/examples/python/slahmr/README.md +++ b/examples/python/slahmr/README.md @@ -1,10 +1,11 @@ ---- -title: Decoupling Human and Camera Motion from Videos in the Wild -python: https://github.com/rerun-io/slahmr -tags: [3D, SLAM, keypoint-detection, mesh, time-series] -thumbnail: https://static.rerun.io/slahmr/3fad4f6b2c1a807fb92e8d33a2f90f7391c290a2/480w.png -thumbnail_dimensions: [480, 293] ---- + + SLAHMR robustly tracks the motion of multiple moving people filmed with a moving camera and works well on “in-the-wild” videos. It’s a great showcase of how to build working computer vision systems by intelligently combining several single purpose models. diff --git a/examples/python/stdio/README.md b/examples/python/stdio/README.md index c4bf386fea89..3955cc454bbe 100644 --- a/examples/python/stdio/README.md +++ b/examples/python/stdio/README.md @@ -1,11 +1,9 @@ ---- -title: Standard Input/Output example -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/stdio/main.py?speculative-link -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/stdio/src/main.rs?speculative-link -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/stdio/main.cpp?speculative-link -thumbnail: https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/480w.png -thumbnail_dimensions: [480, 298] ---- + + diff --git a/examples/python/structure_from_motion/README.md b/examples/python/structure_from_motion/README.md index 6aa2079b3993..f94d45189412 100644 --- a/examples/python/structure_from_motion/README.md +++ b/examples/python/structure_from_motion/README.md @@ -1,13 +1,13 @@ ---- -title: Structure from Motion -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/structure_from_motion/main.py -tags: [2D, 3D, colmap, pinhole-camera, time-series] -description: "Visualize a sparse reconstruction by COLMAP, a general-purpose Structure-from-Motion and Multi-View Stereo pipeline." -thumbnail: https://static.rerun.io/structure_from_motion/b17f8824291fa1102a4dc2184d13c91f92d2279c/480w.png -thumbnail_dimensions: [480, 275] -channel: main -build_args: ["--dataset=colmap_fiat", "--resize=800x600"] ---- + + diff --git a/examples/python/tapir/README.md b/examples/python/tapir/README.md index 89430883500c..984fe670ff99 100644 --- a/examples/python/tapir/README.md +++ b/examples/python/tapir/README.md @@ -1,10 +1,10 @@ ---- -title: "TAPIR: Tracking Any Point with per-frame Initialization and temporal Refinement" -python: https://github.com/rerun-io/tapnet -tags: [2D, point-tracking, time-series, tensor, jax] -thumbnail: https://static.rerun.io/tapir/f6a7697848c2ac1e7f0b8db5964f39133c520896/480w.png -thumbnail_dimensions: [480, 288] ---- + Tracking any point in a video is a fundamental problem in computer vision. The paper “TAPIR: Tracking Any Point with per-frame Initialization and temporal Refinement” by Carl Doersch et al. significantly improved over prior state-of-the-art. diff --git a/examples/python/template/README.md b/examples/python/template/README.md index 79e60fb975d2..8e48e80801c3 100644 --- a/examples/python/template/README.md +++ b/examples/python/template/README.md @@ -1,10 +1,9 @@ ---- -title: Template -tags: [kebab-case, comma, separated] -description: "Short ~100-sign description of the example. No longer than 130 signs!" -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/template/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/template/src/main.rs ---- + + + Novel view synthesis has made remarkable progress in recent years, but most methods require per-scene optimization on many images. In their [CVPR 2023 paper](https://openaccess.thecvf.com/content/CVPR2023/html/Du_Learning_To_Render_Novel_Views_From_Wide-Baseline_Stereo_Pairs_CVPR_2023_paper.html) Yilun Du et al. propose a method that works with just 2 views. I created a visual walkthrough of the work using the Rerun SDK. diff --git a/examples/rust/clock/README.md b/examples/rust/clock/README.md index da517dee55dd..b3b78137a610 100644 --- a/examples/rust/clock/README.md +++ b/examples/rust/clock/README.md @@ -1,10 +1,8 @@ ---- -title: Clock -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/clock/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/clock/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/clock/main.cpp -thumbnail: https://static.rerun.io/clock/ae4b8970edba8480431cb71e57b8cddd9e1769c7/480w.png ---- + + diff --git a/examples/rust/custom_space_view/README.md b/examples/rust/custom_space_view/README.md index 4641a5c0d916..8fc2bb1fa27c 100644 --- a/examples/rust/custom_space_view/README.md +++ b/examples/rust/custom_space_view/README.md @@ -1,8 +1,8 @@ ---- -title: Custom Space View UI -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/custom_space_view/src/main.rs -thumbnail: https://static.rerun.io/custom_space_view/e05a073d64003645b6af6de91b068c2f646c1b8a/480w.jpeg ---- + + diff --git a/examples/rust/custom_store_subscriber/README.md b/examples/rust/custom_store_subscriber/README.md index d05f8f73b0d9..7ec39623d007 100644 --- a/examples/rust/custom_store_subscriber/README.md +++ b/examples/rust/custom_store_subscriber/README.md @@ -1,8 +1,8 @@ ---- -title: Custom Store Subscriber -tags: [store-event, store-diff, store-subscriber] -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/custom_store_subscriber/src/main.rs?speculative-link ---- + + diff --git a/examples/rust/dna/README.md b/examples/rust/dna/README.md index 84810c0c2fc0..2c251a2474bc 100644 --- a/examples/rust/dna/README.md +++ b/examples/rust/dna/README.md @@ -1,14 +1,12 @@ ---- -title: Helix -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/dna/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/dna/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/dna/main.cpp -tags: [3d, api-example] -description: "Simple example of logging point and line primitives to draw a 3D helix." -thumbnail: https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/480w.png -thumbnail_dimensions: [480, 285] -channel: main ---- + + diff --git a/examples/rust/extend_viewer_ui/README.md b/examples/rust/extend_viewer_ui/README.md index bcaf5e318c92..07716aa596ed 100644 --- a/examples/rust/extend_viewer_ui/README.md +++ b/examples/rust/extend_viewer_ui/README.md @@ -1,8 +1,8 @@ ---- -title: Extend Viewer UI -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/extend_viewer_ui/src/main.rs -thumbnail: https://static.rerun.io/extend_viewer_ui/6ccfbe3718a50e659c484d31033db0bd9d40c262/480w.png ---- + + Example showing how to wrap the Rerun Viewer in your own GUI. diff --git a/examples/rust/minimal/README.md b/examples/rust/minimal/README.md index e6907fcf330d..a2bccf294694 100644 --- a/examples/rust/minimal/README.md +++ b/examples/rust/minimal/README.md @@ -1,10 +1,8 @@ ---- -title: Minimal example -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/minimal/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/minimal/src/main.rs -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/minimal/main.cpp -thumbnail: https://static.rerun.io/minimal/0e47ac513ab25d56cf2b493128097d499a07e5e8/480w.png ---- + + @@ -20,4 +18,3 @@ This is part of the [Quick Start guide](https://www.rerun.io/docs/getting-starte ```bash cargo run --release ``` - diff --git a/examples/rust/minimal_serve/README.md b/examples/rust/minimal_serve/README.md index 1a6d2f93a71c..cab433a1c783 100644 --- a/examples/rust/minimal_serve/README.md +++ b/examples/rust/minimal_serve/README.md @@ -1,8 +1,8 @@ ---- -title: Minimal `serve` example -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/minimal_serve/src/main.rs -thumbnail: https://static.rerun.io/minimal/0e47ac513ab25d56cf2b493128097d499a07e5e8/480w.png ---- + + diff --git a/examples/rust/objectron/README.md b/examples/rust/objectron/README.md index 42e251dc3ba0..699dfef64311 100644 --- a/examples/rust/objectron/README.md +++ b/examples/rust/objectron/README.md @@ -1,11 +1,9 @@ ---- -title: Objectron -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/objectron/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/objectron/src/main.rs -tags: [2D, 3D, object-detection, pinhole-camera] -thumbnail: https://static.rerun.io/objectron/8ea3a37e6b4af2e06f8e2ea5e70c1951af67fea8/480w.png -build_args: ["--frames=100"] ---- + diff --git a/examples/rust/raw_mesh/README.md b/examples/rust/raw_mesh/README.md index a3cc37f3fd86..b2fdbcfe1878 100644 --- a/examples/rust/raw_mesh/README.md +++ b/examples/rust/raw_mesh/README.md @@ -1,9 +1,8 @@ ---- -title: Raw Mesh -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/raw_mesh/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/raw_mesh/src/main.rs -thumbnail: https://static.rerun.io/raw_mesh/64bec98280b07794f7c9617f30ba2c20278601c3/480w.png ---- + + diff --git a/examples/rust/shared_recording/README.md b/examples/rust/shared_recording/README.md index 506992c7d260..af954e850bb2 100644 --- a/examples/rust/shared_recording/README.md +++ b/examples/rust/shared_recording/README.md @@ -1,7 +1,7 @@ ---- -title: Shared Recording -rust: https://github.com/rerun-io/rerun/tree/latest/examples/python/shared_recording/main.py?speculative-link ---- + + diff --git a/examples/rust/spawn_viewer/README.md b/examples/rust/spawn_viewer/README.md index 088bebc8ce8d..f6078a658eac 100644 --- a/examples/rust/spawn_viewer/README.md +++ b/examples/rust/spawn_viewer/README.md @@ -1,10 +1,8 @@ ---- -title: Spawn Viewer -tags: [spawn] -c: https://github.com/rerun-io/rerun/tree/latest/examples/c/spawn_viewer/main.c -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/spawn_viewer/main.cpp -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/spawn_viewer/src/main.rs ---- + + Shows how to spawn a new Rerun Viewer process ready to listen for TCP connections using an executable available in PATH. diff --git a/examples/rust/stdio/README.md b/examples/rust/stdio/README.md index 01332218b8d9..30862b0e19f2 100644 --- a/examples/rust/stdio/README.md +++ b/examples/rust/stdio/README.md @@ -1,10 +1,8 @@ ---- -title: Standard Input/Output example -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/stdio/main.py?speculative-link -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/stdio/src/main.rs?speculative-link -cpp: https://github.com/rerun-io/rerun/tree/latest/examples/cpp/stdio/main.cpp?speculative-link -thumbnail: https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/480w.png ---- + + diff --git a/examples/rust/template/README.md b/examples/rust/template/README.md index 2cfa1032125f..9c73e6678250 100644 --- a/examples/rust/template/README.md +++ b/examples/rust/template/README.md @@ -1,9 +1,8 @@ ---- -title: Template -tags: [kebab-case, comma, separated] -python: https://github.com/rerun-io/rerun/tree/latest/examples/python/template/main.py -rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/template/src/main.rs ---- + + ", start) + if end == -1: + return None + + fm = s[start:end].strip() + + return tomlkit.loads(fm).unwrap() diff --git a/scripts/ci/requirements.txt b/scripts/ci/requirements.txt index fe81c3891397..04034a678d8a 100644 --- a/scripts/ci/requirements.txt +++ b/scripts/ci/requirements.txt @@ -13,6 +13,5 @@ colorama==0.4.6 gitignore-parser==0.1.4 google-cloud-storage==2.9.0 packaging==23.1 -python-frontmatter==1.0.0 requests>=2.31,<3 tomlkit==0.11.8 diff --git a/scripts/ci/thumbnails.py b/scripts/ci/thumbnails.py index 886e87963029..9ae1d385e328 100755 --- a/scripts/ci/thumbnails.py +++ b/scripts/ci/thumbnails.py @@ -6,15 +6,17 @@ import argparse from io import BytesIO from pathlib import Path -from typing import Generator +from typing import Any, Dict, Generator -import frontmatter import requests +from frontmatter import load_frontmatter from PIL import Image +Frontmatter = Dict[str, Any] + class Example: - def __init__(self, path: Path, readme: str, fm: frontmatter.Post) -> None: + def __init__(self, path: Path, readme: str, fm: Frontmatter) -> None: self.path = path self.readme = readme self.fm = fm @@ -31,8 +33,8 @@ def examples_with_thumbnails() -> Generator[Example, None, None]: for path in Path("examples/python").iterdir(): if (path / "README.md").exists(): readme = (path / "README.md").read_text() - fm = frontmatter.loads(readme) - if fm.get("thumbnail"): + fm = load_frontmatter(readme) + if fm is not None and fm.get("thumbnail"): yield Example(path, readme, fm) diff --git a/scripts/lint.py b/scripts/lint.py index 81b15c055a45..7a47dcec6fd5 100755 --- a/scripts/lint.py +++ b/scripts/lint.py @@ -12,9 +12,9 @@ import re import sys from pathlib import Path -from typing import Any, Callable, Iterator +from typing import Any, Callable, Dict, Iterator -import frontmatter +from ci.frontmatter import load_frontmatter from gitignore_parser import parse_gitignore # ----------------------------------------------------------------------------- @@ -38,6 +38,9 @@ double_word = re.compile(r" ([a-z]+) \1[ \.]") +Frontmatter = Dict[str, Any] + + def is_valid_todo_part(part: str) -> bool: part = part.strip() @@ -597,7 +600,7 @@ def test_lint_forbidden_widgets() -> None: assert _index_to_line_nr(should_fail_two_times, res[1][1]) == 5 -def lint_example_description(filepath: str, fm: frontmatter.Post) -> list[str]: +def lint_example_description(filepath: str, fm: Frontmatter) -> list[str]: # only applies to examples' readme if not filepath.startswith("./examples/python") or not filepath.endswith("README.md"): @@ -617,7 +620,9 @@ def lint_frontmatter(filepath: str, content: str) -> list[str]: if not filepath.endswith(".md"): return errors - fm = frontmatter.loads(content) + fm = load_frontmatter(content) + if fm is None: + return [] errors += lint_example_description(filepath, fm) diff --git a/scripts/requirements-dev.txt b/scripts/requirements-dev.txt index 67897310a4eb..3d8840a76ef4 100644 --- a/scripts/requirements-dev.txt +++ b/scripts/requirements-dev.txt @@ -12,4 +12,3 @@ torch tqdm requests gitignore_parser # handle .gitignore -python-frontmatter==1.0.0