10000 Bugs in label2rgb · Issue #4657 · scikit-image/scikit-image · GitHub
[go: up one dir, main page]

Skip to content
Bugs in label2rgb #4657
@emmanuelle

Description

@emmanuelle

There seem to be one or several bugs in label2rgb. I discovered this when building the website doc for 0.17.0 and it might be serious enough that I want to hold the release.

For example

img = np.random.randint(0, 255, (10, 10), dtype=np.uint8) 
labels = np.zeros((10, 10), dtype=np.uint8)
labels[1:3, 1:3]=1
labels[
5C84
6:9, 6:9] = 2
color.label2rgb(labels, image=img, bg_color=0)

gives a ValueError

In the gallery segmentation/plot_label.py example, label2rgb is returning an array of floats which is bizarre, and the floats are between 0 and 255.

The broken gallery examples are
https://scikit-image.org/docs/dev/auto_examples/segmentation/plot_join_segmentations.html#sphx-glr-auto-examples-segmentation-plot-join-segmentations-py
https://scikit-image.org/docs/dev/auto_examples/segmentation/plot_label.html#sphx-glr-auto-examples-segmentation-plot-label-py
https://scikit-image.org/docs/dev/auto_examples/segmentation/plot_compact_watershed.html#sphx-glr-auto-examples-segmentation-plot-compact-watershed-py

If someone has the time to investigate that'd be awesome because I'm reluctant to release with such a regression (BTW I already pushed the stable docs for this branch but we can upload a new version after when we have a fix, it's not as bad as having a buggy version on Pypi).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚠️ PriorityThis issue or PR should be given priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0