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

Mechanism to force image to be treated as a tensor #1323

Closed
jleibs opened this issue Feb 16, 2023 · 2 comments
Closed

Mechanism to force image to be treated as a tensor #1323

jleibs opened this issue Feb 16, 2023 · 2 comments
Labels
enhancement New feature or request ui concerns graphical user interface

Comments

@jleibs
Copy link
Member

jleibs commented Feb 16, 2023

Not all 2D tensors are images. Data like an stft looks like an image but doesn't play nicely with the image viewer.

The tensor viewer has a number of nice features like:

  • support for f64 data
  • the ability to not lock the aspect ratio
  • support for colormaps

We can trick the viewer into creating a tensor by adding a trivial outer dimension, but it would be nice not to need to do this:

Example:

f, t, Zxx = scipy.signal.stft(x, fs, nperseg=1000)
Zxx_image = np.abs(Zxx).astype(np.float32)
Zxx_tensor = np.expand_dims(np.abs(Zxx), axis=0)

rr.init("stft_test", spawn=True)
rr.log_tensor("stft_image", Zxx_image)
rr.log_tensor("stft_tensor", Zxx_tensor)

image

@jleibs jleibs added enhancement New feature or request ui concerns graphical user interface labels Feb 16, 2023
@Wumpf
Copy link
Member

Wumpf commented Feb 16, 2023

@jleibs
Copy link
Member Author

jleibs commented Nov 28, 2023

rr.log("stft_tensor", rr.Tensor(Zxx_image))

now does exactly what this describes

@jleibs jleibs closed this as completed Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ui concerns graphical user interface
Projects
None yet
Development

No branches or pull requests

2 participants