Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighter UI for tensor, annotation-context, view coordinates, recording #5782

Merged
merged 5 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/re_data_ui/src/annotation_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ impl DataUi for AnnotationContext {
UiVerbosity::Small | UiVerbosity::Reduced => {
if self.0.len() == 1 {
let descr = &self.0[0].class_description;
ui.label(format!("AnnotationContext with one class containing {} keypoints and {} connections", descr.keypoint_annotations.len(), descr.keypoint_connections.len()));
ui.label(format!(
"One class containing {} keypoints and {} connections",
descr.keypoint_annotations.len(),
descr.keypoint_connections.len()
));
} else {
ui.label(format!("AnnotationContext with {} classes", self.0.len()));
ui.label(format!("{} classes", self.0.len()));
}
}
UiVerbosity::LimitHeight | UiVerbosity::Full => {
Expand Down
3 changes: 2 additions & 1 deletion crates/re_data_ui/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ impl DataUi for ViewCoordinates {
) {
match verbosity {
UiVerbosity::Small => {
ui.label(format!("ViewCoordinates: {}", self.describe()));
ui.label(self.describe_short())
.on_hover_text(self.describe());
}
UiVerbosity::Full | UiVerbosity::LimitHeight | UiVerbosity::Reduced => {
ui.label(self.describe());
Expand Down
4 changes: 2 additions & 2 deletions crates/re_data_ui/src/entity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ impl crate::DataUi for EntityDb {
ui.label(store_kind.to_string());
ui.end_row();

re_ui.grid_left_hand_label(ui, "Recording started");
re_ui.grid_left_hand_label(ui, "Created");
ui.label(started.format(ctx.app_options.time_zone));
ui.end_row();
}

if let Some(latest_row_id) = self.latest_row_id() {
if let Ok(nanos_since_epoch) = i64::try_from(latest_row_id.nanoseconds_since_epoch()) {
let time = re_log_types::Time::from_ns_since_epoch(nanos_since_epoch);
re_ui.grid_left_hand_label(ui, "Last modified at");
re_ui.grid_left_hand_label(ui, "Modified");
ui.label(time.format(ctx.app_options.time_zone));
ui.end_row();
}
Expand Down
23 changes: 12 additions & 11 deletions crates/re_data_ui/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ use crate::image_meaning_for_entity;
use super::EntityDataUi;

pub fn format_tensor_shape_single_line(shape: &[TensorDimension]) -> String {
format!("[{}]", shape.iter().join(", "))
const MAX_SHOWN: usize = 4; // should be enough for width/height/depth and then some!
let shapes = shape.iter().take(MAX_SHOWN).join(", ");
if shape.len() > MAX_SHOWN {
format!("{shapes}…")
} else {
shapes
}
}

impl EntityDataUi for re_types::components::TensorData {
Expand Down Expand Up @@ -149,16 +155,11 @@ pub fn tensor_ui(
],
None => tensor.shape.clone(),
};
ui.label(format!(
"{} x {}{}",
tensor.dtype(),
format_tensor_shape_single_line(shape.as_slice()),
if original_tensor.buffer.is_compressed_image() {
" (compressed)"
} else {
""
}
))
ui.vertical(|ui| {
// Put in a vertical layout to allow wrap around.
ui.label(format_tensor_shape_single_line(shape.as_slice()))
})
.inner
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
.on_hover_ui(|ui| {
tensor_summary_ui(
ctx.re_ui,
Expand Down
Loading