-
Notifications
You must be signed in to change notification settings - Fork 405
/
Copy pathannotation_context.cpp
38 lines (33 loc) · 1.24 KB
/
annotation_context.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
)})
);
}