Skip to content

[BUG] Failed to show polylines with holes in browser #5651

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

Open
1 of 3 tasks
imyhxy opened this issue Mar 26, 2025 · 2 comments
Open
1 of 3 tasks

[BUG] Failed to show polylines with holes in browser #5651

imyhxy opened this issue Mar 26, 2025 · 2 comments
Labels
bug Bug fixes

Comments

@imyhxy
Copy link
Contributor

imyhxy commented Mar 26, 2025

Instructions

Describe the problem

Describe the problem clearly here. Include descriptions of the expected
behavior and the actual behavior.

I create a polylines label from a mask image, which contains multiply holes. This labels can be showed correctly by draw_labels, but failed to view on the browser. The hole is not being show correctly.

Image output by draw_labels:
Image

Screenshot from browser:
Image

Code to reproduce issue

import eta.core.annotations as etaa

import fiftyone as fo

mask_path = "mask.png"
seg = fo.Segmentation(mask_path=mask_path)

polylines = seg.to_polylines({1: "smoke", 2: "fire"})

im_path = "image.jpg"

sam = fo.Sample(filepath=im_path)
sam["segmentation"] = seg
sam["polylines"] = polylines
ds = fo.Dataset()
_ = ds.add_sample(sam)
colormap_config = etaa.ColormapConfig(
    {
        "type": "eta.core.annotations.ManualColormap",
        "config": {"colors": [
            "#a6cee3", "#1f78b4", "#b2df8a", "#33a02c",
            "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00",
            "#cab2d6", "#6a3d9a", "#ffff99", "#b15928"
        ]},
    }
)
ds.draw_labels("label_out", label_fields="polylines", colormap_config=colormap_config,
               per_polyline_label_colors=True,
               per_polyline_name_colors=True

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 22.04): Linux Ubuntu 24.04
  • Python version (python --version): Python 3.11.8
  • FiftyOne version (fiftyone --version): FiftyOne v1.3.1, Voxel51, Inc.
  • FiftyOne installed from (pip or source): 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, don't know about typescript.

image_and_mask.zip

@imyhxy imyhxy added the bug Bug fixes label Mar 26, 2025
@benjaminpkane
Copy link
Contributor

benjaminpkane commented Apr 1, 2025

Pardon the delay @imyhxy. Are you able to share the mask png? I see the zip. Thanks! Taking a look

@imyhxy
Copy link
Contributor Author

imyhxy commented Apr 9, 2025

@benjaminpkane Hi, do you find any issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants