diff --git a/crates/re_data_ui/src/image.rs b/crates/re_data_ui/src/image.rs index 4dd25e351a899..aac97e779128d 100644 --- a/crates/re_data_ui/src/image.rs +++ b/crates/re_data_ui/src/image.rs @@ -664,7 +664,8 @@ fn tensor_pixel_value_ui( ui.label(format!("{x}, {y}")); ui.end_row(); - if tensor.num_dim() == 2 { + // Check for annotations on any single-channel image + if let Some([_, _, 1]) = tensor.image_height_width_channels() { if let Some(raw_value) = tensor.get(&[y, x]) { if let (TensorDataMeaning::ClassId, Some(u16_val)) = (meaning, raw_value.try_as_u16()) diff --git a/crates/re_types/src/datatypes/tensor_data_ext.rs b/crates/re_types/src/datatypes/tensor_data_ext.rs index 80b32eff3f685..c4db01cf74c3a 100644 --- a/crates/re_types/src/datatypes/tensor_data_ext.rs +++ b/crates/re_types/src/datatypes/tensor_data_ext.rs @@ -80,8 +80,8 @@ impl TensorData { 2 => Some([shape_short[0].size, shape_short[1].size, 1]), 3 => { let channels = shape_short[2].size; - if matches!(channels, 3 | 4) { - // rgb, rgba + if matches!(channels, 1 | 3 | 4) { + // mono, rgb, rgba Some([shape_short[0].size, shape_short[1].size, channels]) } else { None