-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into emilk/arrow-col-descr
- Loading branch information
Showing
15 changed files
with
155 additions
and
81 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
#include <rerun.hpp> | ||
|
||
int main() { | ||
const auto rec = rerun::RecordingStream("rerun_example_annotation_context_connections"); | ||
rec.spawn().exit_on_failure(); | ||
|
||
// Annotation context with two classes, using two labeled classes, of which ones defines a | ||
// color. | ||
rec.log_static( | ||
"masks", | ||
rerun::AnnotationContext({ | ||
rerun::AnnotationInfo(0, "Background"), | ||
rerun::AnnotationInfo(1, "Person", rerun::Rgba32(255, 0, 0)), | ||
}) | ||
); | ||
|
||
// Annotation context with simple keypoints & keypoint connections. | ||
std::vector<rerun::AnnotationInfo> keypoint_annotations; | ||
for (uint16_t i = 0; i < 10; ++i) { | ||
keypoint_annotations.push_back( | ||
rerun::AnnotationInfo(i, rerun::Rgba32(0, static_cast<uint8_t>(28 * i), 0)) | ||
); | ||
} | ||
|
||
std::vector<rerun::KeypointPair> keypoint_connections; | ||
for (uint16_t i = 0; i < 9; ++i) { | ||
keypoint_connections.push_back(rerun::KeypointPair(i, i + 1)); | ||
} | ||
|
||
rec.log_static( | ||
"detections", // Applies to all entities below "detections". | ||
rerun::AnnotationContext({rerun::ClassDescription( | ||
rerun::AnnotationInfo(0, "Snake"), | ||
keypoint_annotations, | ||
keypoint_connections | ||
)}) | ||
); | ||
} |
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,40 @@ | ||
use rerun::{ | ||
datatypes::{ClassDescriptionMapElem, KeypointId}, | ||
AnnotationContext, AnnotationInfo, ClassDescription, Rgba32, | ||
}; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let rec = rerun::RecordingStreamBuilder::new("rerun_example_annotation_context_connections") | ||
.spawn()?; | ||
|
||
// Annotation context with two classes, using two labeled classes, of which ones defines a | ||
// color. | ||
rec.log_static( | ||
"masks", // Applies to all entities below "masks". | ||
&AnnotationContext::new([ | ||
ClassDescriptionMapElem::from((0, "Background")), | ||
ClassDescriptionMapElem::from((1, "Person", Rgba32::from_rgb(255, 0, 0))), | ||
]), | ||
)?; | ||
|
||
// Annotation context with simple keypoints & keypoint connections. | ||
rec.log_static( | ||
"detections", // Applies to all entities below "detections". | ||
&AnnotationContext::new([ClassDescription { | ||
info: (0, "Snake").into(), | ||
keypoint_annotations: (0..10) | ||
.map(|i| AnnotationInfo { | ||
id: i, | ||
label: None, | ||
color: Some(Rgba32::from_rgb(0, (28 * i) as u8, 0)), | ||
}) | ||
.collect(), | ||
keypoint_connections: (0..9) | ||
.map(|i| (KeypointId(i), KeypointId(i + 1))) | ||
.map(Into::into) | ||
.collect(), | ||
}]), | ||
)?; | ||
|
||
Ok(()) | ||
} |
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,23 @@ | ||
//! Log arbitrary data. | ||
use std::sync::Arc; | ||
|
||
use rerun::external::arrow; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let rec = rerun::RecordingStreamBuilder::new("rerun_example_any_values").spawn()?; | ||
|
||
let confidences = rerun::SerializedComponentBatch::new( | ||
Arc::new(arrow::array::Float64Array::from(vec![1.2, 3.4, 5.6])), | ||
rerun::ComponentDescriptor::new("confidence"), | ||
); | ||
|
||
let description = rerun::SerializedComponentBatch::new( | ||
Arc::new(arrow::array::StringArray::from(vec!["Bla bla bla…"])), | ||
rerun::ComponentDescriptor::new("description"), | ||
); | ||
|
||
rec.log("any_values", &[confidences, description])?; | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.