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

Allow to specify a tensor's data range via component #2341

Closed
Wumpf opened this issue Jun 8, 2023 · 0 comments · Fixed by #7549
Closed

Allow to specify a tensor's data range via component #2341

Wumpf opened this issue Jun 8, 2023 · 0 comments · Fixed by #7549
Assignees
Labels
😤 annoying Something in the UI / SDK is annoying to use 🐍 Python API Python logging API 🦀 Rust API Rust logging API

Comments

@Wumpf
Copy link
Member

Wumpf commented Jun 8, 2023

Related to

We only determine the data range heuristically so far.

@Wumpf Wumpf added 🐍 Python API Python logging API 🦀 Rust API Rust logging API 😤 annoying Something in the UI / SDK is annoying to use labels Jun 8, 2023
Wumpf added a commit that referenced this issue Jun 12, 2023
…coding (#2342)

<!--
Open the PR up as a draft until you feel it is ready for a proper
review.

Do not make PR:s from your own `main` branch, as that makes it difficult
for reviewers to add their own fixes.

Add any improvements to the branch as new commits to make it easier for
reviewers to follow the progress. All commits will be squashed to a
single commit once the PR is merged into `main`.

Make sure you mention any issues that this PR closes in the description,
as well as any other related issues.

To get an auto-generated PR description you can put "copilot:summary" or
"copilot:walkthrough" anywhere.
-->

### What

Fixes #2274 
* #2274 

Will need to be further worked on via:
* #2341


Introduces 3 new things actually:
* finite range, determined if the range of a tensor was in fact not
finite
* heuristic for color mapping range
* heuristic for srgb
   * ⚠️ does this break things?


Range & sRGB:

This
```
import rerun as rr
import numpy as np
import matplotlib.pyplot as plt

rr.init("image color", spawn=True)
img = np.random.random((300, 300, 3)) * 0.2
rr.log_image("image", img)
print(img.min(), img.max())  # to check they are in range [0,1]

plt.imshow(img)
plt.show()
```
Gives now the expected image:

![image](https://github.com/rerun-io/rerun/assets/1220815/9fcda125-f762-4fd4-ae24-ce6dcaaa496a)


When setting a pixel to inf, we show the "finite range" as well, and
behave correctly:
<img width="1026" alt="image"
src="https://github.com/rerun-io/rerun/assets/1220815/7d3037e8-f562-4b6c-8f08-ec4f5627c21a">


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)

<!-- This line will get updated when the PR build summary job finishes.
-->
PR Build Summary: https://build.rerun.io/pr/2342

<!-- pr-link-docs:start -->
Docs preview: https://rerun.io/preview/93697e6/docs
Examples preview: https://rerun.io/preview/93697e6/examples
<!-- pr-link-docs:end -->
emilk pushed a commit that referenced this issue Jun 15, 2023
…coding (#2342)

<!--
Open the PR up as a draft until you feel it is ready for a proper
review.

Do not make PR:s from your own `main` branch, as that makes it difficult
for reviewers to add their own fixes.

Add any improvements to the branch as new commits to make it easier for
reviewers to follow the progress. All commits will be squashed to a
single commit once the PR is merged into `main`.

Make sure you mention any issues that this PR closes in the description,
as well as any other related issues.

To get an auto-generated PR description you can put "copilot:summary" or
"copilot:walkthrough" anywhere.
-->

Fixes #2274
* #2274

Will need to be further worked on via:
* #2341

Introduces 3 new things actually:
* finite range, determined if the range of a tensor was in fact not
finite
* heuristic for color mapping range
* heuristic for srgb
   * ⚠️ does this break things?

Range & sRGB:

This
```
import rerun as rr
import numpy as np
import matplotlib.pyplot as plt

rr.init("image color", spawn=True)
img = np.random.random((300, 300, 3)) * 0.2
rr.log_image("image", img)
print(img.min(), img.max())  # to check they are in range [0,1]

plt.imshow(img)
plt.show()
```
Gives now the expected image:

![image](https://github.com/rerun-io/rerun/assets/1220815/9fcda125-f762-4fd4-ae24-ce6dcaaa496a)

When setting a pixel to inf, we show the "finite range" as well, and
behave correctly:
<img width="1026" alt="image"
src="https://github.com/rerun-io/rerun/assets/1220815/7d3037e8-f562-4b6c-8f08-ec4f5627c21a">

* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)

<!-- This line will get updated when the PR build summary job finishes.
-->
PR Build Summary: https://build.rerun.io/pr/2342

<!-- pr-link-docs:start -->
Docs preview: https://rerun.io/preview/93697e6/docs
Examples preview: https://rerun.io/preview/93697e6/examples
<!-- pr-link-docs:end -->
@Wumpf Wumpf changed the title Allow to specify a tensor's data range of component via component Allow to specify a tensor's data range via component Jan 9, 2024
@Wumpf Wumpf self-assigned this Sep 27, 2024
@Wumpf Wumpf added this to the 0.19 - Dataframe and web video milestone Sep 27, 2024
@Wumpf Wumpf closed this as completed in c4eb805 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use 🐍 Python API Python logging API 🦀 Rust API Rust logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant