Skip to content

Commit

Permalink
Updated a bunch of other examples
Browse files Browse the repository at this point in the history
  • Loading branch information
abey79 committed Oct 23, 2023
1 parent 771a034 commit 8d25678
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion crates/re_types/definitions/rerun/archetypes/boxes3d.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace rerun.archetypes;
/// 3D boxes with half-extents and optional center, rotations, rotations, colors etc.
///
/// \example box3d_simple !api title="Simple 3D boxes" image="https://static.rerun.io/box3d_simple/d6a3f38d2e3360fbacac52bb43e44762635be9c8/1200w.png"
/// \example box3d_batch title="Batch of 3D boxes" image="https://static.rerun.io/box3d_batch/28368d2872b2c98186a49fbd063b433e324a88ba/1200w.png"
/// \example box3d_batch title="Batch of 3D boxes" image="https://static.rerun.io/box3d_batch/6d3e453c3a0201ae42bbae9de941198513535f1d/1200w.png"
table Boxes3D (
"attr.rust.derive": "PartialEq",
"attr.rust.new_pub_crate",
Expand Down
6 changes: 3 additions & 3 deletions crates/re_types/src/archetypes/annotation_context.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions crates/re_types/src/archetypes/boxes3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions docs/code-examples/annotation_context_segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ int main() {
);

// create a segmentation image
const int HEIGHT = 8;
const int WIDTH = 12;
const int HEIGHT = 200;
const int WIDTH = 300;
std::vector<uint8_t> data(WIDTH * HEIGHT, 0);
for (auto y = 0; y < 4; ++y) { // top half
std::fill_n(data.begin() + y * WIDTH, 6, 1); // left half
for (auto y = 50; y < 100; ++y) {
std::fill_n(data.begin() + y * WIDTH + 50, 70, 1);
}
for (auto y = 4; y < 8; ++y) { // bottom half
std::fill_n(data.begin() + y * WIDTH + 6, 6, 2); // right half
for (auto y = 100; y < 180; ++y) {
std::fill_n(data.begin() + y * WIDTH + 130, 150, 2);
}

rec.log("segmentation/image", rerun::SegmentationImage({HEIGHT, WIDTH}, std::move(data)));
Expand Down
6 changes: 3 additions & 3 deletions docs/code-examples/annotation_context_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
rr.init("rerun_example_annotation_context_segmentation", spawn=True)

# Create a simple segmentation image
image = np.zeros((8, 12), dtype=np.uint8)
image[0:4, 0:6] = 1
image[4:8, 6:12] = 2
image = np.zeros((200, 300), dtype=np.uint8)
image[50:100, 50:120] = 1
image[100:180, 130:280] = 2

# Log an annotation context to assign a label and color to each class
rr.log("segmentation", rr.AnnotationContext([(1, "red", (255, 0, 0)), (2, "green", (0, 255, 0))]), timeless=True)
Expand Down
6 changes: 3 additions & 3 deletions docs/code-examples/annotation_context_segmentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
)?;

// create a segmentation image
let mut data = Array::<u8, _>::zeros((8, 12).f());
data.slice_mut(s![0..4, 0..6]).fill(1);
data.slice_mut(s![4..8, 6..12]).fill(2);
let mut data = Array::<u8, _>::zeros((200, 300).f());
data.slice_mut(s![50..100, 50..120]).fill(1);
data.slice_mut(s![100..180, 130..280]).fill(2);

rec.log(
"segmentation/image",
Expand Down
2 changes: 1 addition & 1 deletion docs/code-examples/depth_image_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main() {
rec.log(
"world/camera",
rerun::Pinhole::focal_length_and_resolution(
{20.0f, 20.0f},
{200.0f, 200.0f},
{static_cast<float>(WIDTH), static_cast<float>(HEIGHT)}
)
);
Expand Down
2 changes: 1 addition & 1 deletion docs/code-examples/depth_image_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
rr.Pinhole(
width=depth_image.shape[1],
height=depth_image.shape[0],
focal_length=20,
focal_length=200,
),
)

Expand Down
2 changes: 1 addition & 1 deletion docs/code-examples/depth_image_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
rec.log(
"world/camera",
&rerun::Pinhole::from_focal_length_and_resolution(
[20.0, 20.0],
[200.0, 200.0],
[image.shape()[1] as f32, image.shape()[0] as f32],
),
)?;
Expand Down
10 changes: 5 additions & 5 deletions docs/content/reference/types/archetypes/boxes3d.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions rerun_cpp/src/rerun/archetypes/annotation_context.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rerun_py/rerun_sdk/rerun/archetypes/annotation_context.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions rerun_py/rerun_sdk/rerun/archetypes/boxes3d.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8d25678

Please sign in to comment.