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

[BUG] recent versions don't render uint16 semantic segmentation masks anymore? #5363

Open
1 of 3 tasks
cgebbe opened this issue Jan 9, 2025 · 1 comment
Open
1 of 3 tasks
Assignees
Labels
app Issues related to App features bug Bug fixes high priority Issues of high priority

Comments

@cgebbe
Copy link

cgebbe commented Jan 9, 2025

Describe the problem

We updated from 1.0.1 to 1.2.0 and somehow our uint16 semantic segmentation masks are often not rendered anymore.

Can you reproduce this on your side or at least confirm that relevant code has been changed between these two versions?

Code to reproduce issue

When running the code below, then masks are rendered using 1.0.1, but not with 1.2.0.

There seem to be some exceptions: When using 1.2.0 and launching a dataset with np.uint8 masks and then switching to a dataset with uint16 masks in the UI, they are rendered again (sometimes)? It's a bit tedious to reproduce, since a restart seems to be necessary when switching versions.

import fiftyone as fo
from PIL import Image
import numpy as np
from pathlib import Path


def _save(x: np.ndarray, path: Path):
    Image.fromarray(x).save(path)
    return path


# write image
hw = 32
rng = np.random.default_rng(42)
img = rng.integers(80, 120, size=(hw, hw, 3), dtype=np.uint8)
mask = rng.integers(0, 255, size=(hw, hw), dtype=np.uint16)

# save sample
img_path = _save(img, "/tmp/img.png")
mask_path = _save(mask, "/tmp/mask.png")
sample = fo.Sample(filepath=img_path)
sample["semseg"] = fo.Segmentation(mask_path=mask_path)

# create dataset
ds = fo.Dataset("tmp_055", overwrite=True, persistent=False)
ds.add_sample(sample)
fo.launch_app(ds)

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 22.04): Linux Ubuntu 20.04.6 LTS
  • Python version (python --version): 3.11
  • FiftyOne version (fiftyone --version): 1.01 or 1.2.0
  • FiftyOne installed from (pip or source): uv pip

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?

  • Yes. I can contribute a fix for this bug independently
  • Yes. I would be willing to contribute a fix for this bug with guidance
    from the FiftyOne community
  • No. I cannot contribute a bug fix at this time
@cgebbe cgebbe added the bug Bug fixes label Jan 9, 2025
@benjaminpkane
Copy link
Contributor

Thank you for the thorough report @cgebbe. We are looking into this!

@benjaminpkane benjaminpkane added the high priority Issues of high priority label Jan 9, 2025
@benjaminpkane benjaminpkane added the app Issues related to App features label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Issues related to App features bug Bug fixes high priority Issues of high priority
Projects
None yet
Development

No branches or pull requests

3 participants