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

Unexpected error when logging Segmentation Image and Annotation Context together #6443

Closed
jleibs opened this issue May 27, 2024 · 0 comments · Fixed by #6449
Closed

Unexpected error when logging Segmentation Image and Annotation Context together #6443

jleibs opened this issue May 27, 2024 · 0 comments · Fixed by #6449
Assignees
Labels
🪳 bug Something isn't working 🐍 Python API Python logging API
Milestone

Comments

@jleibs
Copy link
Member

jleibs commented May 27, 2024

Repro

This fails:

import numpy as np
import rerun as rr

image = np.zeros((8, 12), dtype=np.uint8)
image[0:4, 0:6] = 1
image[4:8, 6:12] = 2

rr.init("rerun_example_segmentation_image", spawn=True)

rr.log(
    "/image",
    rr.SegmentationImage(image),
    rr.AnnotationContext([(1, "red", (255, 0, 0)), (2, "green", (0, 255, 0))]),
)

And produces the error:

[2024-05-27T21:27:54Z ERROR re_space_view_spatial::visualizers::images] Failed to create rectangle draw data from images: Color mapping is being applied to a four-component RGBA texture

This works:

import numpy as np
import rerun as rr

image = np.zeros((8, 12), dtype=np.uint8)
image[0:4, 0:6] = 1
image[4:8, 6:12] = 2

rr.init("rerun_example_segmentation_image", spawn=True)

rr.log(
    "/image",
    rr.SegmentationImage(image),
)

rr.log(
    "/image",
    rr.AnnotationContext([(1, "red", (255, 0, 0)), (2, "green", (0, 255, 0))]),
)

Expected Behavior

These should be equivalent.

@jleibs jleibs added 🪳 bug Something isn't working 🐍 Python API Python logging API labels May 27, 2024
@Wumpf Wumpf added this to the 0.16.1 milestone May 28, 2024
@Wumpf Wumpf self-assigned this May 28, 2024
@Wumpf Wumpf closed this as completed in 9adb3e4 May 29, 2024
abey79 pushed a commit that referenced this issue May 29, 2024
* Fixes #6443
* the problem was that we use row ids for hashing texture manager
entries. Instead, we need to use a combination of texture meaning + row
id, because the same row may give rise to several textures!
* Fixes this also for any other combination of textures on the same row
(e.g. depth + regular)
* Fixes bad error message display

* [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)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6449?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6449?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6449)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants