-
Notifications
You must be signed in to change notification settings - Fork 373
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
Show tensors shaped [H, W, 1, 1]
as images
#1871
Comments
Hi! If I am not wrong, this is a straightforward implementation change that can be made. The fucntion can simply check if the last dimension of the tensor is a unit-dimension, and if so, remove it before displaying the image. |
@tauseefmohammed2 sure go ahead! We actually rarely use the assign feature 😄 , but this way at least nobody else starts working on it redundantly :) EDIT: I misread |
… an image. Fixes #1871 Quite a bit of nuance to support single channel 1x1 images & line-like images.
* Ignore trailing tensor dimension when determining whether a tensor is an image. Fixes #1871 Quite a bit of nuance to support single channel 1x1 images & line-like images. * fix image preview for images other than M x N x C and M x N * comment fix * better shape_short comment * handle empty tensors * is_shaped_like_an_image is now defined via image_height_width_channels, improve comment on both * any Nx1x... image now now treated as image * rename to get_with_image_coords, make it more restrictive * tensor_to_gpu height_width_depth utility uses now tensor.image_height_width_channels * change behavior of is_vector
* Ignore trailing tensor dimension when determining whether a tensor is an image. Fixes #1871 Quite a bit of nuance to support single channel 1x1 images & line-like images. * fix image preview for images other than M x N x C and M x N * comment fix * better shape_short comment * handle empty tensors * is_shaped_like_an_image is now defined via image_height_width_channels, improve comment on both * any Nx1x... image now now treated as image * rename to get_with_image_coords, make it more restrictive * tensor_to_gpu height_width_depth utility uses now tensor.image_height_width_channels * change behavior of is_vector
Mentioned here and elsewhere:
It is fairly common to store a single image in a
[H, W, 1, 1]
or[H, W, 3, 1]
tensor.However, currently Rerun only shows
[H, W, 1|3|4]
tensors as images, despite the trailing unit-dimension beeing an noop.This should be fairly easy to handle by ignoring trailing unit-dimensions in:
Tensor::image_height_width_channels
Tensor::is_shaped_like_an_image
Tensor::is_vector
Preferably they would just use the same function,
fn shape_short(&self) -> &[TensorDimension]
The text was updated successfully, but these errors were encountered: